Date: Fri, 26 Sep 2014 17:00:02 +0200 From: Guillaume Friloux <guillaume@friloux.me> To: freebsd-threads@freebsd.org Subject: Segfault from libthr.so. Message-ID: <20140926150001.GF7885@Jetdail>
next in thread | raw e-mail | index | archive | help
--f5QefDQHtn8hx44O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, First of all, i am new to the BSD world. I am here to report a problem when linking an hello world with -lssp and -l= pthread. I am running : FreeBSD sds 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:= 59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 root@sds:/tmp # gcc48 main.c -o main=20 root@sds:/tmp # ./main=20 Hello World! root@sds:/tmp # gcc48 main.c -o main -lpthread root@sds:/tmp # ./main Hello World! root@sds:/tmp # gcc48 main.c -o main -lssp root@sds:/tmp # ./main Hello World! root@sds:/tmp # gcc48 main.c -o main -lssp -lpthread root@sds:/tmp # ./main Hello World! root@sds:/tmp # gcc48 main.c -o main -lpthread -lssp=20 root@sds:/tmp # ./main Segmentation fault (core dumped) root@sds:/tmp # =20 Here is what gdb says : root@sds:/tmp # gdb main main.core=20 GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols f= ound)... Core was generated by `main'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done. Loaded symbols for /lib/libthr.so.3 Reading symbols from /lib/libssp.so.0...(no debugging symbols found)...done. Loaded symbols for /lib/libssp.so.0 Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.7 Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...= done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x000000080082e604 in pthread_testcancel () from /lib/libthr.so.3 [New LWP 100071] (gdb) bt #0 0x000000080082e604 in pthread_testcancel () from /lib/libthr.so.3 #1 0x0000000800826706 in open () from /lib/libthr.so.3 #2 0x0000000800a41227 in __gets_chk () from /lib/libssp.so.0 #3 0x0000000800a413d2 in __chk_fail () from /lib/libssp.so.0 #4 0x0000000800a40ace in .init () from /lib/libssp.so.0 #5 0x00007fffffffd120 in ?? () #6 0x0000000800604691 in r_debug_state () from /libexec/ld-elf.so.1 #7 0x0000000800603d27 in __tls_get_addr () from /libexec/ld-elf.so.1 #8 0x0000000800602089 in .text () from /libexec/ld-elf.so.1 #9 0x0000000000000000 in ?? () Here is the hello world code : #include <stdio.h> int main(int argc, char **argv) { printf("Hello World!\n"); return 0; } Thanks for taking time to read this. --f5QefDQHtn8hx44O Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUJX9xAAoJEG/Km+Gfxp5IxGIQAKGra02WfWgPHd19J5joTgnn eronppcc09LOyebEkTHHtzs9Tsvh8h6JbTwho+erBAv7AMWGFBZ41INxhK3xZ08h qD2XRn20CWML788wTpy+JQXFi3FzZGegmJdILINp5QndXhPxX1jVYUXCCmzMeH2f /fbSirT5TaEVoa9mH5XwI3LrjDKgA4Rz5w2qfIKNYLwa2UJvjbslPmDDyCZb4b37 JzyxbBhh47ERAgeWTBhqhutVJC0taEIzj9Jy3+e4yq3olx/CY6RQS7joOggvjL4M H33qUFCuYWxABDotW6BkAHMFf0dPGtgMfBoeZBw7ek7YzNj+LSiv3xanHycVzQf1 HrRiF7+qRjq1FzAfb7fwTjWVMXPYh/iP5me+6GbRw/rRa4SNw1sNQvS2a2lDPjAR 7TZWdA/ar5x9usBBWTuYviQhlbiDVINvTxgPVgBy9JXpmakLjHB2HE89zv1Nt3M+ MOXHPvfn9gcHAZ0gWMIDsP8kodxT8CPPO/Fwz844JtWW0MBSnzfkZfIZdO+C1EvC 7dj3ORRInlHs6uO7ELO0bhsjeSXSYlVwN7+g7fTb+Ki+/z2bhkcZ6sa9FQXwbsVr rj2hOFWNHwnRj20X4VsGFuXJ1gqZUm7I0QedNiuiozV/02Ez+Xr0ffXhReoiTWpR iOkNyiHY1EEcpOiDJCTj =VAh0 -----END PGP SIGNATURE----- --f5QefDQHtn8hx44O--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140926150001.GF7885>