Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve error message.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 31 Mar 2014 14:34:21 +0000 (16:34 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 31 Mar 2014 14:34:21 +0000 (16:34 +0200)
src/simix/smx_global.c
teshsuite/simix/stack_overflow.tesh

index 7df250c..71a85a4 100644 (file)
@@ -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,
 {
   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)) {
             "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)) {
index 2606c83..a0df41e 100644 (file)
@@ -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...
 ! 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).
 > Try to increase stack size with --cfg=contexts/stack_size (current size is 96 KiB).