From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8377 Path: news.gmane.org!not-for-mail From: Andy Lutomirski Newsgroups: gmane.linux.lib.musl.general Subject: _Unwind_Backtrace crashes Date: Thu, 27 Aug 2015 11:55:24 -0700 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1440701772 26531 80.91.229.3 (27 Aug 2015 18:56:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2015 18:56:12 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-8389-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 27 20:56:12 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZV2LC-0006L6-Th for gllmg-musl@m.gmane.org; Thu, 27 Aug 2015 20:56:03 +0200 Original-Received: (qmail 30046 invoked by uid 550); 27 Aug 2015 18:56:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 29980 invoked from network); 27 Aug 2015 18:55:55 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=nDXgTU7P40y4NRCQaOPBeOBxzQKHWLAQs+jamdQVxz4=; b=Op52XRTeC0GalJseUzUZ/ZUf7LN6V4UVDY4+BLNf/58yB1oJPEH4dmZ3HLhRJA2HUz jwMGnRvWFI0nDKKY+eO5SAHlyBuqZHNJeC2sOQ7KTvV4tN9wm3lSS2NBuZbT+qFOin65 Zbv6k5f0iuVRQwDW8aKVyZ4fihDA+mo86PdFPvLHVkHomFYfdilM6mnv3Fg8OTpi8pjR mZ339YFjxMnNIPs04yznC45EEszJ1y0Bj9N1v/g7eCbhErNaSSJIQNVpcHJlIpapvzip uyXbTGePFoFpEB+Lgt14gRImtU8jYz16ODpv62P+nMxsVqBDYgtVMkfRlLZARbQN34pn hmdA== X-Gm-Message-State: ALoCoQnKblI1OnQhSHPcs8Sjidrzc0vm2DNcq+l0kvhDUKA3eqF0CGHbJdqIHpK+B7EWKpiJ+TEQ X-Received: by 10.202.232.197 with SMTP id f188mr2972272oih.122.1440701743925; Thu, 27 Aug 2015 11:55:43 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:8377 Archived-At: This works on glibc. It aborts on musl on i386 using the latest git version. I suspect it's because whatever calls main isn't properly annotated, but I don't know how to debug this without rebuilding gcc, which is kind of a mess. #define _GNU_SOURCE #include #include #include #include #include #include static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), int flags) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = handler; sa.sa_flags = SA_SIGINFO | flags; sigemptyset(&sa.sa_mask); if (sigaction(sig, &sa, 0)) err(1, "sigaction"); } _Unwind_Reason_Code trace_fn(struct _Unwind_Context * ctx, void *opaque) { return _URC_NO_REASON; } static void sigusr1(int sig, siginfo_t *info, void *ctx_void) { printf("In signal handler. Trying to unwind.\n"); _Unwind_Backtrace(trace_fn, 0); } int main() { printf("Unwind directly\n"); _Unwind_Backtrace(trace_fn, 0); printf("Unwind from signal handler\n"); sethandler(SIGUSR1, sigusr1, 0); raise(SIGUSR1); printf("OK\n"); } -- Andy Lutomirski AMA Capital Management, LLC