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

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

问题描述

我正在开发一个由 py​​thon2.7 脚本控制的嵌入式设备.而且我需要为安全性(我不希望设备用户弄乱我的源代码)和性能(我正在使用 BeagleBone Black、ARM microPC 并且它的 CPU/RAM 非常短)编译源代码.

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).

我正在为此使用 Nuitka python 编译器.我已经尝试编译我的应用程序的单独模块并且它工作正常,我可以透明地用它编译的 .so 模拟替换随机 .py 并且一切正常.

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.

但是,如果我尝试将整个应用程序编译成实体 blob - 它不起作用.这意味着 Nuitka 可以毫无问题地编译整个应用程序,但是当我尝试运行生成的二进制文件时 - 我得到 Segmentation fault 就是这样.没有调试输出,没有任何错误线索.

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天全站免登陆