Bug#1057665: python-mapnik: Segfault when importing with python3.12

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 6 21:18:13 GMT 2023


Source: python-mapnik
Version: 1:0.0~20200224-7da019cf9-5
Severity: serious
Tags: upstream
Justification: makes the package in question unusable or mostly so

Dear Maintainer,

Importing the module with python3.12 results in a segfault:

 $ python3.12 -c 'import mapnik'
 Segmentation fault
 $ 

This does not happen with python3.11:

 $ python3.11 -c 'import mapnik'
 $ 

Backtrace:

 # gdb -args python3.12 -c 'import mapnik'
 GNU gdb (Debian 13.2-1) 13.2
 Copyright (C) 2023 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 Type "show copying" and "show warranty" for details.
 This GDB was configured as "x86_64-linux-gnu".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 <https://www.gnu.org/software/gdb/bugs/>.
 Find the GDB manual and other documentation resources online at:
     <http://www.gnu.org/software/gdb/documentation/>.
 
 For help, type "help".
 Type "apropos word" to search for commands related to "word"...
 Reading symbols from python3.12...
 Reading symbols from /usr/lib/debug/.build-id/f0/4aa612852535800fe6d4b638c0e386059e2267.debug...
 (gdb) run
 Starting program: /usr/bin/python3.12 -c import\ mapnik
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 
 Program received signal SIGSEGV, Segmentation fault.
 type_new_get_bases (type=<synthetic pointer>, ctx=<synthetic pointer>) at ../Objects/typeobject.c:3834
 3834    ../Objects/typeobject.c: No such file or directory.
 (gdb) backtrace
 #0  type_new_get_bases (type=<synthetic pointer>, ctx=<synthetic pointer>) at ../Objects/typeobject.c:3834
 #1  type_new (metatype=0x7ffff79f1300 <boost::python::class_metatype_object>, args=('Query', (0x0,), {'__module__': 'mapnik._mapnik', '__doc__': 'a spatial query data object'}), kwds=0x0) at ../Objects/typeobject.c:3914
 #2  0x000000000052cc35 in type_call (kwds=0x0, args=('Query', (0x0,), {'__module__': 'mapnik._mapnik', '__doc__': 'a spatial query data object'}), type=0x7ffff79f1300 <boost::python::class_metatype_object>)
     at ../Objects/typeobject.c:1661
 #3  _PyObject_MakeTpCall (tstate=0xbaf188 <_PyRuntime+459656>, callable=<type at remote 0x7ffff79f1300>, args=<optimized out>, nargs=3, keywords=0x0) at ../Objects/call.c:240
 #4  0x0000000000501dc9 in _PyObject_CallFunctionVa (is_size_t=0, va=0x7fffffffcb00, format=<optimized out>, callable=<type at remote 0x7ffff79f1300>, tstate=0xbaf188 <_PyRuntime+459656>) at ../Objects/call.c:556
 #5  PyEval_CallFunction (callable=<type at remote 0x7ffff79f1300>, format=<optimized out>) at ../Objects/call.c:602
 #6  0x00007ffff79ce503 in boost::python::call<boost::python::api::object, char const*, boost::python::handle<_object>, boost::python::dict> (a0=@0x7fffffffcc40: 0x7ffff78d11aa "Query", a1=<synthetic pointer>..., a2=..., 
     callable=<type at remote 0x7ffff79f1300>) at ./boost/python/cast.hpp:87
 #7  boost::python::api::object_operators<boost::python::api::object>::operator()<char const*, boost::python::handle<_object>, boost::python::dict> (a2=..., a1=<synthetic pointer>..., a0=@0x7fffffffcc40: 0x7ffff78d11aa "Query", 
     this=0x7fffffffcc90) at ./boost/python/object_call.hpp:19
 #8  boost::python::objects::(anonymous namespace)::new_class (doc=0x7ffff78d118e "a spatial query data object", types=0x7fffffffce60, num_types=<optimized out>, name=0x7ffff78d11aa "Query") at libs/python/src/object/class.cpp:570
 #9  boost::python::objects::class_base::class_base (this=0x7fffffffcd40, name=0x7ffff78d11aa "Query", num_types=<optimized out>, types=0x7fffffffce60, doc=0x7ffff78d118e "a spatial query data object")
     at libs/python/src/object/class.cpp:586
 #10 0x00007ffff7815512 in export_query() () from /usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so
 #11 0x00007ffff7806e05 in init_module__mapnik() () from /usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so
 #12 0x00007ffff79d78a3 in boost::function0<void>::operator() (this=0x7fffffffd360) at ./boost/function/function_template.hpp:763
 #13 boost::python::handle_exception_impl (f=...) at libs/python/src/errors.cpp:25
 #14 0x00007ffff79d80fc in boost::python::handle_exception<void (*)()> (f=<optimized out>) at ./boost/python/errors.hpp:29
 #15 boost::python::detail::(anonymous namespace)::init_module_in_scope (init_function=0x7ffff7806cd0 <init_module__mapnik()>, m=<module at remote 0x7ffff7ab7ce0>) at libs/python/src/module.cpp:24
 #16 boost::python::detail::init_module (moduledef=..., init_function=0x7ffff7806cd0 <init_module__mapnik()>) at libs/python/src/module.cpp:43
 #17 0x000000000066909f in _PyImport_LoadDynamicModuleWithSpec (fp=<optimized out>, 
     spec=<ModuleSpec(name='mapnik._mapnik', loader=<ExtensionFileLoader(name='mapnik._mapnik', path='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so') at remote 0x7ffff7ae4110>, origin='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so', loader_state=None, submodule_search_locations=None, _uninitialized_submodules=[], _set_fileattr=True, _cached=None) at remote 0x7ffff7ae4140>) at ../Python/importdl.c:169
 #18 _imp_create_dynamic_impl (module=<optimized out>, file=<optimized out>, 
     spec=<ModuleSpec(name='mapnik._mapnik', loader=<ExtensionFileLoader(name='mapnik._mapnik', path='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so') at remote 0x7ffff7ae4110>, origin='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so', loader_state=None, submodule_search_locations=None, _uninitialized_submodules=[], _set_fileattr=True, _cached=None) at remote 0x7ffff7ae4140>) at ../Python/import.c:3775
 #19 _imp_create_dynamic (module=<optimized out>, args=<optimized out>, nargs=<optimized out>) at ../Python/clinic/import.c.h:506
 #20 0x000000000056887e in cfunction_vectorcall_FASTCALL (func=<built-in method create_dynamic of module object at remote 0x7ffff7bfec00>, args=0x7ffff7a3d798, nargsf=<optimized out>, kwnames=<optimized out>)
     at ../Include/cpython/methodobject.h:50
 #21 0x0000000000543b0c in PyCFunction_Call (kwargs={}, 
     args=(<ModuleSpec(name='mapnik._mapnik', loader=<ExtensionFileLoader(name='mapnik._mapnik', path='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so') at remote 0x7ffff7ae4110>, origin='/usr/lib/python3/dist-packages/mapnik/_mapnik.cpython-312-x86_64-linux-gnu.so', loader_state=None, submodule_search_locations=None, _uninitialized_submodules=[], _set_fileattr=True, _cached=None) at remote 0x7ffff7ae4140>,), 
     callable=<built-in method create_dynamic of module object at remote 0x7ffff7bfec00>) at ../Objects/call.c:387
 #22 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/bytecodes.c:3254
 #23 0x0000000000567dd0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=2, args=0x7fffffffd6a0, callable=<function at remote 0x7ffff7c08040>, tstate=0xbaf188 <_PyRuntime+459656>) at ../Include/internal/pycore_call.h:92
 #24 object_vacall (tstate=0xbaf188 <_PyRuntime+459656>, base=<optimized out>, callable=<function at remote 0x7ffff7c08040>, vargs=0x7fffffffd730) at ../Objects/call.c:850
 #25 0x00000000005a43a0 in PyObject_CallMethodObjArgs (obj=<optimized out>, name=<optimized out>) at ../Objects/call.c:911
 #26 0x00000000005a38c6 in import_find_and_load (abs_name='mapnik._mapnik', tstate=0xbaf188 <_PyRuntime+459656>) at ../Python/import.c:2779
 #27 PyImport_ImportModuleLevelObject (name='_mapnik', globals=<optimized out>, locals=<optimized out>, fromlist=('*',), level=1) at ../Python/import.c:2862
 #28 0x0000000000544fee in import_name (level=1, fromlist=('*',), name='_mapnik', frame=<optimized out>, tstate=<optimized out>) at ../Python/ceval.c:2484
 #29 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/bytecodes.c:2135
 #30 0x000000000063743c in _PyEval_EvalFrame (throwflag=0, frame=0x7ffff7fb6378, tstate=0xbaf188 <_PyRuntime+459656>) at ../Include/internal/pycore_ceval.h:89
 #31 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, locals=<optimized out>, func=0x7ffff7a28cc0, tstate=0xbaf188 <_PyRuntime+459656>) at ../Python/ceval.c:1683
 #32 PyEval_EvalCode (co=<code at remote 0xc5bcb0>, globals=<optimized out>, locals=<optimized out>) at ../Python/ceval.c:578
 #33 0x000000000064e8a6 in builtin_exec_impl (module=<optimized out>, closure=<optimized out>, 
     locals={'__name__': 'mapnik', '__doc__': "Mapnik Python module.\n\nBoost Python bindings to the Mapnik C++ shared library.\n\nSeveral things happen when you do:\n\n    >>> import mapnik\n\n 1) Mapnik C++ objects are imported via the '__init__.py' from the '_mapnik.so' shared object\n    (_mapnik.pyd on win) which references libmapnik.so (linux), libmapnik.dylib (mac), or\n    mapnik.dll (win32).\n\n 2) The paths to the input plugins and font directories are imported from the 'paths.py'\n    file which was constructed and installed during SCons installation.\n\n 3) All available input plugins and TrueType fonts are automatically registered.\n\n 4) Boost Python metaclass injectors are used in the '__init__.py' to extend several\n    objects adding extra convenience when accessed via Python.\n\n", '__package__': 'mapnik', '__loader__': <SourceFileLoader(name='mapnik', path='/usr/lib/python3/dist-packages/mapnik/__init__.py') at remote 0x7ffff7a09d90>, '__spec__': <ModuleSpec(name='mapnik', loader=<...>, origin='/usr/li...(truncated), 
     globals={'__name__': 'mapnik', '__doc__': "Mapnik Python module.\n\nBoost Python bindings to the Mapnik C++ shared library.\n\nSeveral things happen when you do:\n\n    >>> import mapnik\n\n 1) Mapnik C++ objects are imported via the '__init__.py' from the '_mapnik.so' shared object\n    (_mapnik.pyd on win) which references libmapnik.so (linux), libmapnik.dylib (mac), or\n    mapnik.dll (win32).\n\n 2) The paths to the input plugins and font directories are imported from the 'paths.py'\n    file which was constructed and installed during SCons installation.\n\n 3) All available input plugins and TrueType fonts are automatically registered.\n\n 4) Boost Python metaclass injectors are used in the '__init__.py' to extend several\n    objects adding extra convenience when accessed via Python.\n\n", '__package__': 'mapnik', '__loader__': <SourceFileLoader(name='mapnik', path='/usr/lib/python3/dist-packages/mapnik/__init__.py') at remote 0x7ffff7a09d90>, '__spec__': <ModuleSpec(name='mapnik', loader=<...>, origin='/usr/li...(truncated), source=<code at remote 0xc5bcb0>) at ../Python/bltinmodule.c:1096
 #34 builtin_exec (module=<optimized out>, args=<optimized out>, nargs=2, kwnames=<optimized out>) at ../Python/clinic/bltinmodule.c.h:586
 #35 0x000000000055a4ad in cfunction_vectorcall_FASTCALL_KEYWORDS (func=<built-in method exec of module object at remote 0x7ffff7bfd760>, args=0x7ffff7a13058, nargsf=<optimized out>, kwnames=<optimized out>)
     at ../Include/cpython/methodobject.h:50
 #36 0x0000000000543b0c in PyCFunction_Call (kwargs={}, 
     args=(<code at remote 0xc5bcb0>, {'__name__': 'mapnik', '__doc__': "Mapnik Python module.\n\nBoost Python bindings to the Mapnik C++ shared library.\n\nSeveral things happen when you do:\n\n    >>> import mapnik\n\n 1) Mapnik C++ objects are imported via the '__init__.py' from the '_mapnik.so' shared object\n    (_mapnik.pyd on win) which references libmapnik.so (linux), libmapnik.dylib (mac), or\n    mapnik.dll (win32).\n\n 2) The paths to the input plugins and font directories are imported from the 'paths.py'\n    file which was constructed and installed during SCons installation.\n\n 3) All available input plugins and TrueType fonts are automatically registered.\n\n 4) Boost Python metaclass injectors are used in the '__init__.py' to extend several\n    objects adding extra convenience when accessed via Python.\n\n", '__package__': 'mapnik', '__loader__': <SourceFileLoader(name='mapnik', path='/usr/lib/python3/dist-packages/mapnik/__init__.py') at remote 0x7ffff7a09d90>, '__spec__': <ModuleSpec(name='mapnik', l...(truncated), callable=<built-in method exec of module object at remote 0x7ffff7bfd760>) at ../Objects/call.c:387
 #37 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/bytecodes.c:3254
 #38 0x0000000000567dd0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=2, args=0x7fffffffdcd0, callable=<function at remote 0x7ffff7c08040>, tstate=0xbaf188 <_PyRuntime+459656>) at ../Include/internal/pycore_call.h:92
 #39 object_vacall (tstate=0xbaf188 <_PyRuntime+459656>, base=<optimized out>, callable=<function at remote 0x7ffff7c08040>, vargs=0x7fffffffdd60) at ../Objects/call.c:850
 #40 0x00000000005a43a0 in PyObject_CallMethodObjArgs (obj=<optimized out>, name=<optimized out>) at ../Objects/call.c:911
 #41 0x00000000005a38c6 in import_find_and_load (abs_name='mapnik', tstate=0xbaf188 <_PyRuntime+459656>) at ../Python/import.c:2779
 #42 PyImport_ImportModuleLevelObject (name='mapnik', globals=<optimized out>, locals=<optimized out>, fromlist=None, level=0) at ../Python/import.c:2862
 #43 0x0000000000544fee in import_name (level=0, fromlist=None, name='mapnik', frame=<optimized out>, tstate=<optimized out>) at ../Python/ceval.c:2484
 #44 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/bytecodes.c:2135
 #45 0x000000000063743c in _PyEval_EvalFrame (throwflag=0, frame=0x7ffff7fb6020, tstate=0xbaf188 <_PyRuntime+459656>) at ../Include/internal/pycore_ceval.h:89
 --Type <RET> for more, q to quit, c to continue without paging--
 #46 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, locals=<optimized out>, func=0x7ffff7c42160, tstate=0xbaf188 <_PyRuntime+459656>) at ../Python/ceval.c:1683
 #47 PyEval_EvalCode (co=<code at remote 0x7ffff7c55b00>, globals=<optimized out>, locals=<optimized out>) at ../Python/ceval.c:578
 #48 0x0000000000655feb in run_eval_code_obj (tstate=0xbaf188 <_PyRuntime+459656>, co=0x7ffff7c55b00, 
     globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>}, 
     locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>})
     at ../Python/pythonrun.c:1691
 #49 0x0000000000651d95 in run_mod (mod=<optimized out>, filename=<optimized out>, 
     globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>}, 
     locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>}, flags=<optimized out>, 
     arena=<optimized out>) at ../Python/pythonrun.c:1712
 #50 0x00000000006462d1 in PyRun_StringFlags (str=str at entry=0x7ffff7a080b0 "import mapnik\n", start=start at entry=257, 
     globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>}, 
     locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0xbf6b20>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7bfd760>}, 
     flags=flags at entry=0x7fffffffe1d0) at ../Python/pythonrun.c:1587
 #51 0x000000000064620a in PyRun_SimpleStringFlags (command=0x7ffff7a080b0 "import mapnik\n", flags=0x7fffffffe1d0) at ../Python/pythonrun.c:480
 #52 0x000000000066396a in pymain_run_command (command=<optimized out>) at ../Modules/main.c:255
 #53 pymain_run_python (exitcode=0x7fffffffe19c) at ../Modules/main.c:620
 #54 Py_RunMain () at ../Modules/main.c:709
 #55 0x0000000000623d7b in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:763
 #56 0x00007ffff7cd16ca in __libc_start_call_main (main=main at entry=0x623cd0 <main>, argc=argc at entry=3, argv=argv at entry=0x7fffffffe3d8) at ../sysdeps/nptl/libc_start_call_main.h:58
 #57 0x00007ffff7cd1785 in __libc_start_main_impl (main=0x623cd0 <main>, argc=3, argv=0x7fffffffe3d8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe3c8) at ../csu/libc-start.c:360
 #58 0x0000000000623c01 in _start ()



More information about the Pkg-grass-devel mailing list