Post by sven falempinPost by sven falempinHello,
I add a bug related to multithread, but it was just some noise.
Just to be even more sure i use evutil_make_socket_nonblocking now.
I am now at like 12hours or more before reproducing the problem, so next
time i will probably focus on lowering the backlog number.
(gdb) bt
#0 0x00000000004acf7c in __sys_accept ()
#1 0x0000000000492ca0 in accept ()
#2 0x00000000004299cb in listener_read_cb (fd=7, what=<optimized out>,
p=<optimized out>) at listener.c:396
#3 0x0000000000427d6e in event_process_active_single_queue
(activeq=0x800867050, base=<optimized out>) at event.c:1350
#4 event_process_active (base=<optimized out>) at event.c:1420
#5 event_base_loop (base=0x800868300, flags=<optimized out>) at
event.c:1621
#6 0x000000000041b0ef in main (argc=10, argv=0x7fffffffdb88) at
main.cc:261
Post by sven falempinMaybe adding the error callback would help ?
I think that's a pretty good idea.
100% kernel load on accept() is often symptomatic of ENFILE or EMFILE
, and the typical solution -- after raising resource limits as
appropriate, and making sure you don't have a socket leak -- is to do
something in response other than just closing the socket -- like
closing the listener for a while, or until some sockets have closed,
or disabling it, or such.
--
Nick
***********************************************************************
unsubscribe libevent-users in the body.
I guess it was a thread that was closing the fd meanwhile the accept (after
poll, because i have no errors).
Because it tooks time i did refactoring , and it s only after I refactor
something thats this potential bad close became obvious. At the moment i am
still unsure what is happening :-(
But i wonder about this valgrind errors (i have symbols):
==11532== Conditional jump or move depends on uninitialised value(s)
==11532== at 0x4E1757: stpcpy (in
/home/myself/jsonserver/bin/jsonserver-debug)
==11532== by 0x4C8CE1: tzset_basic (in
/home/myself/jsonserver/bin/jsonserver-debug)
==11532== by 0x1C: ???
==11532== by 0x38353A3130203930: ???
==11532== by 0x3331303220333439: ???
==11532== by 0x42A151: event_changelist_add (evmap.c:656)
==11532== by 0x62072439DF6F8FDB: ???
==11532== by 0x77393F: ??? (in /home/zvn/jsonserver/bin/jsondb-debug)
==11532== by 0x176F: ???
==11532== by 0x7FF00053F: ???
==11532== by 0x7FF000B1F: ???
==11532== by 0x7FF000AB7: ???
==11532== Uninitialised value was created by a stack allocation
==11532== at 0x4C92F0: asctime_r (in
/home/myself/jsonserver/bin/jsonserver-debug)
and another less important here (when calling vsyslog), i blame arglist
void log(int lvl,const char* d,...) {
va_list arglist;
if (d && *d) {
va_start( arglist, d );
if (gconf.debug || gconf.verbose || lvl != LOG_DEBUG) { //drop log
DEBUG if not -d
vsyslog(lvl, d, arglist);
}
va_end(arglist);
}
}
i am talking about this one because it also mention
asctime_r
(i check all my <stack> allocation )
I really have no clue for now.
evmap.c 656 is change = event_changelist_get_or_construct(changelist, fd,
old, fdinfo); in my 2.0.21 stable.
--
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail
/\