public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/iains/heads/d-for-darwin)] Darwin D : Disable backtraces for Darwin for now.
Date: Wed, 13 Oct 2021 08:31:40 +0000 (GMT)	[thread overview]
Message-ID: <20211013083140.9DA993858435@sourceware.org> (raw)

https://gcc.gnu.org/g:842c7b21de346bbb55d2c973694b3c7f16f57465

commit 842c7b21de346bbb55d2c973694b3c7f16f57465
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Dec 19 13:21:46 2020 +0000

    Darwin D : Disable backtraces for Darwin for now.
    
    It seems that there is some fault in the handling of these that
    causes the process to spin if the backtrace is attempted in most
    cases.

Diff:
---
 libphobos/libdruntime/core/runtime.d | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libphobos/libdruntime/core/runtime.d b/libphobos/libdruntime/core/runtime.d
index 5fc99046d23..77b8f466566 100644
--- a/libphobos/libdruntime/core/runtime.d
+++ b/libphobos/libdruntime/core/runtime.d
@@ -479,6 +479,9 @@ extern (C) bool runModuleUnitTests()
 
         static extern (C) void unittestSegvHandler( int signum, siginfo_t* info, void* ptr )
         {
+            version(Darwin) {}
+            else
+            {
             import core.stdc.stdio;
             fprintf(stderr, "Segmentation fault while running unittests:\n");
             fprintf(stderr, "----------------\n");
@@ -489,6 +492,7 @@ extern (C) bool runModuleUnitTests()
 
             foreach (size_t i, const(char[]) msg; bt)
                 fprintf(stderr, "%s\n", msg.ptr ? msg.ptr : "???");
+            }
         }
 
         sigaction_t action = void;
@@ -513,11 +517,15 @@ extern (C) bool runModuleUnitTests()
 
         static extern (C) void unittestSegvHandler( int signum, siginfo_t* info, void* ptr ) nothrow
         {
+            version(Darwin) {}
+            else
+            {
             static enum MAXFRAMES = 128;
             void*[MAXFRAMES]  callstack;
 
             auto numframes = backtrace( callstack.ptr, MAXFRAMES );
             backtrace_symbols_fd( callstack.ptr, numframes, 2 );
+            }
         }
 
         sigaction_t action = void;


             reply	other threads:[~2021-10-13  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  8:31 Iain D Sandoe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-18 15:55 Iain D Sandoe
2021-10-15 19:34 Iain D Sandoe
2021-10-11 20:36 Iain D Sandoe
2021-01-11 21:27 Iain D Sandoe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211013083140.9DA993858435@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).