Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msLoadMap does not properly close map files on parse error #1994

Closed
mapserver-bot opened this issue Apr 3, 2012 · 10 comments
Closed

msLoadMap does not properly close map files on parse error #1994

mapserver-bot opened this issue Apr 3, 2012 · 10 comments
Assignees

Comments

@mapserver-bot
Copy link

Reporter: scott.e@goisc.com
Date: 2006/12/29 - 19:36
Trac URL: http://trac.osgeo.org/mapserver/ticket/1994

We use C# mapscript on Windows and have been seeing behavior where a map file is
locked by the process that calls msLoadMap.  Thus the file cannot be delete
until the process is finished.  This is only occurs on parse error, and is
because fclose() is not properly called in these circumstances.

Attached is a patch which rectifies this by calling fclose() in all circumstances.
@mapserver-bot
Copy link
Author

Author: sdlime
Date: 2007/03/12 - 20:12

Will apply at first opportunity...

Steve

@mapserver-bot
Copy link
Author

Author: sdlime
Date: 2007/03/13 - 04:40

Scott: Applying the patch failed for me for both 4.10 and CVS HEAD. What version
are you using?

Steve

@mapserver-bot
Copy link
Author

Author: sdlime
Date: 2007/03/22 - 06:54

There's still a problem. Looks like the patch contains some extraneous stuff
that must be custom for you. The patch applies ok but won't compile (against CVS
HEAD). I'm getting:

mapfile.c:2636: error: `MS_SQLSPATIAL' undeclared (first use in this function)
mapfile.c:2636: error: (Each undeclared identifier is reported only once
mapfile.c:2636: error: for each function it appears in.)
mapfile.c: In function `loadMapInternal':
mapfile.c:4571: warning: unused variable `i'
mapfile.c:4571: warning: unused variable `j'
mapfile.c:4571: warning: unused variable `k'
mapfile.c:4572: warning: unused variable `szPath'
mapfile.c:4572: warning: unused variable `szCWDPath'
mapfile.c: In function `ParseMap':
mapfile.c:4604: error: argument `filename' doesn't match prototype
mapfile.c:229: error: prototype declaration
mapfile.c:4604: error: argument `new_mappath' doesn't match prototype
mapfile.c:229: error: prototype declaration
mapfile.c:4629: warning: passing arg 1 of `strdup' makes pointer from integer
without a cast
mapfile.c:4631: warning: passing arg 1 of `getPath' makes pointer from integer
without a cast
mapfile.c: In function `msLoadMap':
mapfile.c:4835: warning: unused variable `starttime'
mapfile.c:4835: warning: unused variable `endtime'

Steve

@mapserver-bot
Copy link
Author

Author: hobu
Date: 2007/05/22 - 19:08
Steve,

What's the status on this one? I know you've been reworking a lot of things for the 5.0 release, and I was wondering if these patches or something like it have made it into trunk yet.

Howard

@mapserver-bot
Copy link
Author

Author: hobu
Date: 2007/06/11 - 17:38
a9a1e95 (r6197) and 1b954e5 (r6200) are a few changesets attempting to reconcile this issue. More changes likely forthcoming for FONTSET and SYMBOLs.

@mapserver-bot
Copy link
Author

Author: sdlime
Date: 2011/02/15 - 06:47
I've no clue if this is still an issue. I'd love to close if anyone knows definitively...

Steve

@mapserver-bot
Copy link
Author

@mapserver-bot
Copy link
Author

@mapserver-bot
Copy link
Author

attachment http://trac.osgeo.org/mapserver/attachment/ticket/1994/mapfile.c.2.patch :

   newlines fixed patch

@mapserver-bot
Copy link
Author

attachment http://trac.osgeo.org/mapserver/attachment/ticket/1994/mapfile.c.4.patch :

   strip custom stuff

@ghost ghost assigned sdlime Apr 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants