Ticket #1648 (assigned defect)

Opened 5 years ago

Last modified 4 years ago

S-57 Update Crash with ATTF

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.8.1
Component: OGR_SF Version: 1.4.0
Severity: normal Keywords: s57
Cc: blackmoreb

Description

ogrinfo crashes when attempting to open JP352BRG.000/001. Traceback:

(gdb) where 5
#0  0x00002aaaaae2e5c1 in DDFField::GetRepeatCount (this=0x0)
    at ddffield.cpp:207
#1  0x00002aaaab1caecc in S57Reader::ApplyRecordUpdate (this=0x2aaaaeab5010, 
    poTarget=0x60e770, poUpdate=0x663830) at s57reader.cpp:2484
#2  0x00002aaaab1cb2f2 in S57Reader::ApplyUpdates (this=0x2aaaaeab5010, 
    poUpdateModule=0x7fffffe387d0) at s57reader.cpp:2618
#3  0x00002aaaab1cb612 in S57Reader::FindAndApplyUpdates (
    this=0x2aaaaeab5010, pszPath=0x51fb30 "JP352BRG.000")
    at s57reader.cpp:2718
#4  0x00002aaaab1c5b2a in S57Reader::Ingest (this=0x2aaaaeab5010)
    at s57reader.cpp:444

It appears the update adds some attributes to ATTF, but the .000 file had no ATTF at all.

Change History

Changed 5 years ago by warmerdam

  • status changed from new to assigned

Analysis confirmed. The crash occurs applying this update record:

Record 9 (114 bytes)
    Field 0001: ISO/IEC 8211 Record Identifier
    Field FRID: Feature Record Identifier field
        RCNM = 100
        RCID = 259
        PRIM = 1
        GRUP = 2
        OBJL = 129
        RVER = 2
        RUIN = 3
    Field FOID: Feature Object Identifier field
        AGEN = 260
        FIDN = 35320560
        FIDS = 259
    Field ATTF: Feature Record Attribute field
        ATTL = 148
        ATVL = `JP,JP,graph,K1045'
        ATTL = 147
        ATVL = `20060406'

To this target feature record which has no ATTF:

Record 1924 (91 bytes)
    Field 0001: ISO/IEC 8211 Record Identifier
    Field FRID: Feature Record Identifier field
        RCNM = 100
        RCID = 259
        PRIM = 1
        GRUP = 2
        OBJL = 129
        RVER = 1
        RUIN = 1
    Field FOID: Feature Object Identifier field
        AGEN = 260
        FIDN = 35320560
        FIDS = 259
    Field FSPT: Feature Record to Spatial Record Pointer field
        NAME = 0x6EEC000000     VRID RCNM = 110,RCID = 236
        ORNT = 255
        USAG = 255
        MASK = 255

The correct fix is to create an ATTF field in this situation. The minimum workaround is to avoid a crash in this situation.

Changed 5 years ago by blackmoreb

  • cc blackmoreb added

Changed 5 years ago by warmerdam

r11628 patches this in 1.4.x branch so there is no crash, though the update is not properly applied. (an error is issued).

Changed 5 years ago by warmerdam

  • milestone changed from 1.4.2 to 1.5.0

That's all I'm going to do in 1.4.x, so I'm retargetting this to 1.5

Changed 4 years ago by warmerdam

  • milestone changed from 1.5.0 to 1.5.1
Note: See TracTickets for help on using tickets.