Bug 192686 - Segfaults using combinations of -pie -pthread -lm(|_p) when profiling
Summary: Segfaults using combinations of -pie -pthread -lm(|_p) when profiling
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: threads (show other bugs)
Version: CURRENT
Hardware: i386 Any
: --- Affects Many People
Assignee: freebsd-threads (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-15 17:09 UTC by Thomas Zander
Modified: 2017-04-23 18:25 UTC (History)
1 user (show)

See Also:


Attachments
Demo code for bug (158 bytes, text/plain)
2014-08-15 17:09 UTC, Thomas Zander
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander freebsd_committer 2014-08-15 17:09:50 UTC
Created attachment 145830 [details]
Demo code for bug

Combinations of -pie, -lm(|_p) and -pthread compile successfully but then segfault. Using attached demo code I get this on FreeBSD 11.0-CURRENT #0 r268981:

[1]> clang -pg -pie -pthread -lm profile.c && ./a.out
Segmentation fault (core dumped)

[2]> clang -pg -pie -pthread -lm_p profile.c && ./a.out
Segmentation fault (core dumped)

[3]> clang -pg -pthread -lm profile.c && ./a.out
Segmentation fault (core dumped)

[4]> clang -pg -pthread -lm_p profile.c && ./a.out
[SUCCESS]

[5]> clang -pg -pthread -lm profile.c && ./a.out
Segmentation fault (core dumped)

[6]> clang -pg -pie -pthread  profile.c && ./a.out 
Segmentation fault (core dumped)


At least 2,4,6 are supposed to work, if not all.
On 10-STABLE, e.g. 3+4 work as expected.