Crash while starting a scene (work on different computer)

Report crashes, strange behaviour, or apparent bugs
coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Crash while starting a scene (work on different computer

Post by coppelia »

Thank you, we'll look into this.

Cheers

coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Crash while starting a scene (work on different computer

Post by coppelia »

We have checked several things and following is probably what is happening:

when you load scenes over and over again, and when for each scene you start some data streaming, then you need to make sure to close any ongoing data streaming, otherwise you will waste precious resources and communication time (the remote API will become slower and slower since more and more data needs to be conveyed). Your crash might be linked to that. Try to stop data streaming each time you close a scene, like in following example:

Code: Select all

// start streaming:
simxGetJointPosition(clientID,motorHandle,&pos,simx_opmode_streaming);

// stop streaming:
simxGetJointPosition(clientID,motorHandle,&pos,simx_opmode_discontinue); 
The reason is that from one scene to another (even if the scene is the same), object handles might be different. And joints that are not there anymore can still stream an error code back to the remote API.

Finally, when doing hundreds of different simulation run on the same scene, there is no need to close and reload the scene: simply stop and restart the simulation (most parameters and values are automatically reset at simulation stop).

Cheers

dknetz
Posts: 8
Joined: 07 May 2014, 14:23

Re: Crash while starting a scene (work on different computer

Post by dknetz »

Hi,

I found a similar/related problem: When I use the ros service call /vrep/simRosLoadScene V-REP directly throws a SegFault (I used the command line tool rosservice call...). The output in debubLog.txt seems to be the same as in the log of zweifel. I used gdb to get more details, which results in the following output:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffab969700 (LWP 27723)]
0x00007ffff15cd269 in glDeleteTextures () from /usr/lib/nvidia-current/libGL.so.1
Console output:

Code: Select all

Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'Dynamics': loading...
Plugin 'Dynamics': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
Plugin 'Collada': load succeeded.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'Ros': loading...
Plugin 'Ros': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
Plugin 'Urdf': loading...
Plugin 'Urdf': load succeeded.
Plugin 'Vision': loading...
Plugin 'Vision': load succeeded.
Using the internal 'MeshCalc' functionality.
Using the 'Dynamics' plugin.
Using the internal 'PathPlanning' functionality.
Segmentation fault (core dumped)
Hope this helps!

coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Crash while starting a scene (work on different computer

Post by coppelia »

Thanks for the info!

We cannot reproduce the crash here, but that is probably linked to the GPU driver type. There is indeed a bug that can cause a crash, linked to destroying textures not owned by the current thread (the same bug is also affecting the simCloseScene function). We have modified the V-REP library, and the new linux 64bit version can be found here.

Please let us know if that solves the problem.

Cheers

zweifel
Posts: 14
Joined: 24 Apr 2014, 05:09

Re: Crash while starting a scene (work on different computer

Post by zweifel »

Finally, when doing hundreds of different simulation run on the same scene, there is no need to close and reload the scene: simply stop and restart the simulation (most parameters and values are automatically reset at simulation stop).
Thank you very much for pointing out! I tried it and it seems much faster. However, at some point it still does not stop the simulation and enter forever in the following loop:

Code: Select all

                        int error_code= simxStopSimulation(clientID, simx_opmode_oneshot_wait);
                        while(error_code!=simx_return_ok)
                        {
                                printf("error while trying to stop the simulation%d\n",error_code);
                                printError(error_code);

                                error_code= simxStopSimulation(clientID, simx_opmode_oneshot_wait);
                        }


I will try later the tests with the new version of V-REP.

thearvie
Posts: 6
Joined: 21 Mar 2013, 19:33

Re: Crash while starting a scene (work on different computer

Post by thearvie »

Hello! I'm facing the same error as dknetz.

I'm using rosservice call in the terminal to bring a new scene, and vrep simply crashes.
On my older setup (Ubuntu 12.04 32bits) it worked like a charm.
On my new setup (Ubunto 12.04 64bits), simply crashes.

Code: Select all

$ rosservice call /vrep/simRosLoadScene a.ttt
ERROR: transport error completing service call: unable to receive data from sender, check sender's logs for details
And, at v-rep's terminal, it says:

Code: Select all

$ ./vrep.sh
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'Dynamics': loading...
Plugin 'Dynamics': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
Plugin 'Collada': load succeeded.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'Ros': loading...
Plugin 'Ros': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
Plugin 'Urdf': loading...
Plugin 'Urdf': load succeeded.
Using the internal 'MeshCalc' functionality.
Using the 'Dynamics' plugin.
Using the internal 'PathPlanning' functionality.
Segmentation fault (core dumped)
My v-rep version is: V-REP_PRO_EDU_V3_1_1_64_Linux

Ubuntu version:

Code: Select all

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.4 LTS
Release:	        12.04
Codename:	precise
I've enabled all the debug features under vrep/system/usrset.txt. This are the last lines of debugLog.txt. simLoadScene only shows on this part of the debug info:

Code: Select all

00011892 <-- (SIM C API) simSetBooleanParameter_internal
00011892 --> (SIM C API) simLoadScene_internal
00011892 $$S 0,0,1,0 (SIM) 'locking for write' (simLoadScene_internal)
00011892 $$S
00011892 $$S +++++++++++++++++++++++++++++++++++++++++++++++++++++++
00011892 $$S +++++++++++++++++++++++++++++++++++++++++++++++++++++++
00011892 $$S 0,0,1,1 (SIM) 'locked for write' (simLoadScene_internal)
00011892 --> (SIM FUNC) loadScene
00011892 --> (SIM FUNC) closeDlg
00011892 --> (GUI FUNC) __closeDlg
00011892 <-- (GUI FUNC) __closeDlg
00011892 <-- (SIM FUNC) closeDlg
00011892 --> (SIM FUNC) newSceneProcedure
00011893 <-- (SIM FUNC) newSceneProcedure
00011897 ... (SIM) (setParent) 'easy unlocking'
00011897 ... (SIM) (setParent) 'easy unlocked'
00011898 ... (SIM) (setParent) 'easy locking'
00011898 ... (SIM) (setParent) 'easy locked'
00011899 ... (SIM) (setParent) 'easy unlocking'
00011899 ... (SIM) (setParent) 'easy unlocked'
00011899 ... (SIM) (setParent) 'easy locking'
00011899 ... (SIM) (setParent) 'easy locked'
00011900 ... (SIM) (setParent) 'easy unlocking'
00011900 ... (SIM) (setParent) 'easy unlocked'
00011901 ... (SIM) (setParent) 'easy locking'
00011901 ... (SIM) (setParent) 'easy locked'
00011902 ... (SIM) (setParent) 'easy unlocking'
00011902 ... (SIM) (setParent) 'easy unlocked'
00011903 ... (SIM) (setParent) 'easy locking'
00011903 ... (SIM) (setParent) 'easy locked'
00011904 ... (SIM) (setParent) 'easy unlocking'
00011904 ... (SIM) (setParent) 'easy unlocked'
00011904 ... (SIM) (setParent) 'easy locking'
00011904 ... (SIM) (setParent) 'easy locked'
00011905 ... (SIM) (setParent) 'easy unlocking'
00011905 ... (SIM) (setParent) 'easy unlocked'
00011906 ... (SIM) (setParent) 'easy locking'
00011906 ... (SIM) (setParent) 'easy locked'
After this, v-rep is dead.
I've just downloaded new video card drivers (?!) but nothing works as well. I also downloaded the libv_rep.so that coppelia provided a few posts ago, but v-rep's terminal says:

Code: Select all

$ ./vrep.sh
Error: could not find or correctly load the V-REP library
Other ros service calls, like simRosStartSimulation and simRosStopSimulation works like a charm, flawless.
Can you help me?

Thanks in advance,
Richard.
/*
Post-Scriptum: Another piece of information: When I was updating my video card drivers (NVIDIA geforce 650ti), at some point I've lost all my drivers - my bad - and I had to install xorg, xserver and ubuntu-desktop manually, via apt-get. After that, as a miracle, v-rep started working, didn't complained about anything, loaded scenes via ros plugin like an angel. But, after I installed again the NVIDIA drivers, it stopped working. I know this looks like completely unrelated, but, still, it happened this way.
*/

coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Crash while starting a scene (work on different computer

Post by coppelia »

Hello Richard,

have you tried the updated V-REP library mentioned in our previous message further up? Because your symptoms would explain the reason of the problem, and should be fixed with that updated library.

Cheers

dknetz
Posts: 8
Joined: 07 May 2014, 14:23

Re: Crash while starting a scene (work on different computer

Post by dknetz »

Hello,

coppelia, the lib you posted in your previous post isn't working for me too - I get the same error as Richard:
$ ./vrep.sh
Error: could not find or correctly load the V-REP library
I also use a NVidia gpu (GTX 660), but using the CUDA development drivers. Additionally, my Ubuntu is 64bit, too. Maybe the problem can only be found in the 64bit version? If you have questions regarding my system, feel free to ask.

Cheers

thearvie
Posts: 6
Joined: 21 Mar 2013, 19:33

Re: Crash while starting a scene (work on different computer

Post by thearvie »

Like dknetz said, and I tried on my last post, using that lib just stops vrep from booting.

Another thing: I'm using ros fuerte, I'll try to upgrade to a newer ros version today.

coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Crash while starting a scene (work on different computer

Post by coppelia »

Hello again,

I guess it will be easier to wait for the next release (V3.1.2) to be out within 2-3 weeks. Then the problem will be hopefully fixed.
Sorry about the trouble.

Cheers

Post Reply