[gcc(refs/users/ibuclaw/heads/darwin)] Darwin D : Disable backtraces for Darwin for now.

Iain Buclaw ibuclaw@gcc.gnu.org
Sun Mar 14 22:02:12 GMT 2021


https://gcc.gnu.org/g:8b8e2290073c24bc6897f4d82abb6edad32cf506

commit 8b8e2290073c24bc6897f4d82abb6edad32cf506
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 848b607ae69..508cc0fc563 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");
@@ -497,6 +500,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;
@@ -521,11 +525,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;


More information about the Gcc-cvs mailing list