Hello to all,
I posted yesterday a problem I had with porting a software switch executable in DCE, that uses std::thread. In this post I provide more details and a way to re-produce the problem easily. I managed to reproduce the problem with a very simple c++ program that uses two threads. The program exits with a SIGSEGV. Attached you will find the code for this simple program. I also attach the output of the gdb backtrace when the error occurs. I also modified the task-manager so as to print whenever it switches between threads. The cpp program is really simple: The main boots up a thread and this threads execute in a while loop, in which it sleeps for 2 seconds in each loop. The main thread also executes the same loop.
I attach the gdb result of "backtrace" command after the error occurs. What really bugs me is that the error is received in different points in each run. I believe this is a bug in DCE, or I understand and do something really really wrong, or both.
My dce version is the 1.9 and the ns-3 version is the 3.26.
I compile the program with " g++ -std=c++11 -fPIC simple.cpp -pie -rdynamic -lpthread -o simple " and then I copy the executable in the /usr/local/bin (or wherever the DCE_PATH or DCE_ROOT points to). In order to execute it quickly you can modify the "myscripts/sleep" example to point to the "simple" binary. Also, comment the Simulator::stop() line in the script.
Any help with this issue would be greatly appreciated.
Thanks,
Andreas Pantelopoulos