且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用nuitka编译的python包因分段错误而失败

更新时间:2023-09-15 23:24:40

您是否尝试过查看核心文件?那应该让您了解发生细分错误的位置.

I'm developing an embedded device controlled by a python2.7 script. And I need to compile the source for both security (I don't want device users to mess with my sources) and performance (I'm working on an BeagleBone Black, ARM microPC, and it's pretty short on CPU/RAM).

I'm using Nuitka python compiler for this. I've tried compiling separate modules of my application and it works fine, I can transparently replace random .py with it's compiled .so analogue and it all works fine.

Yet if I try to compile whole application into solid blob - it doesn't work. Meaning that Nuitka compiles whole application with no problem, but when I try to run the resulting binary - I get Segmentation fault and that's it. No debug output, no clues on what's wrong.

So, any idea what is wrong with this thing and why it doesn't work? Or at least how can I debug it and figure out why this segfault happens?

Did you try taking a look at the core file? That should give you an idea where the segmentation fault is happening.