On Sun, Feb 09, 2025 at 05:56:38PM +1100, Russell Coker wrote: > The command "python3 -bb -t -t -E -W error support/validate-appconfig.py -c / > usr/bin/chkcon -l -s -v -x tmp/appconfig tmp/policy.bin" is crashing. Here's > a backtrace: > > #0 0x00000000005378ee in _PyObject_New () > #1 0x00007ffff763919f in SWIG_Python_newvarlink () at ./src/ > selinuxswig_python_wrap.c:1575 > #2 0x00007ffff7639295 in SWIG_globals () at ./src/selinuxswig_python_wrap.c: > 1605 > #3 0x00007ffff763b4f5 in SWIG_Python_DestroyModule (obj=0x7ffff7727fb0) > at ./src/selinuxswig_python_wrap.c:2973 > #4 0x0000000000666d94 in ?? () > #5 0x000000000053f0ba in ?? () > #6 0x000000000068ac92 in ?? () > #7 0x000000000053016e in ?? () > #8 0x00000000006895da in ?? () > #9 0x00000000006687a5 in ?? () > #10 0x000000000069abef in Py_Exit () > #11 0x000000000068858b in ?? () > #12 0x00000000006883fb in ?? () > #13 0x000000000067ed22 in ?? () > #14 0x000000000067eb1e in ?? () > #15 0x000000000067d961 in Py_RunMain () > #16 0x000000000063a72b in Py_BytesMain () > #17 0x00007ffff7c92d68 in __libc_start_call_main (main=main@entry=0x63a680, > argc=argc@entry=16, > argv=argv@entry=0x7fffffffe8b8) at ../sysdeps/nptl/libc_start_call_main.h: > 58 > #18 0x00007ffff7c92e25 in __libc_start_main_impl (main=0x63a680, argc=16, > argv=0x7fffffffe8b8, > init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, > stack_end=0x7fffffffe8a8) > at ../csu/libc-start.c:360 > #19 0x0000000000639ae1 in _start () > > This seems like a SWIG issue and I'm still trying to debug it. > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%231095018 > > It seems to have the same root cause as the above bug.
Backrace with more debuginfo: #0 0x0000000000538b6e in _PyObject_SIZE (type=0x0) at ../Include/cpython/objimpl.h:6 #1 _PyObject_New (tp=0x0) at ../Objects/object.c:534 #2 0x00007ff588ad76d5 in SWIG_Python_newvarlink () at ./src/selinuxswig_python_wrap.c:1575 #3 SWIG_globals () at ./src/selinuxswig_python_wrap.c:1605 #4 SWIG_Python_DestroyModule (obj=<optimized out>) at ./src/selinuxswig_python_wrap.c:2973 #5 0x00000000006693c4 in capsule_dealloc (op=<PyCapsule at remote 0x7ff58892f010>) at ../Objects/capsule.c:290 #6 0x00000000005403ba in _Py_Dealloc (op=<optimized out>) at ../Objects/object.c:2939 #7 Py_DECREF (op=<optimized out>) at ../Include/object.h:949 #8 Py_XDECREF (op=<optimized out>) at ../Include/object.h:1042 #9 dictkeys_decref (use_qsbr=<optimized out>, interp=<optimized out>, dk=0x7ff589371070) at ../Objects/dictobject.c:496 #10 dictkeys_decref (use_qsbr=false, interp=<optimized out>, dk=0x7ff589371070) at ../Objects/dictobject.c:481 #11 dict_dealloc ( self={'__name__': 'swig_runtime_data4', '__doc__': None, '__package__': None, '__loader__': None, '__spec__': None, 'type_pointer_capsule': <PyCapsule at remote 0x7ff58892f010>}) at ../Objects/dictobject.c:3179 #12 0x000000000068dda2 in module_dealloc (m=0x7ff58892efc0) at ../Objects/moduleobject.c:777 #13 0x000000000053138d in _Py_Dealloc (op=<module at remote 0x7ff58892efc0>) at ../Objects/object.c:2939 #14 Py_DECREF (op=<module at remote 0x7ff58892efc0>) at ../Include/object.h:949 #15 Py_XDECREF (op=<module at remote 0x7ff58892efc0>) at ../Include/object.h:1042 #16 insertdict (interp=0xa4ecf0 <_PyRuntime+88400>, mp=<optimized out>, key='swig_runtime_data4', hash=<optimized out>, value=None) at ../Objects/dictobject.c:1843 #17 0x000000000068c9da in finalize_remove_modules ( modules={'sys': None, 'builtins': None, '_frozen_importlib': None, '_imp': None, '_thread': None, '_warnings': None, '_weakref': None, '_io': None, 'marshal': None, 'posix': None, '_frozen_importlib_external': None, 'time': None, 'zipimport': None, '_codecs': None, 'codecs': None, 'encodings.aliases': None, 'encodings': None, 'encodings.utf_8': None, '_signal': None, '_abc': None, 'abc': None, 'io': None, '__main__': None, 'warnings': None, '_stat': None, 'stat': None, '_collections_abc': None, 'errno': None, 'genericpath': None, 'posixpath': None, 'os.path': None, 'os': None, '_sitebuiltins': None, 'encodings.utf_8_sig': None, 'types': None, 'importlib._bootstrap': None, 'importlib._bootstrap_external': None, 'importlib': None, 'importlib._abc': None, 'importlib.util': None, 'importlib.machinery': None, 'xstatic': None, 'xstatic.pkg': None, '_distutils_hack': None, 'flufl': None, 'logilab': None, 'phply': None, 'repoze': None, 'straight': None, 'testing': None, 'testing.common': None, 'wheezy': None, 'zc': None, 'zo...(truncated), verbose=0) at ../Python/pylifecycle.c:1598 #18 finalize_modules (tstate=0xa7e530 <_PyRuntime+283024>) at ../Python/pylifecycle.c:1745 #19 0x000000000066b5c5 in _Py_Finalize.constprop.0 (runtime=<optimized out>) at ../Python/pylifecycle.c:2132 #20 0x000000000069e5bf in Py_Exit (sts=2) at ../Python/pylifecycle.c:3520 #21 0x000000000068be6b in handle_system_exit () at ../Python/pythonrun.c:679 #22 0x000000000068bce2 in _PyErr_PrintEx (tstate=0xa7e530 <_PyRuntime+283024>, set_sys_last_vars=1) at ../Python/pythonrun.c:688 #23 0x0000000000681f52 in PyErr_PrintEx (set_sys_last_vars=1) at ../Python/pythonrun.c:768 #24 PyErr_Print () at ../Python/pythonrun.c:774 #25 _PyRun_SimpleFileObject (fp=fp@entry=0x402442e0, filename=filename@entry='/tmp/refpolicy-2.20250213/support/validate-appconfig.py', closeit=closeit@entry=1, flags=flags@entry=0x7ffc12ffb568) at ../Python/pythonrun.c:523 #26 0x0000000000681d4e in _PyRun_AnyFileObject (fp=0x402442e0, filename='/tmp/refpolicy-2.20250213/support/validate-appconfig.py', closeit=1, flags=0x7ffc12ffb568) at ../Python/pythonrun.c:77 #27 0x0000000000680bb1 in pymain_run_file_obj (program_name='python3', filename='/tmp/refpolicy-2.20250213/support/validate-appconfig.py', skip_source_first_line=0) at ../Modules/main.c:410 #28 pymain_run_file (config=0xa50c28 <_PyRuntime+96392>) at ../Modules/main.c:429 #29 pymain_run_python (exitcode=0x7ffc12ffb55c) at ../Modules/main.c:698 #30 Py_RunMain () at ../Modules/main.c:777 #31 0x000000000063ccab in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:831 #32 0x00007ff589a28ca8 in __libc_start_call_main (main=main@entry=0x63cc00 <main>, argc=argc@entry=10, argv=argv@entry=0x7ffc12ffb798) at ../sysdeps/nptl/libc_start_call_main.h:58 #33 0x00007ff589a28d65 in __libc_start_main_impl (main=0x63cc00 <main>, argc=10, argv=0x7ffc12ffb798, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc12ffb788) at ../csu/libc-start.c:360 #34 0x000000000063c041 in _start () Rebuilding libselinux with swig 4.2.1-1 produces a python3-selinux that fixes the refpolicy build, indicating that the problem is either in libselinux or swig. Has either upstream been contacted? cu Adrian