NuxiNL / cloudlibc

CloudABI's standard C library
BSD 2-Clause "Simplified" License
295 stars 17 forks source link

segfault on freebsd 11 #4

Closed johalun closed 8 years ago

johalun commented 8 years ago

Hi! This is really exciting work and I look forward to trying it out.

I followed the instructions on https://nuxi.nl/cloudabi/freebsd/ but I get segfault when running helloworld..

Running ./_obj/cloudlibc-unittests also gives segfault..

FreeBSD PC1 11.0-CURRENT FreeBSD 11.0-CURRENT #0 5a410d3(HEAD): Wed Apr 6 11:14:22 PDT 2016 root@PC1:/usr/obj/usr/home/johannes/dev/freebsd/sys/GENERIC-NODEBUG amd64

EdSchouten commented 8 years ago

Hi there!

I just did some grepping through SVN logs and I think I know what's causing the segfaults for you. I recently had to rework the way we do thread-local storage in order to make userspace emulation of CloudABI executables easier:

Cloudlibc: https://github.com/NuxiNL/cloudlibc/commit/b5cfa352316bec90ca379e2f1ec0a8c9795e4075 FreeBSD: https://svnweb.freebsd.org/base?view=revision&revision=297613

Unfortunately, this change had to break the existing ABI in the sense that older applications still work with recent kernels, but new applications don't work with older kernels. Looking at the commit hash in your uname, you're running r297591, which is 22 revisions older than r297613. Be sure to let me know whether upgrading to >=r297613 fixes these segfaults.

(As a side-note: please also make sure that you're using cloudabi-utils>=0.11, as I messed up the 0.10 release)

johalun commented 8 years ago

I will update the kernel and try again. As for the cloudabi-utils, I am install from cloudabi-ports which provices version 0.9. Do you have plans to update the port or can I install from source?

EdSchouten commented 8 years ago

Thanks! I'll also update the installation docs to mention that r297613 is required.

FreeBSD Ports has already been updated to version 0.11: https://www.freshports.org/sysutils/cloudabi-utils

johalun commented 8 years ago

pkg install gives me 0.9 as latest version... I will try install from ports.

johalun commented 8 years ago

Hello world and unit tests works fine now with newer kernel and utils 0.11 from ports tree.