Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2513 closed defect (fixed)

crash at an e00 file

Reported by: msieczka Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.5.3
Component: OGR_SF Version: svn-trunk
Severity: critical Keywords: avc
Cc: warmerdam, Daniel Morissette

Description

1.5 branch r15027

ogrinfo -al -so on the attached e00 file results in a crash:

Starting program: /usr/local/bin/ogrinfo -al -so /home/shoofi/gis/dane/europa/europa_rzeki/Ws.e00
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 0000000000000120
[New Thread 0x7f61a9f78710 (LWP 13913)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f61a9f78710 (LWP 13913)]
0x00007f61a6a521d5 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007f61a6a521d5 in raise () from /lib/libc.so.6
#1  0x00007f61a6a53680 in abort () from /lib/libc.so.6
#2  0x00007f61a98ab0f2 in CPLErrorV (eErrClass=CE_Fatal, err_no=2, 
    fmt=0x7f61a9b054d0 "CPLRealloc(): Out of memory allocating %d bytes.\n", 
    args=0x7fffb20a5e50) at cpl_error.cpp:208
#3  0x00007f61a98ab1e4 in CPLError (eErrClass=CE_Fatal, err_no=2, 
    fmt=0x7f61a9b054d0 "CPLRealloc(): Out of memory allocating %d bytes.\n")
    at cpl_error.cpp:133
#4  0x00007f61a98a8a39 in CPLRealloc (pData=0x0, nNewSize=18446744073709551584)
    at cpl_conv.cpp:192
#5  0x00007f61a98e715f in AVCE00ParseNextArcLine (psInfo=0x245b290, 
    pszLine=0x245bb04 "!-M~ '659~ '660~ (30~} ~1,}%ex& ~1-PuO% ~1-2cC& ~1/i{t%~} ~1-2uv& ~1/l,Z% ~1-9,q") at avc_e00parse.c:659
#6  0x00007f61a98e6f1c in AVCE00ParseNextLine (psInfo=0x245b290, 
    pszLine=0x245bb04 "!-M~ '659~ '660~ (30~} ~1,}%ex& ~1-PuO% ~1-2cC& ~1/i{t%~} ~1-2uv& ~1/l,Z% ~1-9,q") at avc_e00parse.c:566
#7  0x00007f61a98ead4f in _AVCE00ReadNextLineE00 (psRead=0x245c0e0, 
    pszLine=0x245bb04 "!-M~ '659~ '660~ (30~} ~1,}%ex& ~1-PuO% ~1-2cC& ~1/i{t%~} ~1-2uv& ~1/l,Z% ~1-9,q") at avc_e00read.c:811
#8  0x00007f61a98ec0eb in _AVCE00ReadScanE00 (psRead=0x245c0e0)
    at avc_e00read.c:1237
#9  0x00007f61a98ea30b in AVCE00ReadOpenE00 (
    pszE00FileName=0x245abf0 "/home/shoofi/gis/dane/europa/europa_rzeki/Ws.e00")
    at avc_e00read.c:375
#10 0x00007f61a999d4a1 in OGRAVCE00DataSource::Open (this=0x245aff0, 
    pszNewName=0x245abf0 "/home/shoofi/gis/dane/europa/europa_rzeki/Ws.e00", 
    bTestOpen=1) at ogravce00datasource.cpp:82
#11 0x00007f61a999bd74 in OGRAVCBinDriver::Open (this=0x245ae40, 
    pszFilename=0x245abf0 "/home/shoofi/gis/dane/europa/europa_rzeki/Ws.e00", 
    bUpdate=0) at ogravcbindriver.cpp:78
#12 0x00007f61a99e9fed in OGRSFDriverRegistrar::Open (
    pszName=0x245abf0 "/home/shoofi/gis/dane/europa/europa_rzeki/Ws.e00", 
    bUpdate=0, ppoDriver=0x7fffb20a6338) at ogrsfdriverregistrar.cpp:164
#13 0x000000000040235e in main (nArgc=4, papszArgv=0x24536f0)
    at ogrinfo.cpp:152

Attachments (1)

Ws.e00.bz2 (602.8 KB) - added by msieczka 11 years ago.
sample e00 file to reproduce the crash

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by msieczka

Attachment: Ws.e00.bz2 added

sample e00 file to reproduce the crash

comment:1 Changed 11 years ago by warmerdam

Cc: warmerdam Daniel Morissette added
Keywords: avc added
Owner: changed from warmerdam to Mateusz Łoskot
Priority: highnormal

Mateusz,

Could you look into this in the next few days? You will need to coordinate upstream changes with Daniel.

comment:2 Changed 11 years ago by Daniel Morissette

I am able to reproduce this with the avcimport program.

It turns out that the file is a 'compressed' E00. After uncompressing it with the e00conv program (http://avce00.maptools.org/e00compr/index.html) I am able to read it with the avcimport program.

I see two solutions to this:

1- Detect compressed E00 files and ether refuse to open them, or give a friendly error message to the users pointing them at the e00conv utility to uncompress the file. I'll check if there is an easy way we could detect compressed files when we open them.

2- Add support for reading compressed files... may require the creation of a temporary file in order to support seeking around the E00 file. If the access to the E00 file was only sequential then the decompression could possibly be done on the fly without going through a temp file.

comment:3 Changed 11 years ago by warmerdam

I think option (1) - erroring out with explanatory text - would be just fine.

Crashing... not so much so.

comment:4 Changed 11 years ago by Daniel Morissette

Resolution: fixed
Status: newclosed

Fixed in r15077. Now OGR simply refuses to open the file... but unfortunately without any warning or error to the user because the test-open phase hides all errors.

Comment copied from http://bugzilla.maptools.org/show_bug.cgi?id=1928:

I have committed a change to _AVCE00ReadScanE00() (avc_e00read.c) to detect compressed input and stop scanning right away, which will result in AVCE00ReadOpenE00() returning NULL as if the file was not recognized.

comment:5 Changed 11 years ago by Mateusz Łoskot

Daniel,

Thank you for taking it over.

comment:6 Changed 11 years ago by msieczka

Resolution: fixed
Status: closedreopened

The milestone was 1.5.3. Can you please backport?

comment:7 Changed 11 years ago by Daniel Morissette

Resolution: fixed
Status: reopenedclosed

Fix backported to 1.5 branch.

comment:8 Changed 11 years ago by Daniel Morissette

... backported to 1.5 branch in r15078.

Note: See TracTickets for help on using tickets.