Back to the main page.

Bug 2181 - nanstd: segfaults on singles

Reported 2013-05-31 11:30:00 +0200
Modified 2014-01-29 13:28:43 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Eelke Spaak
Depends on:
See also:

Roemer van der Meij - 2013-05-31 11:30:18 +0200

Nanmean works fine. Can be replicated by: nanstd(single([1 2]))

Eelke Spaak - 2013-05-31 14:23:37 +0200

Bug also occurs for nanvar. Problem was trivial and I've fixed it, but now still the computation is wrong: >> nanvar([0 1]) ans = 0.5 >> nanvar(single([0 1])) ans = 0.25 Oopsy. I will commit as soon as I've fixed this one too; better that people get an error than an incorrect answer.

Eelke Spaak - 2013-05-31 14:42:11 +0200

Fixed in revision 8165. mexa64 versions have been compiled and added. Jörn, could you compile for win32/64? And Robert, could you compile for mac32/64? Merci!

Robert Oostenveld - 2013-05-31 15:22:28 +0200

(In reply to comment #2) after ft_compile_mex I see the following in fieldtrip/src mac001> svn status ? nanmean.mexmaci64 ? nansum.mexmaci64 ? nanvar.mexmaci64 ? nanstd.mexmaci64 whereas only shows nanstd and nanvar. What about the nanmean and nansum? mac001> svn add nanvar.mexmaci64 nanstd.mexmaci64 A (bin) nanvar.mexmaci64 A (bin) nanstd.mexmaci64 mac001> svn propset autosync true nanvar.mexmaci64 nanstd.mexmaci64 property 'autosync' set on 'nanvar.mexmaci64' property 'autosync' set on 'nanstd.mexmaci64' mac001> svn commit Adding (bin) src/nanstd.mexmaci64 Adding (bin) src/nanvar.mexmaci64 Transmitting file data .. Committed revision 8166.

Eelke Spaak - 2013-05-31 15:26:25 +0200

(In reply to comment #3) The source for nanmean and nansum was not changed, only nanvar and nanstd.

Robert Oostenveld - 2013-05-31 15:30:28 +0200

I have also compiled it for 32 bit OS X. Again here the question: what about nansum and nanmean. mac001> svn commit Adding (bin) det2x2.mexmaci Adding (bin) inv2x2.mexmaci Adding (bin) mtimes2x2.mexmaci Adding (bin) nanstd.mexmaci Adding (bin) nanvar.mexmaci Adding (bin) sandwich2x2.mexmaci Transmitting file data ...... Committed revision 8167. Note that for maci I used /Applications/ -maci to force starting matlab in 32 bit mode. I don't have a more recent 32 bit version installed. For the maci64 (see previous comment) I used matlab2011b.

Robert Oostenveld - 2013-05-31 15:33:00 +0200

(In reply to comment #4) ok mac001> svn commit "enhancement - compiled previously missing mex files on 32 and 64 bit OS X (maci and maci64)" Adding (bin) src/nanmean.mexmaci Adding (bin) src/nanmean.mexmaci64 Adding (bin) src/nansum.mexmaci Adding (bin) src/nansum.mexmaci64 Transmitting file data .... Committed revision 8168. I also set the autosync flag on mexmaci and mexmaci64 files.

Robert Oostenveld - 2013-05-31 15:34:13 +0200

The new versions still need to be distributed throughout various private locations. See e.g. mac001> find . -name nanstd.mexa64 ./connectivity/private/nanstd.mexa64 ./contrib/spike/private/nanstd.mexa64 ./external/dmlt/external/utils/nanstd.mexa64 ./fileio/private/nanstd.mexa64 ./private/nanstd.mexa64 ./src/nanstd.mexa64 ./statfun/private/nanstd.mexa64 ./utilities/private/nanstd.mexa64 whereas mac001> find . -name nanstd.mexmaci ./external/dmlt/external/utils/nanstd.mexmaci ./src/nanstd.mexmaci

Robert Oostenveld - 2013-05-31 15:37:13 +0200

(In reply to comment #7) or should we consider moving to a fieldtrip/external/stats just like the fieldtrip/external/signal that we already have. ... I realize that I am still (or again) not happy with the situation with 1) fieldtrip/src 2) autosync to distribute it over many private locations

Eelke Spaak - 2013-06-06 10:36:52 +0200

(In reply to comment #2) Jorn, could you compile nanstd and nanvar for win32/64?

Jörn M. Horschig - 2013-06-06 10:42:51 +0200

svn ci nanvar.mexw* nanstd.mexw* -m "recompiled for win32/64" Sending nanstd.mexw32 Sending nanstd.mexw64 Sending nanvar.mexw32 Sending nanvar.mexw64 Transmitting file data .... Committed revision 8199. do the compiled files in src/ not have the autosync property? They should, shouldn't they?

Eelke Spaak - 2013-06-06 11:11:25 +0200

(In reply to comment #10) They should, but they don't... I'll copy them around and set up the autosync. Danke schön for compiling!

Jörn M. Horschig - 2013-06-06 11:12:42 +0200

Alsjeblieft, meneer Spaak ;)

Eelke Spaak - 2013-06-06 11:33:54 +0200

added with autosync etc.

Eelke Spaak - 2014-01-29 13:28:43 +0100

changing lots of bugs from resolved to closed.