## Shared Memory problem when using 'simxCallScriptFunction'

Report crashes, strange behaviour, or apparent bugs
sjames
Posts: 23
Joined: 23 Nov 2016, 18:53

### Shared Memory problem when using 'simxCallScriptFunction'

Hi,

I believe I have found a bug, but if I have missed something, then I apologise in advanced.

The issue is when calling 'simxCallScriptFunction' from python when using shared memory, and the function itself does a lot of computation.

The bug can be reproduced by simply having a script function like so:

Code: Select all

test=function(inInts,inFloats,inStrings,inBuffer)
for i=1,99999,1 do
print(i)
end
return {1},{},{},''
end

and then calling this from Python using 'simxCallScriptFunction'. The function on the Python side will hang; specifically when calling 'c_CallScriptFunction(...)'.

I have made sure that my port number <0, and have set a high negative timeout (e.g. -50000).

Note, that when I use port communication, it works fine. Perhaps there is timeout happening with shared memory?

Also of note, when I set 'doNotReconnectOnceDisconnected=False' when connected via shared memory, I get the following after the loop in the script finishes:

Connect (0): Failed to open the shared memory "/LocalVREP_REMOTE_API00001"

Thanks!

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: Shared Memory problem when using 'simxCallScriptFunction'

Hello James,

indeed, there is something fishy...
Thanks for pointing this out.

Cheers

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: Shared Memory problem when using 'simxCallScriptFunction'

can you tell me which platform you are running on?

Cheers

sjames
Posts: 23
Joined: 23 Nov 2016, 18:53

### Re: Shared Memory problem when using 'simxCallScriptFunction'

Hi,

I am running on Linux (Ubuntu 18.04).
Anything I can help with?

Also, on a related note, is it possible to support multiple instances when using shared memory? I.e. is it possible to allocate a portion of the memory, so that another instance can have another portion?

Cheers

coppelia