Opened 13 years ago

Closed 13 years ago

#232 closed defect (fixed)

Static string in WKBReader causes glibc errors when Geos is statically linked

Reported by: yvesdaemen Owned by: strk
Priority: major Milestone: 3.2.0
Component: Default Version: 3.0.3
Severity: Unassigned Keywords:
Cc: dfuhry@…


I am statically linking Geos against my own C program. This program runs without problems, except until the very end when a glibc errors occurs.

I have traced this back to the static string BAD_GEOM_TYPE_MSG. When I remove the static modifier and initialise the string inside the constructor, everything goes well.

I did not get this error when linking dynamically, but Valgrind complained about an invalid free. This is probably the same thing, only my program did not crash on it.

Change History (10)

comment:1 by mloskot, 13 years ago


Isn't it a duplicate of ticket #231 ?

comment:2 by yvesdaemen, 13 years ago


I've had some problems submitting the report. Sorry for the duplicate, you can reject one of them ;-)

comment:3 by pramsey, 13 years ago


comment:4 by pramsey, 13 years ago

Can you attach a test program? Otherwise it is unlikely anyone will take the time to first create an example program before working up a general solution. Even better, attach a general purpose patch.

comment:5 by pramsey, 13 years ago

If I receive a patch, I will apply it.

comment:6 by Mike Taves, 13 years ago

I think this bug also affects the python bindings. See:

comment:7 by pramsey, 13 years ago

Owner: changed from geos-devel@… to strk

strk, any chance you can take a look at this one? If you fix in trunk I'll pull the patch back.

comment:8 by strk, 13 years ago

Resolution: worksforme
Status: newclosed

I can build GEOS trunk statically. If anyone has problem and time to give feedback feel free to reopen.

comment:9 by pramsey, 13 years ago

Resolution: worksforme
Status: closedreopened

comment:10 by pramsey, 13 years ago

Cc: dfuhry@… added
Resolution: fixed
Status: reopenedclosed

Fixed in 3.0 at r2614

Fixed in 3.1 at r2615

Fixed in trunk at r2616

Note: See TracTickets for help on using tickets.