next iteration of golang support attempt

Josef Söntgen josef.soentgen at genode-labs.com
Wed Apr 7 14:50:33 CEST 2021


Hello Alexander,

> I still have a problem with nested jmp_slot() related to call to
> strlen() during stack unwind call and related nested mutex leading to
> deadlock.
> […]
> call above inside test-go linked to strlen() to inside libc, as you see
> from stack above and from disassemble test-go, where it call shared libc
> […]
> /genodelabs-genode-2491eee/contrib/gcc-3cade18cf9defeefa714aa91de3b157fbad4aa18/src/noux-pkg/gcc/libgcc/unwind-dw2-fde.c:300
> 11a8ca0:       e8 db 6b 00 00          callq  11af880 <strlen at plt>

> so, we take same mutex twice here and in attempt to search for strlen()
> from @plt via jmp_slot…
> This happens only with SMP, if I use UP configuration it is not happens.
> Frankly, I am stuck a bit… this lib is a part of general toolchain, not
> clear why this stack unwind staff call shared libc…
> may be it is necessary to recompile toolchain and library and force
> strlen() to be expanded to inlined one?

Please give the following two commits [1], [2] a try. The first exports
the required Unwind functions needed by the libgo runtime and the second
removes the direct usage of the toolchain libraries.

With both commits applied the 'go_app' test component still works and
hopefully it addresses your SMP issue as well.

  [1] https://github.com/cnuke/genode/commit/e19b19e0367e544654bc917e09c2cb991b71b211
  [2] https://github.com/cnuke/genode-world/commit/30ef976ebdd58becb1785993cd184344625f0403

Your problem boils down to using the toolchain libraries directly, which
is not supported and forced the compiler to produce the PLT relocations
(as strlen() is unresolved at this point). On Genode you are supposed to
go through the base library, i.e. ld.lib.so, that already takes care of
setting things up the proper way. As the Unwind symbols required by the
libgo runtime were not exported the linking step of the 'go_app' probably
failed.


Regards
Josef

-- 
Josef Söntgen
Genode Labs

http://www.genode-labs.com/ · http://genode.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.genode.org/pipermail/users/attachments/20210407/f6ce396a/attachment.sig>


More information about the users mailing list