[MINC-users] ecattominc seg fault on 64-bit Lucid

EJ Nikelski nikelski at bic.mni.mcgill.ca
Tue Jan 18 15:13:37 EST 2011


Hi List,

   OK, the ecattominc problem has been identified and fixed (thanks to
Claude for consultation).  It is indeed a 64-bit issue. Specifically,
ecattominc freads 32-bit ints from the ecat file into a IO buffer
typed as (long).  This works spiffingly on a 32-bit ILP architecture,
but less so with 64-bit longs in which case 2 ints are read into a
single long, resulting in corruption.  This main solution is to fix
the buffer type to int32_t. A few additional downstream changes are
also required.

  I'm sending this to minc-users, since it's pretty easy to get bitten
by this bug.  You'll see the problem if you:
(1) use ecattominc
(2) use a 64-bit OS
(3) process dynamic volumes

 I've tested the fix on > 100 dynamic volumes, and all looks OK.  Now
I just need a minc-dev with commit privileges to contact me, and I'll
happily send the diffs their way for inclusion in the next minc build.

Cheers,

-jim




On Tue, Jan 4, 2011 at 12:32 AM, EJ Nikelski <nikelski at bic.mni.mcgill.ca> wrote:
> Hi All,
>
>   I've been using ecattominc to convert 7-frame dynamic volumes
> (acquired at the MNI) to minc for some time, without any trouble.
> Today, however, I installed the minc tools on to a relatively fresh
> 64-bit Lucid system, and I'm now getting seg faults (minc-2.1.00). The
> abort occurs consistently while opening the ecat file and appears to
> occur within the "/* Save the offsets */" loop of function
> ecat_read_directory (ecat_file.c). The precise loop number at which
> the seg fault occurs is variable, suggesting that this is related
> either to an uninitialized variable, or some 32-bit versus 64-bit
> issue (the same ecat volume does not cause a seg fault on our 32-bit
> system).
>
>  Any ideas or suggestions?  I'm willing to test any suggested code
> modifications.  I've already done a fair bit of poking around and
> re-compiling, but my knowledge of ecat header internals is lacking.
>
> Thanks,
>
> -jim
>
> --
> =================================
> Jim Nikelski, Ph.D.
> Postdoctoral Research Fellow
> Bloomfield Centre for Research in Aging
> Lady Davis Institute for Medical Research
> Sir Mortimer B. Davis - Jewish General Hospital
> McGill University
>



-- 
=================================
Jim Nikelski, Ph.D.
Postdoctoral Research Fellow
Bloomfield Centre for Research in Aging
Lady Davis Institute for Medical Research
Sir Mortimer B. Davis - Jewish General Hospital
McGill University


More information about the MINC-users mailing list