Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in "cmake --build build --target run_example" #42

Closed
oscarmex1986 opened this issue Nov 9, 2018 · 11 comments
Closed

Error in "cmake --build build --target run_example" #42

oscarmex1986 opened this issue Nov 9, 2018 · 11 comments

Comments

@oscarmex1986
Copy link

`OMNeT++ Discrete Event Simulation (C) 1992-2017 Andras Varga, OpenSim Ltd.
Version: 5.2, build: 170929-f95315d, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Qtenv...

Loading NED files from /home/oscar/artery/src/artery:
<!> Error: Could not load NED sources from '/home/oscar/artery/src/artery': Syntax error, at /home/oscar/artery/src/artery/networking/Vanetza.ned:26

End.
scenarios/artery/CMakeFiles/run_example.dir/build.make:57: recipe for target 'scenarios/artery/CMakeFiles/run_example' failed
make[3]: *** [scenarios/artery/CMakeFiles/run_example] Error 1
CMakeFiles/Makefile2:576: recipe for target 'scenarios/artery/CMakeFiles/run_example.dir/all' failed
make[2]: *** [scenarios/artery/CMakeFiles/run_example.dir/all] Error 2
CMakeFiles/Makefile2:583: recipe for target 'scenarios/artery/CMakeFiles/run_example.dir/rule' failed
make[1]: *** [scenarios/artery/CMakeFiles/run_example.dir/rule] Error 2
Makefile:259: recipe for target 'run_example' failed
make: *** [run_example] Error 2
`
I'm installing the newest version of the simulation environment, and this error shows up. I'm running it in buntu 16.04, with GCC , Boost 1.65.1 and OMNET++ 5.2. I've also tried to reset to previous releases, but different errors occur.

@riebl
Copy link
Owner

riebl commented Nov 9, 2018

Dear @oscarmex1986,

since this error does not occur with more recent OMNeT++ versions (e.g. OMNeT++ 5.4.1 on my system), please consider updating your OMNeT++ installation.

@oscarmex1986
Copy link
Author

It throws a different error now. After loading the graphical interface and selecting the veins configuration and clicking on play, it shows:
`OMNeT++ Discrete Event Simulation (C) 1992-2018 Andras Varga, OpenSim Ltd.
Version: 5.4.1, build: 180629-5e28390, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Qtenv...

Loading NED files from /home/oscar/artery/src/artery: 75
Loading NED files from /home/oscar/artery/src/traci: 16
Loading NED files from /home/oscar/artery/extern/veins/examples/veins: 1
Loading NED files from /home/oscar/artery/extern/veins/src/veins: 38
Loading NED files from /home/oscar/artery/extern/inet/src: 666
Loading NED files from /home/oscar/artery/extern/inet/examples: 174
Loading NED files from /home/oscar/artery/extern/inet/tutorials: 19
Loading NED files from /home/oscar/artery/extern/inet/showcases: 33

Loading images from './bitmaps': : 0
Loading images from './images': : 0
Loading images from '/home/oscar/omnetpp-5.4.1/images': : 0 abstract/: 90 background/
: 4 block/
: 320 device/: 195 logo/: 1 maps/: 9 misc/: 70 msg/: 55 old/: 111 status/*: 28

Loading configuration... done.
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error).
Segmentation fault (core dumped)
scenarios/artery/CMakeFiles/run_example.dir/build.make:57: recipe for target 'scenarios/artery/CMakeFiles/run_example' failed
make[3]: *** [scenarios/artery/CMakeFiles/run_example] Error 139
CMakeFiles/Makefile2:576: recipe for target 'scenarios/artery/CMakeFiles/run_example.dir/all' failed
make[2]: *** [scenarios/artery/CMakeFiles/run_example.dir/all] Error 2
CMakeFiles/Makefile2:583: recipe for target 'scenarios/artery/CMakeFiles/run_example.dir/rule' failed
make[1]: *** [scenarios/artery/CMakeFiles/run_example.dir/rule] Error 2
Makefile:259: recipe for target 'run_example' failed
make: *** [run_example] Error 2
`

@riebl
Copy link
Owner

riebl commented Nov 10, 2018

I am sorry that you are experiencing a segmentation fault when running Artery. With your help @oscarmex1986 I hope to find and fix this bug: Can you please run the simulation in debug mode (set CMAKE_BUILD_TYPE to "Debug" and then "cmake --build build --target debug_example")? The debugger will then stop (near) the code line causing the problem. Thanks!

PS: This example is not faulting on my system, hence I cannot reproduce the problem on my own.

@oscarmex1986
Copy link
Author

If I understand correctly, I have to change Line 44 of Makefile in the root directory to

cd $<; cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON ..

and then run "cmake --build build --target debug_example" on the terminal in the root directory.

The output is make: *** No rule to make target 'debug_example'. Stop.

@oscarmex1986
Copy link
Author

Also, when building the run_example, it showed a warning about Boost:
`CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106501
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:42 (find_package)

-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- date_time
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106501
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:45 (find_package)

CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version 106501
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:45 (find_package)`

Could it be related to the issue?

@riebl
Copy link
Owner

riebl commented Nov 12, 2018

No, do not change the Makefile! Go to your build directory and use ccmake or cmake-gui to change the build configuration there.

@oscarmex1986
Copy link
Author

I ran the debug_example, and this is where I am at:
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/oscar/omnetpp-5.4.1/bin/opp_run_dbg...done.

@oscarmex1986
Copy link
Author

I ran the debugger and this is the output:
`<!> Error: Attempt to load the oppsim shared library more than once. This usually happens when part of your simulation is using release libraries while other parts are using the debug version. Make sure to rebuild all parts of your model in either release or debug mode!

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6b757cd in omnetpp::cObject::getFullPathabi:cxx11 const (
this=<error reading variable: Cannot access memory at address 0x7fffff7feff0>) at cobject.cc:57
57 {
(gdb)
`

@oscarmex1986
Copy link
Author

I rebuilt all in Debug mode and ran the debugger. These two are the outputs:

  1. This appeared in the graphical interface:
    ASSERT: Condition 'currentMethodCall' does not hold in function 'methodcallEnd' at messageanimator.cc:128 -- in module (artery::Router) World.node[0].appl.vanetza.router (id=20), at t=0.260276337038s, event #5

  2. The terminal threw this:
    Thread 1 "opp_run_dbg" received signal SIGTRAP, Trace/breakpoint trap. omnetpp::cRuntimeError::notifyEnvir (this=0x2d12760) at cexception.cc:260 260 }

@riebl
Copy link
Owner

riebl commented Nov 13, 2018

This might be related to #44. I am still wondering though why there is no such problem on my system.

@oscarmex1986
Copy link
Author

I checked out #44 and ran the debugger again. Then I built run_example and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants