Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2017 22:52:33 +0100
From:      Andreas Tobler <andreast-list@fgznet.ch>
To:        Gerald Pfeifer <gerald@pfeifer.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Tijl Coosemans <tijl@FreeBSD.org>, freebsd-current@FreeBSD.org
Subject:   Re: Segfault in _Unwind_* code called from pthread_exit
Message-ID:  <a54bfe87-e5ce-00ff-67e7-99a5abc52b73@fgznet.ch>
In-Reply-To: <alpine.LSU.2.21.1710312234210.5916@anthias.pfeifer.com>
References:  <20170824180830.199885b0@kalimero.tijl.coosemans.org> <20170825173851.09116ddc@kalimero.tijl.coosemans.org> <20170825234442.GO1700@kib.kiev.ua> <20170826202813.1240a1ef@kalimero.tijl.coosemans.org> <20170826184034.GR1700@kib.kiev.ua> <20171029182351.502f53cf@kalimero.tijl.coosemans.org> <20171029191358.GU2566@kib.kiev.ua> <9a724da4-70f1-4330-9a77-619739008a14@fgznet.ch> <20171030153207.15a42a1e@kalimero.tijl.coosemans.org> <9468430e-fda4-10f4-b6a0-aa40d7d64f5b@fgznet.ch> <20171031092803.GA2566@kib.kiev.ua> <9619a1f8-bb42-abc9-a4ee-3b93192f365e@fgznet.ch> <alpine.LSU.2.21.1710312234210.5916@anthias.pfeifer.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------40C450CC1D50A0A8104883DE
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 31.10.17 22:36, Gerald Pfeifer wrote:
> On Tue, 31 Oct 2017, Andreas Tobler wrote:
>> Do we, FreeBSD'ers, want to have gcc unwind support on older than
>> FreeBSD 9.3 releases? I think the gcc folks do not care, but we are the
>> ones who might have an need for such a support?
>> @Gerald, do you have an opinion?
> 
> Yes. No. :-)
> 
> Those possibly still stuck on obsolete versions of FreeBSD don't
> need/want fancy new compilers and GCC 4.9 is still available for
> use and does not exhibit this issue, correct?  (If it does, nobody
> reported any problems.)

It is limited to gcc >=5, gcc-4.9 does not have the 
MD_FALLBACK_FRAME_STATE_FOR defined.

>> I can 'ifdef' the new code and in the 'else' case we fall back to
>> the already existing path.
> 
> If it's "cheap", that might be nice.

Attached, the test is running on gcc trunk and gcc-6. gcc-6 is the last 
one with java support and there we have quite extensive test cases which 
really test for this MD_FALLBACK_FRAME_STATE_FOR macro. These test 
cases, Throw_2 and co do pass. So I think the new bits should be fine.
Also some coming asan test cases do pass with this addition too.

> Thanks to the three of you - Tijl, Konstantin, and Andreas!

Gruss,
Andreas


--------------40C450CC1D50A0A8104883DE
Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0";
 name="libgcc-fbsd-unwind.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="libgcc-fbsd-unwind.diff"

SW5kZXg6IGxpYmdjYy9jb25maWcvaTM4Ni9mcmVlYnNkLXVud2luZC5oCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIGxpYmdjYy9jb25maWcvaTM4Ni9mcmVlYnNkLXVud2luZC5oCShyZXZpc2lvbiAy
NTQyMDUpCisrKyBsaWJnY2MvY29uZmlnL2kzODYvZnJlZWJzZC11bndpbmQuaAkod29ya2lu
ZyBjb3B5KQpAQCAtMjgsNyArMjgsMTAgQEAKIAogI2luY2x1ZGUgPHN5cy90eXBlcy5oPgog
I2luY2x1ZGUgPHNpZ25hbC5oPgorI2luY2x1ZGUgPHVuaXN0ZC5oPgorI2luY2x1ZGUgPHN5
cy9zeXNjdGwuaD4KICNpbmNsdWRlIDxzeXMvdWNvbnRleHQuaD4KKyNpbmNsdWRlIDxzeXMv
dXNlci5oPgogI2luY2x1ZGUgPG1hY2hpbmUvc2lnZnJhbWUuaD4KIAogI2RlZmluZSBSRUdf
TkFNRShyZWcpCXNmX3VjLnVjX21jb250ZXh0Lm1jXyMjIHJlZwpAQCAtMzYsNiArMzksMzkg
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nbmVkIGludCAqKShjb250ZXh0LT5yYSArICA4
KSA9PSAweDAxYTFjMGM3CiAgICAgICAgICYmICoodW5zaWduZWQgaW50ICopKGNvbnRleHQt
PnJhICsgMTIpID09IDB4MDUwZjAwMDAgKSkKICAgICByZXR1cm4gX1VSQ19FTkRfT0ZfU1RB
Q0s7CisjZWxzZQorICBpZiAoeDg2XzY0X291dHNpZGVfc2lndHJhbXBfcmFuZ2UoY29udGV4
dC0+cmEpKQorICAgIHJldHVybiBfVVJDX0VORF9PRl9TVEFDSzsKKyNlbmRpZgogCiAgIHNm
ID0gKHN0cnVjdCBzaWdmcmFtZSAqKSBjb250ZXh0LT5jZmE7CiAgIG5ld19jZmEgPSBzZi0+
UkVHX05BTUUocnNwKTsKICAgZnMtPnJlZ3MuY2ZhX2hvdyA9IENGQV9SRUdfT0ZGU0VUOwot
ICAvKiBSZWdpc3RlciA3IGlzIHJzcCAgKi8KLSAgZnMtPnJlZ3MuY2ZhX3JlZyA9IDc7Cisg
IGZzLT5yZWdzLmNmYV9yZWcgPSAgX19MSUJHQ0NfU1RBQ0tfUE9JTlRFUl9SRUdOVU1fXzsK
ICAgZnMtPnJlZ3MuY2ZhX29mZnNldCA9IG5ld19jZmEgLSAobG9uZykgY29udGV4dC0+Y2Zh
OwogCiAgIC8qIFRoZSBTVlI0IHJlZ2lzdGVyIG51bWJlcmluZyBtYWNyb3MgYXJlbid0IHVz
YWJsZSBpbiBsaWJnY2MuICAqLwo=
--------------40C450CC1D50A0A8104883DE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a54bfe87-e5ce-00ff-67e7-99a5abc52b73>