soundplay_node.py crashes after a certain period
Hello
I have a ros node which successfully executes the following lines of (pseudo)code:
sc.playWaveFromPkg("sound_play", "/home/jan/synthts_et-master/synthts_et/out_tnu.wav");
sleep(seconds + 1);
sc.stopAll();
I get the desired sound for approximately 300 iterations or so (which corresponds to hours of audio). However, after that my soundplay_node.py
crashes with the following error message:
[ERROR] [1524690159.260685]: Exception in callback: Environment configuration is invalid: cannot locate rospack ([Errno 24] Too many open files)
[INFO] [1524690159.261880]: Traceback (most recent call last):
File "/opt/ros/kinetic/lib/sound_play/soundplay_node.py", line 273, in callback
sound = self.select_sound(data)
File "/opt/ros/kinetic/lib/sound_play/soundplay_node.py", line 208, in select_sound
absfilename = os.path.join(roslib.packages.get_pkg_dir(data.arg2), data.arg)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/packages.py", line 188, in get_pkg_dir
raise InvalidROSPkgException("Environment configuration is invalid: cannot locate rospack (%s)"%e)
InvalidROSPkgException: Environment configuration is invalid: cannot locate rospack ([Errno 24] Too many open files)
The only nodes running are the soundplay_node.py
and the node publishing the .wav
file. I have contemplated on this issue and my own thoughts have halted to a standstill. Maybe you have some insight into this. Thank you!
This is most likely a file handle leak in either
soundplay_node.py
or some of the code it uses.I'd recommend you post this over at ros-drivers/audio_common/issues.
Btw: may I suggest a topic title change? The current title suggests that already after a (short) while the node crashes, while in reality:
Hello! Thank you for the responses. I followed your suggestion and edited the topic title. I will also post this at ros-drivers/audio_common/issues.