From e89b7783676052e81644c7047c5d5fce51e58a8c Mon Sep 17 00:00:00 2001 From: n-isaka Date: Fri, 5 Apr 2019 14:13:56 +0900 Subject: [PATCH] =?UTF-8?q?fix(libcob):=20SIGSEGV=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=82=B9=E3=82=BF=E3=83=83=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=B9=E3=82=92=E5=8F=96=E5=BE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SIGSEGV発生時に、原因の追跡のための情報が不足しているため、 スタックトレースの出力を追加した --- libcob/common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcob/common.c b/libcob/common.c index 3968e819..8a3d6f51 100644 --- a/libcob/common.c +++ b/libcob/common.c @@ -208,6 +208,11 @@ cob_sig_handler (int sig) } fprintf (stderr, "Attempt to reference unallocated memory (Signal SIGSEGV)\n"); fprintf (stderr, "Abnormal termination - File contents may be incorrect\n"); + fprintf (stderr, "---- trace start ----\n"); + void *trace[128]; + int n = backtrace(trace, sizeof(trace) / sizeof(trace[0])); + backtrace_symbols_fd(trace, n, 1); + fprintf (stderr, "---- trace end ----\n"); fflush (stderr); exit (SIGSEGV); }