Skip to content
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

cryptography 36.0.1 produces "Illegal Instruction" on Raspbian 11 Bullseye armv6l #6801

Closed
mendhak opened this issue Jan 7, 2022 · 3 comments

Comments

@mendhak
Copy link

mendhak commented Jan 7, 2022

Versions of Python, cryptography, cffi, pip, and setuptools you're using

cryptography==36.0.1
cffi==1.14.5
setuptools==52.0.0

How you installed cryptography

pip3 install cryptography
# or
pip3 install msal

This downloads this specific .whl file:

Downloading https://www.piwheels.org/simple/cryptography/cryptography-36.0.1-cp39-cp39-linux_armv6l.whl (2.7 MB)

Clear steps for reproducing your bug

On Raspberry Pi Zero, the cryptography module version 36.0.1 results in "Illegal Instruction".
Downgrading to 36.0.0 doesn't produce any error.

OS version: Raspbian GNU/Linux 11 (bullseye)
uname -a : Linux epaper 5.10.63+ #1488 Thu Nov 18 16:14:04 GMT 2021 armv6l GNU/Linux

As a simple test I ran

python3 -c "from cryptography.fernet import Fernet"

And the output is "Illegal Instruction"

image

I tried to do a gdb but I don't actually know what I'm doing or what the output means, but hopefully there's something in here that helps.

pi@epaper:~ $ gdb --args python3 -c "from cryptography.fernet import Fernet"
GNU gdb (Raspbian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...
(No debugging symbols found in python3)
(gdb) run
Starting program: /usr/bin/python3 -c from\ cryptography.fernet\ import\ Fernet
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0xb645356c in register_tm_clones () from /usr/local/lib/python3.9/dist-packages/cryptography/hazmat/bindings/_rust.abi3.so
(gdb) bt
#0  0xb645356c in register_tm_clones () from /usr/local/lib/python3.9/dist-packages/cryptography/hazmat/bindings/_rust.abi3.so
#1  0xb6fdd328 in call_init (l=<optimized out>, argc=argc@entry=3, argv=argv@entry=0xbefff6b4, env=env@entry=0xbefff6c4) at dl-init.c:72
#2  0xb6fdd430 in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:30
#3  _dl_init (main_map=0x4c8290, argc=3, argv=0xbefff6b4, env=0xbefff6c4) at dl-init.c:119
#4  0xb6e64a0c in __GI__dl_catch_exception (exception=0x5, operate=0x0, args=0xbeffcd18) at dl-error-skeleton.c:182
#5  0xb6fe1514 in dl_open_worker (a=<optimized out>) at dl-open.c:758
#6  0xb6e649a8 in __GI__dl_catch_exception (exception=0xb668d280, operate=0xbeffcec0, args=0xbeffcf40) at dl-error-skeleton.c:208
#7  0xb6fe0d3c in _dl_open (file=0xb668ee00 "/usr/local/lib/python3.9/dist-packages/cryptography/hazmat/bindings/_rust.abi3.so", mode=-2147483646, caller_dlopen=0x1f1948, nsid=-2, argc=3, argv=0xbefff6b4, env=0xbefff6c4) at dl-open.c:837
#8  0xb6f79d98 in dlopen_doit (a=0xbeffd12c) at dlopen.c:66
#9  0xb6e649a8 in __GI__dl_catch_exception (exception=0x58, exception@entry=0xbeffd0e0, operate=0xbeffd0e8, args=0x0, args@entry=0xb6f8c000) at dl-error-skeleton.c:208
#10 0xb6e64a90 in __GI__dl_catch_error (objname=0x505394, errstring=0x505398, mallocedp=0x505390, operate=<optimized out>, args=0xbeffd12c) at dl-error-skeleton.c:227
#11 0xb6f7a87c in _dlerror_run (operate=<optimized out>, args=0xbeffd12c, args@entry=0xbeffd124) at dlerror.c:170
#12 0xb6f79e5c in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#13 0x001f1948 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit
A debugging session is active.

    Inferior 1 [process 1173] will be killed.

Quit anyway? (y or n) y
@reaperhulk
Copy link
Member

Illegal instruction problems are typically due to the binary wheel containing invalid instructions for the architecture you're on. We don't produce the wheel you're using and can't support it so you'll need to report this to the piwheels folks and work with them to determine what is going on.

@mendhak
Copy link
Author

mendhak commented Jan 7, 2022

Thanks, I think I understand sort of. So this https://www.piwheels.org/project/cryptography/ is a different group who compile cryptography for Raspberry Pi OS and I'll have to find their bug tracker.

@mendhak mendhak closed this as completed Jan 7, 2022
@mendhak
Copy link
Author

mendhak commented Jan 7, 2022

piwheels/packages#273

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants