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

Exec format error on arm, unsupported interworking call (Thumb -> ARM) #7408

Closed
mrvn opened this issue Apr 7, 2018 · 3 comments
Closed

Exec format error on arm, unsupported interworking call (Thumb -> ARM) #7408

mrvn opened this issue Apr 7, 2018 · 3 comments

Comments

@mrvn
Copy link

mrvn commented Apr 7, 2018

System information

Type Version/Name
Distribution Name Debian
Distribution Version 9
Linux Kernel 4.14.18-mvebu
Architecture arm, armv7l, Helios4
ZFS Version 0.7.0-411_g6c9af9e8f
SPL Version 0.7.0-32_g581bc01

Describe the problem you're observing

Loading zfs module fail:

modprobe: ERROR: could not insert 'zfs': Exec format error

Describe how to reproduce the problem

Checkout git and build deb packages for the running kernel as described on the wiki. Running modprobe zfs then gives the error.

Include any warning/errors/backtraces from the system logs

dmesg shows:

[11390.901971] zlua: section 3 reloc 43 sym 'longjmp': unsupported interworking call (Thumb -> ARM)
@bunder2015
Copy link
Contributor

exec format error means you used the wrong arch, ie: 32bit on a 64bit only kernel.

@mrvn
Copy link
Author

mrvn commented Apr 8, 2018

No it doesn't. As the dmesg output shows the problem is the "unsupported interworking call". Which as far as I can tell an unpatched kernel does simply not allow. Thumb mode is a personality, not a bit-ness issue.

I didn't use any arch but simply run ./configure as recommended in the wiki. This should do the right thing[tm]. I don't see any configure option to enable/disable thumb support so I'm stumped.

@jsrlabs
Copy link

jsrlabs commented Jan 30, 2020

I had the same problem on my Helios4 when I tried building as described on the wiki. This message on zfs-discuss describes the cause of this issue.

Based on that, I narrowed it down to assembly code for setjmp and longjmp in the lua interpreter in zfs-0.8.2/module/lua/setjmp/setjmp_arm.S. This assembly code uses 32-bit ARM instructions, but the Armbian kernel for the Helios4 is all Thumb2, hence the "unsupported interworking call".

I have a crude hack that incompletely fixes the problem: I modified the lua setjmp and longjmp to use Thumb2. It compiles, and I use this ZFS setup every day, but I have never tested the lua feature. Also, the fix is incomplete in that it doesn't detect the type of kernel (32-bit ARM vs Thumb2) and just assumes the kernel is Thumb2.

Maybe someone will find this useful, so I've attached a patch.

lua_setjmp_patch.txt

behlendorf added a commit that referenced this issue Apr 30, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7408 
Closes #9957 
Closes #9967
awehrfritz pushed a commit to awehrfritz/zfs that referenced this issue Aug 18, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
tonyhutter pushed a commit that referenced this issue Aug 19, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7408 
Closes #9957 
Closes #9967
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Sep 15, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@mrvn @bunder2015 @jsrlabs and others