Opened 17 years ago

Closed 17 years ago

#2108 closed defect (fixed)

JavaMapscript parsing error because of incorrect placement of parser locks in msLoadMap

Reported by: unicoletti Owned by: sdlime
Priority: highest Milestone:
Component: MapServer C Library Version:
Severity: blocker Keywords:
Cc:

Description

The error is reproducible by running the make test target of java mapscript. The WxSTest will fail because of a suspicious parsing error near line 1 of of the test.map supplied with mapserver.

The error is due to an incorrect placement of the parser locks in msLoadMap (mapfile.c, line 4774): the acquisition of the lock happens only after the the global lexer variables msyystate, msyylineno and msyylex() and msyyrestart(msyyin) have been initialized and called. Since WxSTest is a highly concurrent application (100 threads) it systematically triggered this race condition.

Even worse when the parsing error happened the exit strategy did not relase the lock, thus locking up the whole JVM. The error is very probably affecting all mapscript (except for python because of the GIL) and possibly also fastcgi.

The msLoadMapFromString function is also wrong.

Change History (3)

comment:1 by unicoletti, 17 years ago

Fixed msLoadMap in revision 6167.

msLoadMapFromString still wrong.

comment:2 by sdlime, 17 years ago

Will fix msLoadMapFromString...

Steve

comment:3 by sdlime, 17 years ago

Resolution: fixed
Status: newclosed

Fixed msLoadMapFromString too. Closing...

Steve

Note: See TracTickets for help on using tickets.