From owner-freebsd-questions@FreeBSD.ORG Mon Sep 9 16:03:18 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA1482CC for ; Mon, 9 Sep 2013 16:03:18 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from nm2-vm1.bullet.mail.bf1.yahoo.com (nm2-vm1.bullet.mail.bf1.yahoo.com [98.139.213.158]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA1620E2 for ; Mon, 9 Sep 2013 16:03:18 +0000 (UTC) Received: from [66.196.81.173] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 09 Sep 2013 16:03:11 -0000 Received: from [98.139.212.225] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 09 Sep 2013 16:03:11 -0000 Received: from [127.0.0.1] by omp1034.mail.bf1.yahoo.com with NNFMP; 09 Sep 2013 16:03:11 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 142052.42313.bm@omp1034.mail.bf1.yahoo.com Received: (qmail 27745 invoked by uid 60001); 9 Sep 2013 16:03:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1378742590; bh=w87JDUPiVre/53gMEBFQKlzkbq02tm9UfG8tSlnEOHY=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VRgCZjbhxyBQOwp46FyABY9evEiQ6jMzEVpnC/RmvFVBKtG0ZVvflC7X9xk+NUgWSl8uGEkk2oQRJrZPKi48d5GYubRPhlYKP7dSLsLGg2rDAoiCysnt5PLuno/7zxivODqBoW7PF9AXTr6PLW6XqZNNpaGQsiefFzEGzoJxUFY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=0j9VUCgr9rS0JNQQ3Lqly4NSbSNLcyrhhXtETzvp967vResQfkMyFPsDmTG2gozX/5/Lor8wqn2r53yWJLkobUNuuSMrl1pvZ68zEfrwOA3ctWQq+4yhvemXtBfZkExMJBbqbpUEfFWoTHhYs5NKgu0vnmF3RlMtmzC7qVFrtq8=; X-YMail-OSG: 2N9EWgMVM1mnkoHX6X6LZqEFky400BZe1gW0xf6YA38szKM 3YHR9rE0CqRFBUTJT6whhAKaUzWJe9vjaRFjGh_5M4Km.4kklAq80a9UWEyu seGdiBnuEsfWfM4VVxvpV7nh113nTmrVsjoO8gZalES9RhEZ4mPUObLi8luv DDh4BvRc2FZAx923MNbXkjtNhPaXsN.IqWdeUCV0XjvjoLXuxWECyPedkGu2 X4QgJ_SEsQTSQ7Gn5nz.fbIKbqPFm4h98zFk4tG2kdEyd9yjDfdvDIvAA13l EFSD4zouJyDUclYCwk9WU4loti7ZSr06pCSIkOByxo7LI_PHw0ZOkGE_6aDA rsLBUNQEL01pAZC4AoKktZn5z_iTn_dMqmT3itldErSrk4_XzMXqXwfBfRxR DtgugOEMlFkF7QxJUwGNqaBgQv3751puN3_QstZrgxxDOepUQjC_ZDTOkYbU kEIokbHGOsuo_e1BTQErEaDQ1HT0Nzms2nOB3BGDOPbvy0H1B77LE9kVVjCw ZgckzK8PZ0WoxgNBdJUmogcVoR_7Zv3vNRoW8KpEFSNqUx1NjY4GOZNs_Mul T3pknDaH2EKMeDtjT1WPmLChfY5jCs5DnSDtH92_oauiyE11wzl9fWu13Coo 7Gh.Xto1njaldA8GvF...DD7cRVXc0d1ImCM- Received: from [124.43.79.78] by web161906.mail.bf1.yahoo.com via HTTP; Mon, 09 Sep 2013 09:03:10 PDT X-Rocket-MIMEInfo: 002.001, LS0tLS0gT3JpZ2luYWwgTWVzc2FnZSAtLS0tLQoKPiBGcm9tOiBNYXR0aGV3IFNlYW1hbiA8bWF0dGhld0BmcmVlYnNkLm9yZz4KPiBUbzogZnJlZWJzZC1xdWVzdGlvbnNAZnJlZWJzZC5vcmcKPiBDYzogCj4gU2VudDogTW9uZGF5LCBTZXB0ZW1iZXIgOSwgMjAxMyAyOjIzIFBNCj4gU3ViamVjdDogUmU6IFdoZW4gc3RhdGljYWxseSBsaW5rZWQgQWJvcnQgdHJhcDogNiAoY29yZSBkdW1wZWQpCj4gCj4gT24gMDkvMDkvMTMgMTM6MjEsIFVuZ2Egd3JvdGU6Cj4.ICBUaGlzIGlzIEZyZWVCU0QgOS4xIG9uIGkBMAEBAQE- X-Mailer: YahooMailWebService/0.8.156.576 References: <1378729305.77647.YahooMailNeo@web161906.mail.bf1.yahoo.com> <522DD9FB.1050205@freebsd.org> Message-ID: <1378742590.26892.YahooMailNeo@web161906.mail.bf1.yahoo.com> Date: Mon, 9 Sep 2013 09:03:10 -0700 (PDT) From: Unga Subject: Re: When statically linked Abort trap: 6 (core dumped) To: Matthew Seaman , "freebsd-questions@freebsd.org" In-Reply-To: <522DD9FB.1050205@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Unga List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 16:03:19 -0000 ----- Original Message -----=0A=0A> From: Matthew Seaman =0A> To: freebsd-questions@freebsd.org=0A> Cc: =0A> Sent: Monday, Septem= ber 9, 2013 2:23 PM=0A> Subject: Re: When statically linked Abort trap: 6 (= core dumped)=0A> =0A> On 09/09/13 13:21, Unga wrote:=0A>> This is FreeBSD = 9.1 on i386.=0A>> =0A>> My program works well without any issue when all l= ibraries are dynamically =0A> linked.=0A>> =0A>> But when some libraries a= re statically link and run it develops:=0A>> Abort trap: 6 (core dumped)= =0A>> =0A>> How I compile and link:=0A>> cc myprog.c -Wall -O \=0A>> -L.= -ls1 -ls2 \=0A>> -lz -lm -lmd -lpthread \=0A>> -o myprog=0A>> =0A>> =0A>= > libs1.a and libs2.a are static libs.=0A>> =0A>> Any idea why? =0A> =0A>= Not the foggiest, and we aren't going to be able to tell you anything=0A> = sensible without a lot more detailed debugging information.=A0 I mean,=0A> = between us we know a lot, but we are by no means omniscient.=0A> =0A> How a= bout getting a back trace from the core file your program has produced?=0A>= =0A> =A0=A0=A0 Cheers,=0A> =0A> =A0=A0=A0 Matthew=0A> =0A> =0AHi Matthew= =0A=0ASorry being not informative enough.=0A=0A1. gdb ./myprog myprog.core= =0A=0AProgram terminated with signal 6, Aborted.=0A:=0ALoaded symbols for /= libexec/ld-elf.so.1=0A#0=A0 0x292e6297 in kill () from /lib/libc.so.7=0A=0A= =0A2. truss ./myprog=0A:=0Agetpid()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 =3D 0 (0x0)=0A_umtx_op(0x2a4044ac,0x15,0x1,0x0,0x0,0x2a4520d0) =3D 0= (0x0)=0A_umtx_op(0x281b7158,0xf,0x0,0x0,0x0,0x2a407f00)=A0 =3D 0 (0x0)=0AS= IGNAL 6 (SIGABRT)=0Akill(4506,SIGABRT)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0 (0x0)=0Aproces= s exit, rval =3D 0=0A=0A=0A3. I'm trying to statically link relevant portio= ns from following two libs for my app:=0A/usr/local/lib/libssl.a=0A/usr/loc= al/lib/libcrypto.a=0A=0ASame error (Abort trap: 6) develops even if I use:= =0A/usr/lib/libssl.a=0A/usr/lib/libcrypto.a=0A=0A=0A4. openssl-1.0.1_8 is i= nstalled here.=0A=0A=0A5. Please note, when the libssl.so (either one) dyna= mically linked no issue.=0A=0A=0A6. Does it mean libssl.a and libcrypto.a i= n FreeBSD 9.1 broken or I don't link it right?=0A=0A=0APlease let me know w= hat other info you need.=0A=0AUnga