http://llvm.org/bugs/show_bug.cgi?id=20003
Bug ID: 20003
Summary: Crashing on pthread_join
Product: clang
Version: 3.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: libclang
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 12638
--> http://llvm.org/bugs/attachment.cgi?id=12638&action=edit
source code
I think this is a bug. The code sounds sound and it works normally if I compile
with GCC.
The source code is attached. The file `in` is above. Ex:
$ gcc -ggdb -pthread thread.c
$ ./a.out < in
1 2 3
4 5 6
7 8
9 10
11 12
BEFORE SLEEP
AFTER SLEEP
AFTER JOIN
58 64
139 154
Count: 4
$ clang -ggdb -pthread thread.c
$ ./a.out < in
1 2 3
4 5 6
7 8
9 10
11 12
BEFORE SLEEP
AFTER SLEEP
Segmentation fault (core dumped)
$
I suppose this is an bug in clang.
OS: Ubuntu 12.04.4 fully updated (Linux hostname 3.2.0-64-generic #97-Ubuntu
SMP Wed Jun 4 22:04:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux)
clang: Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM
3.0) Target: x86_64-pc-linux-gnu Thread model: posix
Proc: Intel i5 4 "cores"
===== BEGIN FILE "IN" =====
2 3
1 2 3
4 5 6
3 2
7 8
9 10
11 12
====== END FILE ======
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs