omniscale / imposm-parser

Deprecated: Python parser for OpenStreetMap data
http://imposm.org/docs/imposm.parser/latest/
Apache License 2.0
133 stars 57 forks source link

Fix a segfault in OSMBPF.so #13

Closed jocelynj closed 9 years ago

jocelynj commented 9 years ago

Thanks to python-dbg, it was found that self->ob_type->tp_free((PyObject*)self); also free the value of the pointer to the protobuf object, which means that the delete could use an incorrect address.

This fixes some cases where imposm-parser was stuck somewhere in the python library when reading PBF files.

The patch was tested by running a loop of "python imposm/parser/pbf/multiproc.py ", which failed before the patch, and no longer fails with the patch.

olt commented 9 years ago

Thanks a lot for digging into this! The fix is really appreciated.