trying to load lantern-binary
I am trying to load this binary https://github.com/getlantern/lantern-binaries version 32bit on armv7 it needs a library ".so" file that I use LD_LIBRARY_PATH variable on my laptop for it to work. but on box86 it gives this error:
Box86 with Dynarec v0.2.6 built on Apr 19 2022 23:00:57
Error: loading needed libs in elf ./lantern-binary
I use symlink from ./libpcap.so.0.8 -> /usr/lib/libpcap.so
You can use BOX86_LOG=1 to see what lib is missing.
Lib like libcap are not wrapped, so you need the i386 version of it for box86.
I used the log command and it says this:
BOX86_LOG=1 ./lantern-binary -headless=true
Debug level is 1
Dynarec for ARMv7, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.6 built on Apr 19 2022 23:00:57
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
Using default BOX86_PATH: ./:bin/
Counted 36 Env var
Looking for ./lantern-binary
argv[1]="-headless=true"
Using native(wrapped) libdl.so.2
Error loading needed lib libappindicator3.so.1
Error loading one of needed lib
Error: loading needed libs in elf ./lantern-binary
but I installed libappindicator-gtk3 from armv7 repos and still error exists. do I need to install i686 version of this lib? how? it is a 32 arm device and the binary is x86. I thought that box86 would do that automatically with libraries from host?
does the box program need all the i686 libraries needed by app or can it use the host libraries?
Yes, you need the i686 version of it. libappindicator3 is not wrapped (gtk3 support is not very developped in box86 yet, and completly absent in box64), only libappindicator1 is for now.
Note that you can see a (slightly out-of-date already) list of wrapped libs at the end of this article: https://box86.org/2022/02/box86-box64-are-easy-to-use/
(or look in the source, the file src/library_list.h)
is there a ldd command for box that shows the actual libraries used?
You can do readelf -aW /PATH/TO/BIN | grep NEEDED for the list of direct dependanclies.
Yes. Not all libs gets wrapped. Like wine, it's a manual process. So many libs are wrapped, but some are not. Like this libappindicator3. So you need an i686 version, from some rpm or deb or somewhere else yes. Put it in the app folder and box86 will find it, no need to use LD_ env. var.
I downloaded 3 library from debian i686 and extracted to folder. now I get this error:
BOX86_LOG=1 ./lantern-binary -headless=true
Debug level is 1
Dynarec for ARMv7, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.6 built on Apr 19 2022 23:00:57
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
Using default BOX86_PATH: ./:bin/
Counted 36 Env var
Looking for ./lantern-binary
argv[1]="-headless=true"
Using native(wrapped) libdl.so.2
Using emulated libappindicator3.so.1
Using native(wrapped) libgtk-3.so.0
Using native(wrapped) libgdk-3.so.0
Using native(wrapped) libgobject-2.0.so.0
Using native(wrapped) libglib-2.0.so.0
Using native(wrapped) libgio-2.0.so.0
Using native(wrapped) libgmodule-2.0.so.0
Using native(wrapped) libgdk_pixbuf-2.0.so.0
Using native(wrapped) libpangocairo-1.0.so.0
Using native(wrapped) libpango-1.0.so.0
Using native(wrapped) libpthread.so.0
Using emulated libpcap.so.0.8
Using emulated /lib/i386-linux-gnu/libstdc++.so.6
Using native(wrapped) libm.so.6
Using emulated /lib/i386-linux-gnu/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
Using emulated libindicator3.so.7
Using emulated libdbusmenu-gtk3.so.4
Using native(wrapped) libdbusmenu-glib.so.4
Using native(wrapped) libatk-1.0.so.0
Using native(wrapped) libcairo-gobject.so.2
Using native(wrapped) libcairo.so.2
Using native(wrapped) libdbus-1.so.3
fatal error: failed to get system page size
runtime: panic before malloc heap initialized
runtime stack:
runtime.throw({0x9272acd, 0x1e})
/usr/local/go/src/runtime/panic.go:992 +0x6a fp=0xb633f34c sp=0xb633f338 pc=0x809028a
runtime.mallocinit()
/usr/local/go/src/runtime/malloc.go:445 +0x458 fp=0xb633f384 sp=0xb633f34c pc=0x8064498
runtime.schedinit()
/usr/local/go/src/runtime/proc.go:691 +0xb8 fp=0xb633f3b0 sp=0xb633f384 pc=0x8093e78
runtime.rt0_go()
/usr/local/go/src/runtime/asm_386.s:239 +0x161 fp=0xb633f3b4 sp=0xb633f3b0 pc=0x80c08e1
Sorry, I edited your comment instead of Quote?! And I cannot rollback it.
I downloaded 3 library from debian i686 and extracted to folder. now I get this error:
BOX86_LOG=1 ./lantern-binary -headless=true Debug level is 1 Dynarec for ARMv7, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096 Box86 with Dynarec v0.2.6 built on Apr 19 2022 23:00:57 Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/ Using default BOX86_PATH: ./:bin/ Counted 36 Env var Looking for ./lantern-binary argv[1]="-headless=true" Using native(wrapped) libdl.so.2 Using emulated libappindicator3.so.1 Using native(wrapped) libgtk-3.so.0 Using native(wrapped) libgdk-3.so.0 Using native(wrapped) libgobject-2.0.so.0 Using native(wrapped) libglib-2.0.so.0 Using native(wrapped) libgio-2.0.so.0 Using native(wrapped) libgmodule-2.0.so.0 Using native(wrapped) libgdk_pixbuf-2.0.so.0 Using native(wrapped) libpangocairo-1.0.so.0 Using native(wrapped) libpango-1.0.so.0 Using native(wrapped) libpthread.so.0 Using emulated libpcap.so.0.8 Using emulated /lib/i386-linux-gnu/libstdc++.so.6 Using native(wrapped) libm.so.6 Using emulated /lib/i386-linux-gnu/libgcc_s.so.1 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux.so.2 Using native(wrapped) librt.so.1 Using emulated libindicator3.so.7 Using emulated libdbusmenu-gtk3.so.4 Using native(wrapped) libdbusmenu-glib.so.4 Using native(wrapped) libatk-1.0.so.0 Using native(wrapped) libcairo-gobject.so.2 Using native(wrapped) libcairo.so.2 Using native(wrapped) libdbus-1.so.3 fatal error: failed to get system page size runtime: panic before malloc heap initialized runtime stack: runtime.throw({0x9272acd, 0x1e}) /usr/local/go/src/runtime/panic.go:992 +0x6a fp=0xb633f34c sp=0xb633f338 pc=0x809028a runtime.mallocinit() /usr/local/go/src/runtime/malloc.go:445 +0x458 fp=0xb633f384 sp=0xb633f34c pc=0x8064498 runtime.schedinit() /usr/local/go/src/runtime/proc.go:691 +0xb8 fp=0xb633f3b0 sp=0xb633f384 pc=0x8093e78 runtime.rt0_go() /usr/local/go/src/runtime/asm_386.s:239 +0x161 fp=0xb633f3b4 sp=0xb633f3b0 pc=0x80c08e1
Mmmm, strange message. I guess GO runtime is doing something not done by other runtime. I'll have to check myself and see what's it's doing and how to fix it.
if you can do that and can run this binary on your armv7 I would be very grateful . I will wait for results on your end.
I tested and the issue is still there
Debug level is 1
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Using bash "/home/seb/git/box64/tests/bash"
Box86 with trace with Dynarec v0.2.7 bc810d16 built on Oct 12 2022 21:35:35
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
Using default BOX86_PATH: ./:bin/
Counted 25 Env var
Looking for ./lantern-binary
argv[1]="-headless=true"
Rename process to "lantern-binary"
Using native(wrapped) libdl.so.2
Using native(wrapped) libappindicator3.so.1
Using native(wrapped) libgtk-3.so.0
Using native(wrapped) libgdk-3.so.0
Using native(wrapped) libgobject-2.0.so.0
Using native(wrapped) libglib-2.0.so.0
Using native(wrapped) libgio-2.0.so.0
Using native(wrapped) libgmodule-2.0.so.0
Using native(wrapped) libgdk_pixbuf-2.0.so.0
Using native(wrapped) libpangocairo-1.0.so.0
Using native(wrapped) libpango-1.0.so.0
Using native(wrapped) libpthread.so.0
Using native(wrapped) libpcap.so.0
Using emulated /lib/i386-linux-gnu/libstdc++.so.6
Using native(wrapped) libm.so.6
Using emulated /lib/i386-linux-gnu/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
signal 23 received but handler not on signal stack
fatal error: non-Go code set up signal handler without SA_ONSTACK flag
runtime stack:
runtime: unexpected return pc for runtime.sigtramp called from 0x641c7030
stack: frame={sp:0xb06d5d4, fp:0xb06d5f4} stack=[0xb065574,0xb06d974)
0x0b06d554: 0x0b06d558 0x080902a0 <runtime.throw.func1+0x00000000> 0x09297024 0x00000039
0x0b06d564: 0x080a6ec5 <runtime.sigNotOnStack+0x00000075> 0x09297024 0x00000039 0x080a5ec6 <runtime.adjustSignalStack+0x00000206>
0x0b06d574: 0x00000017 0x0b06d58c 0x0b06d59c 0x00000000
0x0b06d584: 0x00000000 0x00000000 0x0b002000 0x00000001
0x0b06d594: 0x00008000 0x080a5ba9 <runtime.sigtrampgo+0x00000109> 0x00000017 0x0a7da140
0x0b06d5a4: 0x0b06d5b0 0x00000000 0x00000000 0x00000000
0x0b06d5b4: 0x00000000 0x00000000 0x00000000 0x00000000
0x0b06d5c4: 0x0b0001e0 0x0b06d940 0x0b06d600 0x080c2f2f <runtime.sigtramp+0x0000002f>
0x0b06d5d4: <0x00000017 0x0b06d940 0x0b06d600 0x00000000
0x0b06d5e4: 0x00000000 0x00000000 0x00000002 !0x641c7030
0x0b06d5f4: >0x00000017 0x0b06d940 0x0b06d600 0x00000000
0x0b06d604: 0x00000000 0x00000000 0x00000000 0x00000000
0x0b06d614: 0x00000033 0x00000000 0x0000007b 0x0000007b
0x0b06d624: 0x00000000 0x00000000 0x00000000 0x0b06dbc0
0x0b06d634: 0x00000002 0x00000000 0x00000003 0xffffffff
0x0b06d644: 0x00000000 0x00000000 0x080d5261 <syscall.Syscall+0x00000021> 0x00000073
0x0b06d654: 0x00000246 0x00000000 0x0000007b 0x0b06d680
0x0b06d664: 0x00000000 0x00000000 0x00000000 0x00000000
runtime.throw({0x9297024, 0x39})
/usr/local/go/src/runtime/panic.go:992 +0x6a
runtime.sigNotOnStack(0x17)
/usr/local/go/src/runtime/signal_unix.go:1002 +0x75
runtime.adjustSignalStack(0x17, 0xa7da140, 0xb06d5b0)
/usr/local/go/src/runtime/signal_unix.go:577 +0x206
runtime.sigtrampgo(0x17, 0xb06d940, 0xb06d600)
/usr/local/go/src/runtime/signal_unix.go:467 +0x109
runtime: unexpected return pc for runtime.sigtramp called from 0x641c7030
stack: frame={sp:0xb06d5d4, fp:0xb06d5f4} stack=[0xb065574,0xb06d974)
0x0b06d554: 0x0b06d558 0x080902a0 <runtime.throw.func1+0x00000000> 0x09297024 0x00000039
0x0b06d564: 0x080a6ec5 <runtime.sigNotOnStack+0x00000075> 0x09297024 0x00000039 0x080a5ec6 <runtime.adjustSignalStack+0x00000206>
0x0b06d574: 0x00000017 0x0b06d58c 0x0b06d59c 0x00000000
0x0b06d584: 0x00000000 0x00000000 0x0b002000 0x00000001
0x0b06d594: 0x00008000 0x080a5ba9 <runtime.sigtrampgo+0x00000109> 0x00000017 0x0a7da140
0x0b06d5a4: 0x0b06d5b0 0x00000000 0x00000000 0x00000000
0x0b06d5b4: 0x00000000 0x00000000 0x00000000 0x00000000
0x0b06d5c4: 0x0b0001e0 0x0b06d940 0x0b06d600 0x080c2f2f <runtime.sigtramp+0x0000002f>
0x0b06d5d4: <0x00000017 0x0b06d940 0x0b06d600 0x00000000
0x0b06d5e4: 0x00000000 0x00000000 0x00000002 !0x641c7030
0x0b06d5f4: >0x00000017 0x0b06d940 0x0b06d600 0x00000000
0x0b06d604: 0x00000000 0x00000000 0x00000000 0x00000000
0x0b06d614: 0x00000033 0x00000000 0x0000007b 0x0000007b
0x0b06d624: 0x00000000 0x00000000 0x00000000 0x0b06dbc0
0x0b06d634: 0x00000002 0x00000000 0x00000003 0xffffffff
0x0b06d644: 0x00000000 0x00000000 0x080d5261 <syscall.Syscall+0x00000021> 0x00000073
0x0b06d654: 0x00000246 0x00000000 0x0000007b 0x0b06d680
0x0b06d664: 0x00000000 0x00000000 0x00000000 0x00000000
runtime.sigtramp()
/usr/local/go/src/runtime/sys_linux_386.s:460 +0x2f
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:1326 +0x1 fp=0xb06cff4 sp=0xb06cff0 pc=0x80c1e51
goroutine 1 [running, locked to thread]:
goroutine running on other thread; stack unavailable
Looks like the signal handler is not behaving has the Go runtime expected it. I need to investigate there.