JohnWStockwellJr / SeisUnix

The CWP/SU: Seismic Un*x Package - a free open seismic processing, research, and educational software package. Please seek distribution gzipped tar files at https://wiki.Seismic-Unix.org not the Github version.
https://wiki.Seismic-Unix.org
Other
262 stars 123 forks source link

segdwrite Segmentation fault (core dumped) error #183

Open Aib-wang opened 1 day ago

Aib-wang commented 1 day ago

I build the seisunix package with the make configure option #XDRFLAG = -DSUXDR. When using segywrite, the 'Segmentation fault (core dumped) error' occured. I checked the source code of segywrite.c and find the error occured at line #295 efread(ebcbuf, 1, EBCBYTES, pipefp);. The efread function is not in the standard library, and i don't know how to debug further. The system is Ubuntu 22.04.

Aib-wang commented 1 day ago
suplane > plane.su
segyhdrs < plane.su bfile=plane.bin hfile=plane.txt
segywrite < plane.su tape=plane.sgy hfile=plane.txt bfile=plane.bin verbose=1 ebcdic=0

Error occurred with shell script running above. I used the suxwigb < plane.su verbose=1, the segmentation fault error occurred again. After tracking, error is dropped at line #307 if (fread(z,sizeof(float),nz,infp)!=nz) in src/xplot/main/xwigb.c. The error may be related to the variable infp, origin from line #233-237 when using the function of efseeko(). So, I don't know whether both two errors are related to IO functions included in include/par.h with naming pattern of e****, e.g. efopen, efseek. I wonder that if these functions link to the specified system or build options?