Opened 17 years ago
Closed 17 years ago
#1883 closed defect (fixed)
Threading issue with OGR MI_TAB driver
Reported by: | ksgeograf | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.3 |
Component: | OGR_SF | Version: | 1.4.2 |
Severity: | normal | Keywords: | mitab threading |
Cc: | Daniel Morissette |
Description
I have discovered and fixed a problem with the MI_TAB part of OGR. The problem occurs when OGR is used in a threaded environment (such as the MapGuide Server).
In mitab_datfile.cpp the functions ReadCharField and ReadDateField both use a static allocated buffer to return the results. This causes memory violations when one thread is reading the buffer and another is writing it.
The fix is simple, just add a member variable that can act as buffer, and remove the statically allocated buffers. This gives a slight overhead in memory consumption, but enables threading.
The attached DIFF file can be used to patch the gdal/ogr version found in the MapGudie Server svn trunk (don't now the exact version used there).
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | OGR TAB ThreadFix.diff added |
---|
comment:1 by , 17 years ago
Cc: | added |
---|---|
Status: | new → assigned |
I'll take care of this in OGR and upstream in MITAB when I get back tomorrow.
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Diff file, to be used against the MapGuide Server Trunk version