[SOLVED] Crashing with Multiple Simulations Open

Report crashes, strange behaviour, or apparent bugs
Post Reply
Matt
Posts: 10
Joined: 02 Feb 2016, 21:33

[SOLVED] Crashing with Multiple Simulations Open

Post by Matt » 09 Jun 2016, 16:13

Hi there,

I'm running Linux 14.04.4 LTS, and V-REP 64 bit. Lately I've been running multiple V-REP instances, and I've had a problem where V-REP would randomly crash after a certain period of time, and throw the error:
(vrep:22731): Gtk-WARNING **: Error loading theme icon 'dialog-error' for stock: Error opening file: Too many open files
File exception error: std::exception
When one simulation was launched, there would be no error -it was only after a second one was opened. But the error still made no sense, as even when the simulation was in a stopped state (where no files should be opened), one of the simulations would still crash after a time. From what I can tell, a similar problem was mentioned here: viewtopic.php?f=5&t=3647, and the suggestion was to check system settings. This can be checked in a bash terminal with

Code: Select all

$ ulimit -n
For us, the number of files was set to be 1024, which is a reasonable amount. It turns out that (I'm not sure about OP), the issue was related to opening up multiple V-REP instances, and the fact that V-REP tries to start up multiple remote API servers all on the same port. I knew I wasn't initializing any remote API on startup, but it took a while to realize that the program was doing this automatically on startup, e.g.:
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
When a single instance of VREP runs, it connects to port 19997 no problem - however, the second instance is unable to connect, and it appears to keep trying until it succeed. These repeated attempts lead to a number of sockets trying to be opened, and thus attaching a number of file descriptors to the process.
$ ls -l /proc/3679/fd
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 280 -> socket:[2465536]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 281 -> socket:[2465537]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 282 -> socket:[2465538]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 283 -> socket:[2472409]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 284 -> socket:[2472410]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 285 -> socket:[2474097]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 286 -> socket:[2465544]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 287 -> socket:[2465545]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 288 -> socket:[2472448]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 289 -> socket:[2472449]
lrwx------ 1 mveres mlrg 64 Jun 9 10:28 29 -> socket:[2457247]
lrwx------ 1 mveres mlrg 64 Jun 9 10:44 290 -> socket:[2469277]
For those who run into the same problem, the solution is actually a really simple fix. You can disable this behaviour by opening V-REP/remoteApiConnections.txt, and commenting the lines:
//portIndex1_port = 19997
//portIndex1_debug = false
//portIndex1_syncSimTrigger = true
V-REP seems to behave properly after that, with no more crashes.

Matt

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

Re: [SOLVED] Crashing with Multiple Simulations Open

Post by coppelia » 09 Jun 2016, 16:24

Thanks for the precision Matt! Yes, I forgot to mention about that file in your other post.

Cheers

Post Reply