用nuitka编译的python包因分段错误而失败 [英] python package compiled with nuitka fails with segmentation fault

查看:281
本文介绍了用nuitka编译的python包因分段错误而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发由python2.7脚本控制的嵌入式设备.而且我需要针对安全性(我不希望设备用户弄乱我的资源)和性能(我正在使用BeagleBone Black,ARM microPC,并且在CPU/RAM上非常短)两者来编译源代码./p>

我正在为此使用Nuitka python编译器.我已经尝试过编译应用程序的单独模块,并且效果很好,我可以用编译后的.so类似物透明地替换随机.py,并且一切正常.

但是,如果我尝试将整个应用程序编译为可靠的Blob,则无法正常工作.这意味着Nuitka可以毫无问题地编译整个应用程序,但是当我尝试运行生成的二进制文件时-得到Segmentation fault就是这样.没有调试输出,没有任何问题的线索.

那么,您知道这件事情出了什么问题以及为什么它不起作用吗? 或者至少我该如何调试它并弄清楚为什么会发生这种段错误?

解决方案

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

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.

这篇关于用nuitka编译的python包因分段错误而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆