Bug 894 - ./waf --run error message upon segfault
./waf --run error message upon segfault
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: build system
pre-release
All All
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-22 05:32 UTC by Mathieu Lacage
Modified: 2010-04-23 10:55 UTC (History)
2 users (show)

See Also:


Attachments
Patch (1.62 KB, patch)
2010-04-22 23:40 UTC, Lalith Suresh
Details | Diff
patch (1.15 KB, patch)
2010-04-23 06:52 UTC, Gustavo J. A. M. Carneiro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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