sustrik / libdill

Structured concurrency in C
MIT License
1.68k stars 155 forks source link

libdill failures on FreeBSD with gcc #67

Closed bapt closed 7 years ago

bapt commented 7 years ago

With gcc: ./configure 1 failure ./configure --disable-threads == same failure ./configure --disable-threads CFLAGS="-DDILL_ARCH_FALLBACK -fno-stack-protector :

make  check-TESTS
Segmentation fault (core dumped)
FAIL: tests/example
Segmentation fault (core dumped)
FAIL: tests/go
Segmentation fault (core dumped)
FAIL: tests/fd
PASS: tests/handle
Segmentation fault (core dumped)
FAIL: tests/chan
Segmentation fault (core dumped)
FAIL: tests/choose
Segmentation fault (core dumped)
FAIL: tests/sleep
Segmentation fault (core dumped)
FAIL: tests/signals
Segmentation fault (core dumped)
FAIL: tests/overload
PASS: tests/rbtree

With clang ./configure all OK ./configure --disable-threads all OK ./configure --disable-threads CFLAGS="-DDILL_ARCH_FALLBACK -fno-stack-protector all ok

avsej commented 7 years ago

@bapt could you post ./test-suite.log after tests failures

avsej commented 7 years ago

Nevermind, I've got it reproduced on FreeBSD 11.0-RELEASE-p6 with the following steps:

git clean -dfx
./autogen.sh
./configure --disable-threads CFLAGS="-DDILL_ARCH_FALLBACK -fno-stack-protector" CC=gcc49 CPP=cpp49
make check
avsej commented 7 years ago

The minimal flags set is

./autogen.sh && ./configure CFLAGS="-DDILL_ARCH_FALLBACK"  && make
raedwulf commented 7 years ago

The stack trace should work now, let me know if there are any further issues.

avsej commented 7 years ago

The tests are green now

raedwulf commented 7 years ago

@avsej did my commit fix it?

avsej commented 7 years ago

Yes. That was your fix to jump issue

bapt commented 7 years ago

Testing on the latest tree I got: All green with clang

With gcc:

===============================================
   libdill 1.0-54-gb092596: ./test-suite.log
===============================================

# TOTAL: 12
# PASS:  10
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/fd
==============

Assert failed: !dill_slist_empty(&ctx->ready) (cr.c:405)
FAIL tests/fd (exit status: 134)

FAIL: tests/handle
==================

FAIL tests/handle (exit status: 138)

gcc --disable-threads

===============================================
   libdill 1.0-82-geb66650: ./test-suite.log
===============================================

# TOTAL: 10
# PASS:  8
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/fd
==============

Assert failed: !dill_slist_empty(&ctx->ready) (cr.c:405)
FAIL tests/fd (exit status: 134)

FAIL: tests/handle

FAIL tests/handle (exit status: 138)

gcc --disable-threads CFLAGS="-DDILL_ARCH_FALLBACK -fno-stack-protector"

=================================================================
   libdill 1.0-82-geb66650: ./test-suite.log
===============================================

# TOTAL: 10
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  9
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/example
===================

FAIL tests/example (exit status: 139)

FAIL: tests/go
==============

FAIL tests/go (exit status: 139)

FAIL: tests/fd
==============

FAIL tests/fd (exit status: 139)

FAIL: tests/handle
==================

FAIL tests/handle (exit status: 138)

FAIL: tests/chan
================

FAIL tests/chan (exit status: 139)

FAIL: tests/choose
==================

FAIL tests/choose (exit status: 139)

FAIL: tests/sleep
=================

FAIL tests/sleep (exit status: 139)

FAIL: tests/signals
===================

FAIL tests/signals (exit status: 139)

FAIL: tests/overload
====================

FAIL tests/overload (exit status: 139)
raedwulf commented 7 years ago

I may have some time tomorrow to look at this; for now can you create a backtrace? That should be working now.

raedwulf commented 7 years ago

I can't reproduce this in a FreeBSD VPS with 11.0-RELEASE-p2

Have you tried adding "-Wl,-rpath=/usr/local/lib/gcc49" to LDFLAGS.

raedwulf commented 7 years ago

I'll have some time tomorrow to try it on bare metal

raedwulf commented 7 years ago

Just tested this again on bare-metal and it is working with gcc-4.9. It may have already been fixed in HEAD or FreeBSD has fixed a bug...

If you still have the problem, can you double check your glibc/gcc is up-to-date as well.