From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39615 invoked by alias); 28 Jun 2018 14:18:23 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 39572 invoked by uid 89); 28 Jun 2018 14:18:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=blindly, 46, H*i:sk:2b47dbd, H*f:sk:2b47dbd X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 3 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Jun 2018 14:18:21 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0015881DE3; Thu, 28 Jun 2018 14:18:19 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-5.rdu2.redhat.com [10.10.112.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B26480DE0; Thu, 28 Jun 2018 14:18:17 +0000 (UTC) Subject: Re: Invalid program counters and unwinding To: Florian Weimer , GCC , GNU C Library , Binutils , gnu-gabi@sourceware.org References: <6feeaf09-0bc2-238b-42df-2ff915f3581e@redhat.com> <2b47dbd9-f1a2-1bf0-06ca-fca40660fabf@redhat.com> From: Jeff Law Openpgp: preference=signencrypt Autocrypt: addr=law@redhat.com; prefer-encrypt=mutual; keydata= xsBNBFkbIO8BCACVIqDhDVh9ur8C+zNV1J/cXfwvVDAUcphDEFl4jyHqZORK4Pd3Db8oWqLm Q8lOCr/VOS7lrCtdpVMQkLGOGA16oJ8g7hzhnojpjY09UjsoUiG7oKacuxj8skfp6SIx93Zl +iNYPRa4S+za6nY8qiVjyUuiyX04ZPZMrKp2c2sGi+HnBKUZXGhrz/Jdzdox3tjajWZnObyy nhEN6hn9L3KawTtGPE/R6A/1RhHTD9FQmIWIeucpaY5c6GNKXTFpj2VYx57LY5hve1R5vhrJ IZcgwZAiOtmik5lVi96glY5h6bugRwpexjhwORTLPBCkwiYotSxX99mWd6EHL576i5CNABEB AAHNGUplZmYgTGF3IDxsYXdAcmVkaGF0LmNvbT7CwI4EEwEIADgWIQR+niGjtnP5P/8PpRq8 fP682pgzWwUCWRsg7wIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRC8fP682pgzW5QG B/9VATJmx5235RB+8jiDYGXQf3vd9gBfPy/l1tsaK400eFAevDzfGvKmeCKe+uGnlrH3vyT8 rg9zqH+s5a1Y+lDXPOpJAFmmzbOLU4FW4ucbawmtYvBL65PqpQneCTYnC802/OAcxjm/Onem HlgeK6WicNsBTPwYN/0araDFUejyYBIFi9CNqqflwk5Z3brKbQ9bAYIkysVLC/c3njKPmM0c WPFHG91ubLbWCHwTIK0+mAL714eTD74dXzOjO2ZDBPLGlFN/kO3+YjaO6UOD2O8acvAMCivT kWLr7JwRgLIQDN2DkhQDd3LTPqQE/yOcMcXBTO+fxm8KG0iKQBqWMyGJzsBNBFkbIO8BCACy qbOsv7XegSeea8XORt5zMaBVWKoSyhmmcCmlxZFS2cuYOBt79MO13lZE2DlO3Lv5IKikj/D4 ketGVO4+h5psEMH5Yz5P8bx0TmgwbK1GxPZrzeXozUFJDvvCDbIlT0v0pwUXuK3hg8Ieo2h5 uTed/cn1OjySXW5BqLxN0cyr5hL+J6dcsHvKLT/N3nTgCQhoJXK2MrEMhAGgF3jKpMn3CoS4 i/ZbNI2MQR6LWHwdZ95f0fI8NzHSfVzeLtzCKQec7nr9fgd6Ylk1ZpGWQUPlQmKjzYgeCeTK NO04cwt20WIrQWeWiZFPA0U86NDBdSBrYp4kG3dfIXE+wSSvE7qPABEBAAHCwHYEGAEIACAW IQR+niGjtnP5P/8PpRq8fP682pgzWwUCWRsg7wIbDAAKCRC8fP682pgzW3REB/9cT7iKRPg/ OK9bpLlllIEDM90IaKC79DQrv+fRudOR78cdV4XUwPSFnyHUsP3VJ4lDy5FhiKCwGie0BK53 EsxgMrLy1L8hboFdTE4Vi0xzCheMaMVp4hATDU29k1cuxu1VPpCa8E3mYeHjNV7ip0HN5L4D rfs8lRPJE/oM1vGs9DgQFZrCPPNRNGKC97BH+DHccesEJr7tSsQrkPkt0z/FTKr5wIM02vSx OJjgmcVbGB7dc2j/Sx8loXmuKnuKtM35668kUG8jeJvSQk3o/VHpD27bhl0rR68R2jN6G6kQ egMVb6dPu1Ius8rBE5rFw88J4JEb5q4hMNClWWUFHIdP Message-ID: <6c555c05-e6d7-f37a-577f-4e0559c36f76@redhat.com> Date: Mon, 01 Jan 2018 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <2b47dbd9-f1a2-1bf0-06ca-fca40660fabf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 28 Jun 2018 14:18:20 +0000 (UTC) X-SW-Source: 2018-q2/txt/msg00027.txt.bz2 On 06/28/2018 06:30 AM, Florian Weimer wrote: > On 06/28/2018 04:16 AM, Jeff Law wrote: >>> Previous discussions: >>> >>> https://gcc.gnu.org/ml/gcc/2013-05/msg00253.html >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71744 >>> https://sourceware.org/ml/libc-alpha/2016-07/msg00613.html >>>    (patch with a spread lock, still not async-signal-safe) > >> You might also want to look at RH BZ 1293594 which I think has pointers >> back to an issue from 2008 :( > > Interesting.  That does suspiciously look like a concurrent dlclose. > It's just that the crash handler crashes, after the application crash. I > think this one is really NOTABUG, both technically and from user impact: > we do not cause the crash, we just react poorly to the application > triggering undefined behavior. > > In the bug, you mentioned this code fragment for x86-64: > > 42        unsigned char *pc = context->ra; > 43        struct sigcontext *sc; > 44        long new_cfa; > 45 > 46        /* movq __NR_rt_sigreturn, %rax ; syscall  */ > 47        if (*(unsigned char *)(pc+0) == 0x48 > 48            && *(unsigned long *)(pc+1) == 0x050f0000000fc0c7) > > I'm not sure I agree that it is “dumb”, but I think it proves > conclusively that you cannot feed random addresses to the unwinder. 8-) I believe "dumb" is referring to the fact that we're already in a bit of a weird state as evidenced by the NULL FDE. Blindly trying to read the contents of the PC that we couldn't map to an FDE is, IMHO, dumb. One might even be able to argue in this day and age that we should have suitable descriptors for everything. If no suitable descriptor is found then backtracing should stop. Lack of suitable descriptors in any code would be considered a bug in that scenario. jeff