-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of memory after closing a topic listener #42
Comments
Whoa, that's a critical bug! I'm going to have trouble getting any computer time today, but I'll get into this as soon as possible. |
I was able to have this bug not to come up a couple of times randomly, further indicating a problem in concurrency. What setup do you make for debugging/profiling? |
There is a vagrant box in the repo that I try to keep reproducible. However, it was on GHC 7.8.3, so I updated it to 7.10.2 this morning for testing this issue. I'll update the vagrant setup when I can see things working. |
Okay, I had a chance to try things out and couldn't reproduce. The vagrant box is Ubuntu 14.04.1 LTS (trusty) now with GHC-7.10.2, However, that's with ROS Indigo, so perhaps it's a problem with Jade Turtle. Just to be 100% clear as to what I tried: Starting directory:
Now, with So I didn't completely recreate your setup in that I used the existing Examples and a different version of ROS. Can you give the I'll try getting Jade Turtle up and running to see if that's the issue. |
I made some tries with the
|
Thanks for helping with this! I'll have to try with jade to see if a new rostopic is doing something funny. I got jade installed, but haven't had a chance to try it yet. |
I still can't reproduce this with ROS Jade Turtle. I ran the Since one main difference between our test setups is the use of a sandbox, here's some relevant output:
You can see if any of those are obviously different from what you have, or you can paste your |
This is very odd. Looking at the output of
I'd like to try out debugging this more deeply on my end. If you were to be able to reproduce this error, how would you proceed on testing this? |
Since the bug is happening on disconnect, and it's spinning the CPU, I'd guess that something is looping trying to write to a disconnected socket. The node logic itself is rate limited, so it is most likely lower level. We send the bytes here, and, just above that, we have the loop that I'm suspicious of. We should be catching exceptions there, and cleaning up the client connection. You can see here we have some cleanup logic for each client, so we need run that when we catch an un-recoverable exception in the sending loop. So we need to pass |
Thank you for sharing your thoughts! That sounds reasonable. I will look more closely to this, even though my haskell-fu is not sufficient enough. Maybe I'll learn something, which is never a bad thing. I'm a bit confused: Why wouldn't all the exception be caught in here, or, what |
That My inability to reproduce the issue is strange, and I can't explain it yet. Perhaps I'm completely on the wrong track. A first step would be to stick |
I took the sample code from the wiki, where there is the chatter node. Executing that node successfully, I listened the topic with
rostopic echo /chatter
. After executing this for around 10 seconds, I quit the listener, but then after couple of seconds, application running the node crashed with Out of memory error. I was able to reproduce this error on my PC multiple times.top
command showed how both CPU core shoots up to 100% utility and memory allocation starts rising up quickly right after closing the listener. I tested that during the time when this behaviour has started, restarting the topic listener does not help the situation, messages are not send through, memory leak still exists.My current setup is as follow:
Ubuntu 64bit 14.04LTS
ghc 7.10.2
roshask commit e9bb32d, i.e. practically the latest
ROS Jade Turtle
compilation with -O2 flag. Package was created with
roshask create TestHask std_msgs
, and TestHask.hs was replaced with https://github.com/acowley/roshask/wiki/Tutorial:-Publisher-Subscriber#publisherThe text was updated successfully, but these errors were encountered: