|
Bugzilla – Full Text Bug Listing |
| Summary: | Python examples get valgrind errors when build subdirectories are specified in waf | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Mitch Watrous <watrous> |
| Component: | build system | Assignee: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ns-bugs, watrous |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 1326 | ||
I think, python examples get valgrind errors, period. They always have and they always will. It's a problem with valgrind/python interaction. In the past, we had disabled valgrind for python programs, I don't know why they're using valgrind again... The problem is that I am not running test.py using valgrind, i.e. I just did this
./test.py
It sounds like there is some logic bug in test.py that causes it to simply not find the correct path the python scripts to run. It has nothing to do with valgrind. ---------- begin standard err ---------- /usr/bin/python: can't open file '/home/gjc/projects/ns/ns-3-allinone/ns-3-dev/build/examples/routing/simple-routing-ping6.py': [Errno 2] No such file or directory The problem is here:
def run_job_synchronously(shell_command, directory, basedir, valgrind, is_python, build_path=""):
(base, build) = os.path.split (NS3_BUILDDIR)
This test.py program could really use some refactoring: all the needed paths are in the Job object, this run_job_synchronously should be a method of Job, not a function, to get access to all the attributes.
(In reply to comment #4) > The problem is here: > > def run_job_synchronously(shell_command, directory, basedir, valgrind, > is_python, build_path=""): > (base, build) = os.path.split (NS3_BUILDDIR) > > This test.py program could really use some refactoring: all the needed paths > are in the Job object, this run_job_synchronously should be a method of Job, > not a function, to get access to all the attributes. What exactly is the problem in that function? (In reply to comment #5) > (In reply to comment #4) > > The problem is here: > > > > def run_job_synchronously(shell_command, directory, basedir, valgrind, > > is_python, build_path=""): > > (base, build) = os.path.split (NS3_BUILDDIR) > > > > This test.py program could really use some refactoring: all the needed paths > > are in the Job object, this run_job_synchronously should be a method of Job, > > not a function, to get access to all the attributes. > > What exactly is the problem in that function? With NS3_BUILDDIR=/foo/bar/ns-3-dev/build/debug, the statement: (base, build) = os.path.split (NS3_BUILDDIR) gets: base=/foo/bar/ns-3-dev/build build=debug This is why the python script is not found, it is constructed as <base>/python-script.py. It is funny because the Job objects defined in test.py already have a base attribute which is correctly defined as /foo/bar/ns-3-dev. It's just that the run_job_synchronously is not using the Job attributes, it is reinventing the wheel. Bug closed. ns-3-dev changeset: 6b3d1a5495f7 |
In test.py, Python examples get valgrind errors when build subdirectories are specified in waf configure. To reproduce this bug do the following steps: hg clone http://code.nsnam.org/ns-3-allinone cd ns-3-allinone/ ./download.py ./build.py --enable-examples --enable-tests cd ns-3-dev/ rm -rf build ./waf configure --enable-examples --enable-tests --out=build/debug -d debug ./waf build ./test.py These Python tests fail in test.py: VALGR: Example examples/routing/simple-routing-ping6.py VALGR: Example examples/wireless/wifi-ap.py VALGR: Example examples/wireless/mixed-wireless.py VALGR: Example examples/tutorial/first.py VALGR: Example src/bridge/examples/csma-bridge.py VALGR: Example src/core/examples/sample-simulator.py VALGR: Example src/flow-monitor/examples/wifi-olsr-flowmon.py ... 166 of 173 tests passed (166 passed, 0 skipped, 0 failed, 0 crashed, 7 valgrind errors)