-
Notifications
You must be signed in to change notification settings - Fork 298
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
Segmentation faults #40
Comments
I have been obfuscated https://github.com/dashingsoft/pyarmor/blob/master/tests/python-test.sh All the test cases about settrace/setprofile will be failed, because pyarmor don't allow it. There are some failed test but not fixed yet
|
We don't have issues with the test module itself (test scripts are not obfuscated), but with the obfuscated code that is getting tested. We just run our end-to-end tests to see if everything is still working after obfuscation. Or maybe I misunderstood what you explained ? |
I also just hit a segfault in obfuscated code: (gdb) run camera_server.py Program received signal SIGSEGV, Segmentation fault. It's in pytransform.so Running in strace to get more clues about where it happened: So it looks like it happens shortly after successfully loading "product.key". I did not observe segfaults until today. The timing between me and @benenaes is not a coincidence; we're on different teams at the same company and had a conversation about pyarmor. I do not observe the segfaults when running the code on the same machine that performed the obfuscation, but when running the obfuscated files on another machine. Obfuscation machine: Remote machine observing segfaults: Another remote machine that does ~not segfault: |
We're on linux x86-64. If you're not able to reproduce this there, do you have a build of the closed source .so file with debug symbols, so we can try to get a better stack trace for you? |
So I tried a bunch of old versions of pyarmor from pypi with no luck: 4.5.1 obfuscated code segfaults on tars Then realized that the machine that was segfaulting (tars) was on python 3.5.5, whereas the obfuscation machine, and the other working machine, were both on 3.6.6. Upgrading the segfaulting machine to 3.6.6 appears to have cleared it up (fingers crossed). Are you obfuscating and running with different versions of python @benenaes ? |
What I want to explain is that all the features of Python in the |
Yes, the python version used to obfuscate script must be same as the running. @drewm1980 If @benenaes use the same python version and still raise segfaulting, I'll build |
In pyarmor v4.6.0, I fix an issue which will cause obfuscated scripts crash in Python 3.6 if the code object includes a special instruction "EXTENDED_ARG 0". Maybe it's the root cause for your case. |
On:
PyArmor 3.9.9 and PyArmor 4.3.3
Ubuntu 16.04
x86 architecture
What happens:
This has happened before multiple times. Actually, when code changes over time in the specific modules, the log lines can be removed again.
I cannot reproduce this behaviour on example modules, unfortunately. I have the impression that the generation of some specific byte codes, results in segfaults. Changing or adding an arbitrary line in the module seems to fix the issue, but I fear that this way we need to have very (almost over-the-top) testing.
Sorry that this ticket is a bit vague and I cannot provide example files, but I just wonder if other people have seen this behaviour as well ?
The text was updated successfully, but these errors were encountered: