Opened 10 years ago

Closed 10 years ago

#5571 closed defect (fixed)

OGR Driver GML : bug with gmlReader multiple instanciation/deletion ( using xerces)

Reported by: ibibah Owned by: warmerdam
Priority: normal Milestone: 1.11.1
Component: default Version: 1.11.0
Severity: major Keywords: Driver, GML, xerces
Cc:

Description (last modified by ibibah)

there is a bug in the gmlReader object here:

209	    if( m_nInstanceCount == 0 && m_bXercesInitialized > 0 )
210	    {
211	        XMLPlatformUtils::Terminate();
212	        m_bXercesInitialized = FALSE;   <----- here
213	    }

he's using two global variables to manage xerces initialisation. If, in one session, you're allocate a object , delete them, and reallocate another, m_bXercesInitialized = FALSE instead of -1 like the global initialisation. This result in a crash when whe call NextFeatureXerces() because, SetupParser() and then SetupParserXerces() doesn't allocate the reader and m_poSAXReader == NULL in the code below :

555	        while( m_poCompleteFeature == NULL 
556	               && !m_bStopParsing
557	               && m_poSAXReader->parseNext( m_oToFill ) ) {}

The correction is :

209	    if( m_nInstanceCount == 0 && m_bXercesInitialized > 0 )
210	    {
211	        XMLPlatformUtils::Terminate();
212	        m_bXercesInitialized = -1;   <----- correction
213	    }

Please correct this.

thanks.

Change History (4)

comment:1 by ibibah, 10 years ago

Milestone: 1.11.1

comment:2 by ibibah, 10 years ago

Description: modified (diff)

comment:3 by ibibah, 10 years ago

Keywords: Driver GML xerces → Driver,GML,xerces

comment:4 by Even Rouault, 10 years ago

Resolution: fixed
Status: newclosed

trunk r27530, branches/1.11 r27531 "GML: fix bug that prevented multiple instanciation of the reader with Xerces backend (#5571)"

trunk r27532 "Test multiple instanciation of parser (#5571)"

Note: See TracTickets for help on using tickets.