AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
January 31, 2013 03:39PM
Hi gurus,

I just ran into some memory nastiness with 3dClustSim using a small mask. It happened after the output file was successfully written, so it probably doesn't matter in the grand scheme of things, but I figure that any time malloc() blows chunks you'd like to hear about it.

Here are some small failure cases:

$ 3dUndump -srad 2 -dimen 10 10 10 - <<<'5 5 5'
$ 3dClustSim -OKsmallmask -mask undump+orig -niml
    ... normal output here, including CAUTION and CAVEAT ...

*** glibc detected *** 3dClustSim: munmap_chunk(): invalid pointer: 0x0000000002f65088 ***
*** glibc detected *** 3dClustSim: malloc(): memory corruption: 0x0000000002f690a0 ***
*** glibc detected *** 3dClustSim: malloc(): memory corruption: 0x0000000002f690a0 ***
    ...
*** glibc detected *** 3dClustSim: malloc(): memory corruption: 0x0000000002f690a0 ***
*** glibc detected *** 3dClustSim: malloc(): memory corruption: 0x0000000002f690a0 ***
Aborted
$ 3dClustSim -OKsmallmask -mask undump+orig -NN 123 -LOTS
    ... more normal output ...

*** MCW_malloc post-corruption!  serial=446 size=16385 source=debugtrace.c line#44
 <- 3dClustSim
*** glibc detected *** 3dClustSim: free(): invalid next size (normal): 0x000000000409c310 ***
======= Backtrace: =========
/lib64/libc.so.6[0x387c075916]
/lib64/libc.so.6[0x387c078443]
3dClustSim[0x410a86]
3dClustSim[0x411533]
3dClustSim[0x41183c]
3dClustSim[0x40da55]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x387c01ecdd]
3dClustSim[0x407e29]
======= Memory map: ========
00400000-00713000 r-xp 00000000 00:24 9314492                            /home/schwabacher/abin/3dClustSim
00812000-00855000 rw-p 00312000 00:24 9314492                            /home/schwabacher/abin/3dClustSim
00855000-00888000 rw-p 00000000 00:00 0 
01ed4000-040bc000 rw-p 00000000 00:00 0                                  [heap]
387bc00000-387bc20000 r-xp 00000000 08:01 786459                         /lib64/ld-2.12.so
387be1f000-387be20000 r--p 0001f000 08:01 786459                         /lib64/ld-2.12.so
387be20000-387be21000 rw-p 00020000 08:01 786459                         /lib64/ld-2.12.so
387be21000-387be22000 rw-p 00000000 00:00 0 
387c000000-387c189000 r-xp 00000000 08:01 786469                         /lib64/libc-2.12.so
387c189000-387c389000 ---p 00189000 08:01 786469                         /lib64/libc-2.12.so
387c389000-387c38d000 r--p 00189000 08:01 786469                         /lib64/libc-2.12.so
387c38d000-387c38e000 rw-p 0018d000 08:01 786469                         /lib64/libc-2.12.so
387c38e000-387c393000 rw-p 00000000 00:00 0 
387c400000-387c483000 r-xp 00000000 08:01 786491                         /lib64/libm-2.12.so
387c483000-387c682000 ---p 00083000 08:01 786491                         /lib64/libm-2.12.so
387c682000-387c683000 r--p 00082000 08:01 786491                         /lib64/libm-2.12.so
387c683000-387c684000 rw-p 00083000 08:01 786491                         /lib64/libm-2.12.so
387c800000-387c802000 r-xp 00000000 08:01 786489                         /lib64/libdl-2.12.so
387c802000-387ca02000 ---p 00002000 08:01 786489                         /lib64/libdl-2.12.so
387ca02000-387ca03000 r--p 00002000 08:01 786489                         /lib64/libdl-2.12.so
387ca03000-387ca04000 rw-p 00003000 08:01 786489                         /lib64/libdl-2.12.so
387cc00000-387cc08000 r-xp 00000000 08:01 936763                         /usr/lib64/libXp.so.6.2.0
387cc08000-387ce08000 ---p 00008000 08:01 936763                         /usr/lib64/libXp.so.6.2.0
387ce08000-387ce09000 rw-p 00008000 08:01 936763                         /usr/lib64/libXp.so.6.2.0
387d000000-387d015000 r-xp 00000000 08:01 786544                         /lib64/libz.so.1.2.3
387d015000-387d214000 ---p 00015000 08:01 786544                         /lib64/libz.so.1.2.3
387d214000-387d215000 r--p 00014000 08:01 786544                         /lib64/libz.so.1.2.3
387d215000-387d216000 rw-p 00015000 08:01 786544                         /lib64/libz.so.1.2.3
387e800000-387e81b000 r-xp 00000000 08:01 921338                         /usr/lib64/libxcb.so.1.1.0
387e81b000-387ea1a000 ---p 0001b000 08:01 921338                         /usr/lib64/libxcb.so.1.1.0
387ea1a000-387ea1b000 rw-p 0001a000 08:01 921338                         /usr/lib64/libxcb.so.1.1.0
387ec00000-387ec02000 r-xp 00000000 08:01 921237                         /usr/lib64/libXau.so.6.0.0
387ec02000-387ee02000 ---p 00002000 08:01 921237                         /usr/lib64/libXau.so.6.0.0
387ee02000-387ee03000 rw-p 00002000 08:01 921237                         /usr/lib64/libXau.so.6.0.0
387f000000-387f026000 r-xp 00000000 08:01 786546                         /lib64/libexpat.so.1.5.2
387f026000-387f225000 ---p 00026000 08:01 786546                         /lib64/libexpat.so.1.5.2
387f225000-387f228000 rw-p 00025000 08:01 786546                         /lib64/libexpat.so.1.5.2
387f400000-387f539000 r-xp 00000000 08:01 921352                         /usr/lib64/libX11.so.6.3.0
387f539000-387f739000 ---p 00139000 08:01 921352                         /usr/lib64/libX11.so.6.3.0
387f739000-387f73f000 rw-p 00139000 08:01 921352                         /usr/lib64/libX11.so.6.3.0
3880000000-3880098000 r-xp 00000000 08:01 925244                         /usr/lib64/libfreetype.so.6.3.22
3880098000-3880297000 ---p 00098000 08:01 925244                         /usr/lib64/libfreetype.so.6.3.22
3880297000-388029d000 rw-p 00097000 08:01 925244                         /usr/lib64/libfreetype.so.6.3.22
3880400000-3880411000 r-xp 00000000 08:01 921376                         /usr/lib64/libXext.so.6.4.0
3880411000-3880611000 ---p 00011000 08:01 921376                         /usr/lib64/libXext.so.6.4.0
3880611000-3880612000 rw-p 00011000 08:01 921376                         /usr/lib64/libXext.so.6.4.0
3880800000-3880825000 r-xp 00000000 08:01 920634                         /usr/lib64/libpng12.so.0.49.0
3880825000-3880a25000 ---p 00025000 08:01 920634                         /usr/lib64/libpng12.so.0.49.0
3880a25000-3880a26000 rw-p 00025000 08:01 920634                         /usr/lib64/libpng12.so.0.49.0
3880c00000-3880c34000 r-xp 00000000 08:01 925261                         /usr/lib64/libfontconfig.so.1.4.4
3880c34000-3880e34000 ---p 00034000 08:01 925261                         /usr/lib64/libfontconfig.so.1.4.4
3880e34000-3880e36000 rw-p 00034000 08:01 925261                         /usr/lib64/libfontconfig.so.1.4.4
3881000000-3881009000 r-xp 00000000 08:01 925264                         /usr/lib64/libXrender.so.1.3.0
3881009000-3881209000 ---p 00009000 08:01 925264                         /usr/lib64/libXrender.so.1.3.0
3881209000-388120a000 rw-p 00009000 08:01 925264                         /usr/lib64/libXrender.so.1.3.0
3882400000-3882418000 r-xp 00000000 08:01 928624                         /usr/lib64/libXmu.so.6.2.0
3882418000-3882618000 ---p 00018000 08:01 928624                         /usr/lib64/libXmu.so.6.2.0
3882618000-388261a000 rw-p 00018000 08:01 928624                         /usr/lib64/libXmu.so.6.2.0
3883000000-3883016000 r-xp 00000000 08:01 786495                         /lib64/libgcc_s-4.4.6-20120305.so.1
3883016000-3883215000 ---p 00016000 08:01 786495                         /lib64/libgcc_s-4.4.6-20120305.so.1
3883215000-3883216000 rw-p 00015000 08:01 786495                         /lib64/libgcc_s-4.4.6-20120305.so.1
3886c00000-3886c04000 r-xp 00000000 08:01 786555                         /lib64/libuuid.so.1.3.0
3886c04000-3886e03000 ---p 00004000 08:01 786555                         /lib64/libuuid.so.1.3.0Aborted

I don't know why -NN 123 -LOTS dumps core and -niml doesn't, but more testing showed that the precise conditions for memory corruption, given the fixed input mask, were -NN (12|13|23|123) -athr LOTS -pthr LOTS. Hope this helps!

Isaac
Subject Author Posted

3dClustSim memory corruption with a small mask

Isaac Schwabacher January 31, 2013 03:39PM

Re: 3dClustSim memory corruption with a small mask

rick reynolds January 31, 2013 04:51PM

Re: 3dClustSim memory corruption with a small mask

Isaac Schwabacher January 31, 2013 06:26PM

Re: 3dClustSim memory corruption with a small mask

rick reynolds February 01, 2013 09:28AM

Re: 3dClustSim memory corruption with a small mask

Isaac Schwabacher February 01, 2013 06:23PM