tevent_loop_wait() never finishes

Simo idra at samba.org
Mon Jun 24 07:56:31 MDT 2013

On 06/24/2013 09:48 AM, Pavel Březina wrote:
> On 06/24/2013 03:39 PM, Simo wrote:
>> On 06/24/2013 08:52 AM, Pavel Březina wrote:
>>> Hi,
>>> I've run across a problem where I don't have any custom event handlers
>>> registered with tevent, but the program gets stuck in 
>>> tevent_loop_wait().
>>> When I print out the event context, I see there is still one fd
>>> handler registered. It is sig_pipe_handler() that is created
>>> internally by tevent at tevent_signal.c:254.
>>> What is the purpose of this signal?
>> It is used to process signal events outside of the actual signal handler
>> where the amount of processing and systems call that can be used is
>> limited.
>> When a signal comes tevent simply writes to the pipe so that as soon as
>> control is returned to the event loop it sees that a read is possible on
>> the fd and calls the correct code to deal with the reported signal.
> If I understand this correctly, the sig_pipe_handler is useful only 
> when there exist any signal handler. So when there is no signal 
> handler, the sig_pipe_handler should be removed so it does not 
> prevents tevent_loop_wait() to finish, right?

Currently it is not like that, but yeah I believe the original design of 
tevent was to get out if no events were available. Can you open a bug in 
bugzilla about this ?


More information about the samba-technical mailing list