[zeromq-dev] fopen / errno / gdb using epgm

Emmanuel TAUREL taurel at esrf.fr
Wed Nov 28 16:58:34 CET 2012

Hello all,

I am using ZMQ (3.2.1-rc2) PUB/SUB and I am experimenting the epgm/pgm 
I now have a running application (both sides). That's cool but I noticed 
that I am not able to run my publisher under control of gdb! The bind 
call fails.
I study a little bit what happens and found out that my problem came 
from the pgm_rand_create() function in file rand.c (openpgm related file).

This function uses fopen() call and loop around it while errno is EINTR. 
My pb was that under gdb control, errno at that point was EINTR (don't 
know why) and the function opened /dev/urandom so many times that 
finally it aborts due to error "Too many opened files".

Setting errno to 0 before calling fopen solved the pb.

Is there someone aware of this issue?

A short look at 3.2.2 shows that the code in this rand.c  file is the same.

Thank's for your help


More information about the zeromq-dev mailing list