From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8355 Path: news.gmane.org!not-for-mail From: Dirk Vanden Boer Newsgroups: gmane.linux.lib.musl.general Subject: Segfault when using c++11 thread Date: Sat, 22 Aug 2015 20:03:28 +0200 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0118366c968743051dea331b X-Trace: ger.gmane.org 1440266633 23666 80.91.229.3 (22 Aug 2015 18:03:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Aug 2015 18:03:53 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8367-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 22 20:03:53 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZTD8z-0004f0-3U for gllmg-musl@m.gmane.org; Sat, 22 Aug 2015 20:03:53 +0200 Original-Received: (qmail 24540 invoked by uid 550); 22 Aug 2015 18:03:45 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24475 invoked from network); 22 Aug 2015 18:03:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gOKkkK6Mljh03ZGvSGrO6LXynOG1XaGhsLfc60MH/N0=; b=H6HxvBFrmzvwhkehVPGtPn9OZkw9PGiVQDiCfWKUlcFUHm7filXpDZB0uE3ZDa6hhT 2cNCr+2w23HiEJRQkYST21HlGOLLc0dtx0EU6mOmjw1JrPkByFsv2hi99bo/v45hSoV+ b488BoQ1k3wIss0Dkt2Gtz60toGICbDNmVEzXdTxD+rbIsXY5xiYVlgXLy/ILPFPFoR9 r3zUK9hwFQIhHYl1H7gwDk0IIjXfJLgPP8iv3k2bLMjlGkN1nqP4RBtNOB5D2vlXvVdB TtosDv1M4IX88XUB1H0q63VjRu1W8PljOh3oLo8vcgZp16ICDpof1SWyzFIoaqO5c1Kr 77QQ== X-Received: by 10.112.163.72 with SMTP id yg8mr13175020lbb.82.1440266608607; Sat, 22 Aug 2015 11:03:28 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:8355 Archived-At: --089e0118366c968743051dea331b Content-Type: text/plain; charset=UTF-8 Hi, I compiled a native x86_64-linux-musl toolchain on my arch linux box using the musl-cross scripts (no modifications). When running code that uses c++11 threading functionality I get segfaults: Minimal reproduction file: #include #include int main() { std::cout << "Thread id: " << std::this_thread::get_id() << std::endl; } compile with: ./cross/x86_64-linux-musl/bin/x86_64-linux-musl-g++ -pthread -std=c++11 -static -g main.cpp -o test file test test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped Running test crashes, gdb backtrace: Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00000000004006ac in __gthread_self () at /home/dirk/cross/x86_64-linux-musl/x86_64-linux-musl/include/c++/5.2.0/x86_64-linux-musl/bits/gthr-default.h:686 #2 0x00000000004007ad in std::this_thread::get_id () at /home/dirk/cross/x86_64-linux-musl/x86_64-linux-musl/include/c++/5.2.0/thread:263 #3 0x00000000004006bc in main () at main.cpp:6 Am I doing something wrong? Regards, Dirk --089e0118366c968743051dea331b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I compiled a native=C2=A0x86_64-lin= ux-musl toolchain on my arch linux box using the musl-cross scripts (no mod= ifications).

When running code that uses c++11 thr= eading functionality I get segfaults:

Minimal repr= oduction file:
#include <thread>
#include &l= t;iostream>

int main()
{
= =C2=A0 =C2=A0 std::cout << "Thread id: " << std::this= _thread::get_id() << std::endl;
}

compile with:
./cross/x86_64-linux-musl/bin/x86_64-lin= ux-musl-g++ -pthread -std=3Dc++11 -static -g main.cpp -o test

file test
test: ELF 64-bit LSB executable,= x86-64, version 1 (SYSV), statically linked, not stripped
=
Running test crashes, gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0= x0000000000000000 in ?? ()
(gdb) bt
#0 =C2=A00x00000000= 00000000 in ?? ()
#1 =C2=A00x00000000004006ac in __gthread_self (= ) at /home/dirk/cross/x86_64-linux-musl/x86_64-linux-musl/include/c++/5.2.0= /x86_64-linux-musl/bits/gthr-default.h:686
#2 =C2=A00x00000000004= 007ad in std::this_thread::get_id () at /home/dirk/cross/x86_64-linux-musl/= x86_64-linux-musl/include/c++/5.2.0/thread:263
#3 =C2=A00x0000000= 0004006bc in main () at main.cpp:6

Am I doin= g something wrong?

Regards,
Dirk
--089e0118366c968743051dea331b--