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  

|
April 25, 2014 03:33PM
Hi gurus,

I am not going to get sucked down the rabbit hole again going after a segfault that doesn't appear to affect the actual output of the program, but before I noticed that to3d had written its output properly, I dug into the code enough to notice that the stack trace given in the error message is impossible:
% to3d -quit_on_err -prefix fingertap  \
     -time:zt 40 135 2.0sec alt+z   \
     -@ < dimon.files.run.008

++ to3d: AFNI version=AFNI_2011_12_21_1014 (Feb  9 2014) [64-bit]
++ Authored by: RW Cox
++ Counting images:  total=5400 2D slices
++ Each 2D slice is 128 X 128 pixels
++ Voxel dimensions: 1.7188 X 1.7188 X 4.0000 mm
++ Image data type = short
++ Reading images: ..........................................
++ Command line TR=2s ; Images TR=2s
++ Checking for time series outliers
 
to3d WARNING:
Significant outliers detected in these sub-bricks:
   0   1   2   3   4   5   6   7   8  12  13  34
  35  75  92  93 103 104 105 106 108 109 110 111
You should inspect the dataset for possible corruption.
 [Outliers are defined as in program 3dToutcount.     ]
 [Outliers early in an EPI time series may be due to  ]
 [the longitudinal magnetization equilibration effect.]
 [Other causes are subject movement, scanner problems,]
 [or anything that makes a time series look irregular.]
 [  3dToutcount -save outnam dataset | 1dplot -stdin  ]
 [can be used to make a dataset 'outnam' that marks   ]
 [outlier voxels; see 3dToutcount -help for details.  ]


Fatal Signal 11 (SIGSEGV) received
    THD_write_3dim_dataset
   T3D_read_images
  to3d:main
 Bottom of Debug Stack
** AFNI version = AFNI_2011_12_21_1014  Compile date = Feb  9 2014
** [[Precompiled binary linux_xorg7_64: Feb  9 2014]]
** Program Abort **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.

% 3dinfo fingertap+orig
++ 3dinfo: AFNI version=AFNI_2011_12_21_1014 (Feb  9 2014) [64-bit]

Dataset File:    fingertap+orig
Identifier Code: XYZ_fxONePteXGA6-Dz57TQJiQ  Creation Date: Fri Apr 25 13:23:43 2014
Template Space:  ORIG
Dataset Type:    Echo Planar (-epan)
Byte Order:      MSB_FIRST [this CPU native = LSB_FIRST]
Storage Mode:    BRIK
Storage Space:   176,947,200 (177 million [mega]) bytes
Geometry String: "MATRIX(0,0,-4,77.0628,1.7188,0,0,-122.266,0,-1.7188,0,97.4216):128,128,40"
Data Axes Tilt:  Plumb
Data Axes Orientation:
  first  (x) = Anterior-to-Posterior
  second (y) = Superior-to-Inferior
  third  (z) = Left-to-Right   [-orient ASL]
R-to-L extent:   -78.937 [R] -to-    77.063 [L] -step-     4.000 mm [ 40 voxels]
A-to-P extent:  -122.266 [A] -to-    96.022 [P] -step-     1.719 mm [128 voxels]
I-to-S extent:  -120.866 [I] -to-    97.422 [S] -step-     1.719 mm [128 voxels]
Number of time steps = 135  Time step = 2.00000s  Origin = 0.00000s  Number time-offset slices = 40  Thickness = 4.000
  -- At sub-brick #0 '#0' datum type is short:            0 to         14921
  -- At sub-brick #1 '#1' datum type is short:            0 to         10559
  -- At sub-brick #2 '#2' datum type is short:            0 to          9022
** For info on all 135 sub-bricks, use '3dinfo -verb' **

----- HISTORY -----
[schwabacher@guero.keck.waisman.wisc.edu: Fri Apr 25 13:23:40 2014] to3d -quit_on_err -prefix fingertap -time:zt 40 135 2.0sec alt+z 00008.SAG_OFC_tapx2_3_mm.000001.dcm 00008.SAG_OFC_tapx2_3_mm.000002.dcm 00008.SAG_OFC_tapx2_3_mm.000003.dcm ... 00008.SAG_OFC_tapx2_3_mm.005399.dcm 00008.SAG_OFC_tapx2_3_mm.005400.dcm
The only calls to THD_write_3dim_dataset() that I could find in to3d were in main(), so it looks like the debug stack isn't getting popped when T3D_read_images returns.

The last time I tracked down a post-write segfault, the culprit was an image that was getting freed early in the code path that dealt with datasets not in native byte order, so that might be the issue here as well if anyone cares enough to fix this.

I also noticed that
Dimon -gert_outdir elvis -gert_write_as_nifti -gert_create_dataset ...
doesn't move the output correctly when AFNI_COMPRESSOR is set.

HTH,
Isaac
Subject Author Posted

to3d segfault after writing output

Isaac Schwabacher April 25, 2014 03:33PM