Bug 894

Summary: ./waf --run error message upon segfault
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: build systemAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: gjcarneiro, jpelkey
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: Patch
patch

Description Mathieu Lacage 2010-04-22 05:32:48 UTC
The typical output of ./waf --run when a segfault happens is this:
Command ['/home/muhr/Documents/cplus-ns3-workspace/MIMO_MESH_204/build/
debug/scratch/MIMO_MESH/MIMO_MESH'] exited with code -11


Could we make waf print something different such as:

"Your program crashed: run it under a debugger to get more information. For example, with gdb, type \"./waf --command-template="gdb %s" --run YOURPROGRAM\""

Where YOURPROGRAM would be the argument the user specified to --run
Comment 1 Lalith Suresh 2010-04-22 23:40:31 UTC
Created attachment 845 [details]
Patch

Attaching a patch. Here's what a segmentation fault now shows up as:

nightstrike@irule:~/builds/ns3/new/ns-3-final$ ./waf --run "scratch/xyz --assocMethod1=1"
Waf: Entering directory `/home/nightstrike/builds/ns3/new/ns-3-final/build'
'/home/nightstrike/builds/ns3/new/ns-3-final/bindings/python/ns3/__init__.py' -> '/home/nightstrike/builds/ns3/new/ns-3-final/build/debug/bindings/python/ns3/__init__.py'
Waf: Leaving directory `/home/nightstrike/builds/ns3/new/ns-3-final/build'
'build' finished successfully (0.789s)
Your program crashed with exit code -11 (Segmentation fault). Run it under a debugger to get more information. For example, with gdb, type:
./waf --command-template="gdb %s" --run "scratch/xyz --assocMethod1=1"
Comment 2 Mathieu Lacage 2010-04-23 01:48:37 UTC
gustavo, ok with you ?
josh, can we push this in the release ?
Comment 3 Gustavo J. A. M. Carneiro 2010-04-23 06:52:45 UTC
Created attachment 846 [details]
patch

This version of the patch works with any signal, not just sigsegv.
Comment 4 Josh Pelkey 2010-04-23 10:51:27 UTC
(In reply to comment #3)
> Created an attachment (id=846) [details]
> patch
> 
> This version of the patch works with any signal, not just sigsegv.

+1, support this for ns-3.8.
Comment 5 Gustavo J. A. M. Carneiro 2010-04-23 10:55:46 UTC
changeset:   6275:77f833c7ddae
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Fri Apr 23 15:55:15 2010 +0100
summary:     Bug 894 - ./waf --run error message upon segfault