New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault in 3.8 and 3.9 when running generated executables with PYTHONDEVMODE=1 #7790
Comments
Hmm, indeed. Looks like setting |
Since this can be triggered by the following example, Code
#include <stdio.h>
#include <dlfcn.h>
#include <wchar.h>
typedef void (_prototype_Py_SetPath) (wchar_t *);
int main (int argc, char **argv)
{
if (argc != 2) {
printf("Usage: %s <python_lib>\n", argv[0]);
return -1;
}
void *pylib = dlopen(argv[1], RTLD_NOW | RTLD_GLOBAL);
if (!pylib) {
printf("Failed to load python library %s\n", argv[1]);
return -1;
}
_prototype_Py_SetPath *Py_SetPath = dlsym(pylib, "Py_SetPath");
if (!Py_SetPath) {
printf("Failed to lookup Py_SetPath!\n");
return -1;
}
wchar_t path[] = L"/some/path";
Py_SetPath(path);
dlclose(pylib);
printf("Great success!\n");
return 0;
} Output and backtrace
my guess would be that python is trying to free un-initialized string pointers here. Perhaps enabling this I also wonder if we should unset both |
Description of the issue
PyInstaller generated executables for Python 3.8 and Python 3.9 crash when run with
PYTHONDEVMODE=1
set in the environment.Context information (for bug reports)
Output of
pyinstaller --version
:5.13.0
Version of Python: Reproduces with 3.8 and 3.9, but not with 3.6, 3.7, 3.10, or 3.11
Platform: Linux (tested on RHEL 7 and Debian 11.7)
try the latest development version, using the following command: ...
Reproduces with the latest development version.
Make sure everything is packaged correctly
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.A minimal example program which shows the error
Stacktrace / full error message
The text was updated successfully, but these errors were encountered: