Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#36555 - [glibc] core dump when pthread_cancel() while thread is inside pthread_cond_timedwait()

Attached to Project: Arch Linux
Opened by Olivier Langlois (lano1106) - Thursday, 15 August 2013, 21:03 GMT
Last edited by Allan McRae (Allan) - Friday, 16 August 2013, 21:48 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture i686
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I have modified the tst-cond25.c test to compile with glibc test driver as the driver forbibs the test to create core dumps. See attachement.

I have investigated the core dump a bit and it seems to come from cancelling pthread_cond_timedwait call:

(gdb) where
#0 0xb77762c1 in ?? () from /usr/lib/libgcc_s.so.1
#1 0xb7776a3a in ?? () from /usr/lib/libgcc_s.so.1
#2 0xb7776e40 in _Unwind_Resume () from /usr/lib/libgcc_s.so.1
#3 0xb77517a2 in _Unwind_Resume () from /usr/lib/libpthread.so.0
#4 0xb774d2d7 in __condvar_tw_cleanup () from /usr/lib/libpthread.so.0
#5 0x00000001 in ?? ()

The problem seem to be introduced by commit

http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=4f682b2ae941b9bacde6015799b7ae77301a6d87

If I roll back that commit, the core dump goes away.

Additional info:
* 2.18
* i686


Steps to reproduce:

Run nptl/tst-cond25 test
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 16 August 2013, 21:48 GMT
Reason for closing:  Upstream
Additional comments about closing:  http://sourceware.org/bugzilla/show_bug. cgi?id=15843
Comment by Allan McRae (Allan) - Thursday, 15 August 2013, 21:31 GMT
I need more info. Are you compiling with different CFLAGS etc. Does this still break when you are not running the -ck kernel?
Comment by Olivier Langlois (lano1106) - Thursday, 15 August 2013, 21:37 GMT
I will test with vanilla Arch kernel.

For my CFLAGS, I have these:

-march=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4

but, I do have the core dump just but compiling my modified test program and running it with the official core repo binaries. So I guess we can rule out compiling issues.

lano1106@hpmini ~/dev/glibc-test $ gcc -pthread -g tst-cond25.c
lano1106@hpmini ~/dev/glibc-test $ ./a.out
do_test_wait (timed_waiter)
Segmentation fault (core dumped)
lano1106@hpmini ~/dev/glibc-test :( $ ^C
lano1106@hpmini ~/dev/glibc-test :( $ ./a.out
do_test_wait (timed_waiter)
Segmentation fault (core dumped)
lano1106@hpmini ~/dev/glibc-test :( $ gcc -pthread -g -O0 tst-cond25.c
lano1106@hpmini ~/dev/glibc-test $ ./a.out
do_test_wait (timed_waiter)
Segmentation fault (core dumped)

Comment by Olivier Langlois (lano1106) - Thursday, 15 August 2013, 23:39 GMT
Same thing happens with stock kernel:

lano1106@hpmini ~/dev/glibc-test $ ./a.out
do_test_wait (timed_waiter)
Segmentation fault (core dumped)
lano1106@hpmini ~/dev/glibc-test :( $ uname -a
Linux hpmini 3.10.6-2-ARCH #1 SMP PREEMPT Tue Aug 13 10:20:52 CEST 2013 i686 GNU/Linux
Comment by Olivier Langlois (lano1106) - Friday, 16 August 2013, 14:25 GMT
/proc/cpuinfo attached
Comment by Allan McRae (Allan) - Friday, 16 August 2013, 21:48 GMT
I see you filed an upstream bug report. As I can not replicate, it is best just to track there.

http://sourceware.org/bugzilla/show_bug.cgi?id=15843

Loading...