From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14842 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Patrick Oppenlander Newsgroups: gmane.linux.lib.musl.general Subject: another armv7-m exception handling problem Date: Mon, 21 Oct 2019 15:43:40 +1100 Message-ID: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="93530"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-14858-gllmg-musl=m.gmane.org@lists.openwall.com Mon Oct 21 06:44:06 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iMPY5-000OFC-Ts for gllmg-musl@m.gmane.org; Mon, 21 Oct 2019 06:44:05 +0200 Original-Received: (qmail 13811 invoked by uid 550); 21 Oct 2019 04:44:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 13779 invoked from network); 21 Oct 2019 04:44:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=T+3l2Rhm+TDL/5JSum4kzm2HR+xW+kkB0EXaV59epnc=; b=rS30V+YlnAt9bi+bLgDT1IWmSkVvuDUllgt+zT37lLs3QwZmxqspt90ACLij6zyW6b WMwIzB5D6y45kvjnOxsVKPWGWmDa5gNQf2nJ7w24GHMh9hidBVFCbhzrVzYoa9OKJfWj f73hnVx0jR1CVO7j1qp/tEjZ6ZBjE6G4hab9pkq4jdV4XU8Ajx1FvgHWjbRN/aa+Dqw9 G6Rk3Xy6x0+4SdbP0JBZ4x9UJcPT1MieLBz7aHEjHBheUyJPZ7XlE9WtHZRl6p0zYONv pLgPosTLh6iXv86kyH2wadjYcdRu0jfp2yHExycvtPSatVk1BUmmm/KFR7zLamP9jRi3 JDPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=T+3l2Rhm+TDL/5JSum4kzm2HR+xW+kkB0EXaV59epnc=; b=psdbS+w08vSlT4jBejWc0q61BkVNf0YPDjTjPyRyxQ7QSYw533hfQPqwdpyxwZGGdi DyltBv5dqyBAUQUk8DwF6guXeierVAxp4Jvb9D/u6vqgobEvi+4fCLHUSRKE1buiq1fU xnF//um/We27IxlAm7BAhiayqlLPTuThiOKRJE7n8vPt7oYcoxLdV6EeVDK0L9kLugMg y+2VO4ziMtMqu1q/pnu2eNjqLDgRy7/qdIOv8fAkvkPFJISxEfxnyFbzGE4Y4x2RLLN8 UuShlFP1qUFIcmCx3mNcf4/ER4827ST+MuotrXi31sKfo7oNbIFPbJ5G+114gTXacGCw csXQ== X-Gm-Message-State: APjAAAUZehe5o4vArzTphea60jJVWmpFtKG6WK7qIpvcNxdRY9Os4TMW /CD0oSPCs9HPm+30gkXDe0q73ImxMS2CcZCv/oVd0MnP X-Google-Smtp-Source: APXvYqwKp1kkLW5mr5f9TU1O6E22+lJabtwfMIQ+XSxJ2He0VeqSu3UqjEiwpy8OC+L5i2kq5BUuBFenJbFbZBnbTaw= X-Received: by 2002:a2e:8893:: with SMTP id k19mr13264093lji.5.1571633031068; Sun, 20 Oct 2019 21:43:51 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:14842 Archived-At: Not sure if this is a musl, gcc or ld bug. Running gcc-8.3.0 musl 1.1.24 static pie. Simple test case: int main() { try { throw 1; } catch (int d) { return d; } return 0; } Expected: % ./a.out % echo $? 1 Actual: % ./a.out terminate called after throwing an instance of 'int' terminate called recursively Aborted (core dumped) The problem is that get_eit_entry is returning _URC_FAILURE here: if (__gnu_Unwind_Find_exidx) { eitp = (const __EIT_entry *) __gnu_Unwind_Find_exidx (return_address, &nrec); if (!eitp) { UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; <----- !!!! } } Looks like a linker or program load problem to me -- the GOT entry for __gnu_Unwind_Find_exidx is correctly set to 0, but after program load it's been offset to some non-zero value. There's an R_ARM_RELATIVE relocation on the GOT entry. Not sure where this is going wrong. Kind regards, Patrick