Skip to content
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

"Possible Lost" blocks when using zloop under zthread #129

Closed
JustonDavies opened this issue Mar 28, 2013 · 3 comments
Closed

"Possible Lost" blocks when using zloop under zthread #129

JustonDavies opened this issue Mar 28, 2013 · 3 comments

Comments

@JustonDavies
Copy link

Summary: When utilizing a zloop from within a thread spawned by zthread valgrind claims that some blocks are possibly lost and some are still reachable. The problem only occurs if you start the zloop.

Details:
OS: Debian 6.0.7
Compiler: gcc (Debian 4.4.5-8) 4.4.5
Valgrind: valgrind-3.6.0.SVN-Debian

 CZMQ: 1.4.0
 ZMQ: 3.2.3

 Example: https://gist.github.com/JustonDavies/5265283

Notes: The example isn't exactly the most sensible thing but you should get the fundamental idea. Compile and run using the specified versions using Valgrind with --leak-check=full. If you comment Line 11 you will notice the problem can no longer be produced. Adding pollitems with zloop_poller appears to make the problem worse, but I haven't an example ready to prove it beyond reasonable doubt.

@felipecruz
Copy link
Member

can you post valgrind's output?

I wasn't able to reproduce it on OSX..

@JustonDavies
Copy link
Author

Requested output can be found here:

https://gist.github.com/JustonDavies/5295700

@felipecruz
Copy link
Member

Hi @JustonDavies . Sorry about this long delay..

I found some resources about "leaks" related with pthread_create, which is what ztread_new uses underneath. This controversy is more related with pthread_create than with czmq so I'm closing this.

http://sourceware.org/ml/glibc-bugs/2007-04/msg00036.html
http://www.linuxquestions.org/questions/programming-9/memory-leak-in-pthread-591263/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants