From 66934906303205eef608e3463db03af6c7ac8f52 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 31 Mar 2014 16:34:21 +0200 Subject: [PATCH 1/1] Improve error message. --- src/simix/smx_global.c | 7 ++++++- teshsuite/simix/stack_overflow.tesh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index 7df250c5c1..71a85a4b3d 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -44,7 +44,12 @@ static void _XBT_CALL segvhandler(int signum, siginfo_t *siginfo, void *context) { if (siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) { fprintf(stderr, - "Access violation detected. This can result from a stack overflow.\n" + "Access violation detected.\n" + "This can result from a programming error in your code or, although less likely,\n" + "from a bug in SimGrid itself. This can also be the sign of a bug in the OS or\n" + "in third-party libraries. Failing hardware can sometimes generate such errors\n" + "too.\n" + "Finally, if nothing of the above applies, this can result from a stack overflow.\n" "Try to increase stack size with --cfg=contexts/stack_size (current size is %d KiB).\n", smx_context_stack_size / 1024); if (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_debug)) { diff --git a/teshsuite/simix/stack_overflow.tesh b/teshsuite/simix/stack_overflow.tesh index 2606c83a4b..a0df41eb0f 100644 --- a/teshsuite/simix/stack_overflow.tesh +++ b/teshsuite/simix/stack_overflow.tesh @@ -1,5 +1,10 @@ ! expect signal SIGSEGV $ ./simix/stack_overflow --cfg=contexts/stack_size:96 ${srcdir:=.}/simix/stack_overflow.xml > [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function... -> Access violation detected. This can result from a stack overflow. +> Access violation detected. +> This can result from a programming error in your code or, although less likely, +> from a bug in SimGrid itself. This can also be the sign of a bug in the OS or +> in third-party libraries. Failing hardware can sometimes generate such errors +> too. +> Finally, if nothing of the above applies, this can result from a stack overflow. > Try to increase stack size with --cfg=contexts/stack_size (current size is 96 KiB). -- 2.20.1