You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm still trying to track this down, but I'll need to switch projects for a few weeks so I'd like to document this here.
When building nextpnr-ice40 on MSVC, it appears to include two different versions of Python. This is likely the reason why static builds crash whenever invoking a python script.
For example, if I build the Debug version of nextpnr-ice40, attach a debugger, and let it crash, we can see that it's crashing somewhere in libboost:
python37.dll!00007ffb938b2faf() Unknown
> boost_python37-vc142-mt-gd-x64-1_70.dll!boost::python::detail::init_module(PyModuleDef & moduledef, void(*)() init_function) Line 43 C++
nextpnr-ice40.exe!PyInit_nextpnrpy_ice40() Line 93 C++
python37_d.dll!_imp_create_builtin(_object * module, _object * spec) Line 1197 C
python37_d.dll!_PyMethodDef_RawFastCallDict(PyMethodDef * method, _object * self, _object * const * args, __int64 nargs, _object * kwargs) Line 497 C
python37_d.dll!_PyCFunction_FastCallDict(_object * func, _object * const * args, __int64 nargs, _object * kwargs) Line 582 C
python37_d.dll!PyCFunction_Call(_object * func, _object * args, _object * kwargs) Line 792 C
python37_d.dll!do_call_core(_object * func, _object * callargs, _object * kwdict) Line 4641 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3192 C
python37_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * const * args, __int64 argcount, _object * const * kwnames, _object * const * kwargs, __int64 kwcount, int kwstep, _object * const * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 3930 C
python37_d.dll!_PyFunction_FastCallKeywords(_object * func, _object * const * stack, __int64 nargs, _object * kwnames) Line 440 C
python37_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4617 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C
python37_d.dll!function_code_fastcall(PyCodeObject * co, _object * const * args, __int64 nargs, _object * globals) Line 283 C
python37_d.dll!_PyFunction_FastCallKeywords(_object * func, _object * const * stack, __int64 nargs, _object * kwnames) Line 408 C
python37_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4617 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3095 C
python37_d.dll!function_code_fastcall(PyCodeObject * co, _object * const * args, __int64 nargs, _object * globals) Line 283 C
python37_d.dll!_PyFunction_FastCallKeywords(_object * func, _object * const * stack, __int64 nargs, _object * kwnames) Line 408 C
python37_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4617 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C
python37_d.dll!function_code_fastcall(PyCodeObject * co, _object * const * args, __int64 nargs, _object * globals) Line 283 C
python37_d.dll!_PyFunction_FastCallKeywords(_object * func, _object * const * stack, __int64 nargs, _object * kwnames) Line 408 C
python37_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4617 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C
python37_d.dll!function_code_fastcall(PyCodeObject * co, _object * const * args, __int64 nargs, _object * globals) Line 283 C
python37_d.dll!_PyFunction_FastCallKeywords(_object * func, _object * const * stack, __int64 nargs, _object * kwnames) Line 408 C
python37_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4617 C
python37_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C
python37_d.dll!function_code_fastcall(PyCodeObject * co, _object * const * args, __int64 nargs, _object * globals) Line 283 C
python37_d.dll!_PyFunction_FastCallDict(_object * func, _object * const * args, __int64 nargs, _object * kwargs) Line 322 C
python37_d.dll!_PyObject_FastCallDict(_object * callable, _object * const * args, __int64 nargs, _object * kwargs) Line 98 C
python37_d.dll!object_vacall(_object * callable, char * vargs) Line 1198 C
python37_d.dll!_PyObject_CallMethodIdObjArgs(_object * obj, _Py_Identifier * name, ...) Line 1248 C
python37_d.dll!import_find_and_load(_object * abs_name) Line 1646 C
python37_d.dll!PyImport_ImportModuleLevelObject(_object * name, _object * globals, _object * locals, _object * fromlist, int level) Line 1754 C
python37_d.dll!builtin___import__(_object * self, _object * args, _object * kwds) Line 314 C
python37_d.dll!_PyMethodDef_RawFastCallDict(PyMethodDef * method, _object * self, _object * const * args, __int64 nargs, _object * kwargs) Line 515 C
python37_d.dll!_PyCFunction_FastCallDict(_object * func, _object * const * args, __int64 nargs, _object * kwargs) Line 582 C
python37_d.dll!_PyObject_FastCallDict(_object * callable, _object * const * args, __int64 nargs, _object * kwargs) Line 101 C
python37_d.dll!_PyObject_CallFunctionVa(_object * callable, const char * format, char * va, int is_size_t) Line 957 C
python37_d.dll!PyObject_CallFunction(_object * callable, const char * format, ...) Line 977 C
python37_d.dll!PyImport_Import(_object * module_name) Line 1936 C
python37_d.dll!PyImport_ImportModule(const char * name) Line 1390 C
nextpnr-ice40.exe!nextpnr_ice40::init_python(const char * executable, bool first) Line 252 C++
nextpnr-ice40.exe!nextpnr_ice40::CommandHandler::executeMain(std::unique_ptr<nextpnr_ice40::Context,std::default_delete<nextpnr_ice40::Context> > ctx) Line 292 C++
nextpnr-ice40.exe!nextpnr_ice40::CommandHandler::exec() Line 383 C++
nextpnr-ice40.exe!main(int argc, char * * argv) Line 233 C++
[External Code]
Of note is that nextpnr-ice40.exe is calling into python37_d.dll (the debug version of the library), which then calls into nextpnr-ice40.exe, which then calls into boost, which finally calls into python37.dll (the non-debug version).
This may be related to microsoft/vcpkg#5097 which is an open issue, but as of right now it is not possible to build Python support into a static executable on Windows.
The text was updated successfully, but these errors were encountered:
I'm still trying to track this down, but I'll need to switch projects for a few weeks so I'd like to document this here.
When building nextpnr-ice40 on MSVC, it appears to include two different versions of Python. This is likely the reason why static builds crash whenever invoking a python script.
For example, if I build the Debug version of nextpnr-ice40, attach a debugger, and let it crash, we can see that it's crashing somewhere in libboost:
Of note is that
nextpnr-ice40.exe
is calling intopython37_d.dll
(the debug version of the library), which then calls intonextpnr-ice40.exe
, which then calls into boost, which finally calls intopython37.dll
(the non-debug version).This may be related to microsoft/vcpkg#5097 which is an open issue, but as of right now it is not possible to build Python support into a static executable on Windows.
The text was updated successfully, but these errors were encountered: