Are nested event loops expected in the source3 lsasd?

Andrew Bartlett abartlet at samba.org
Tue Apr 29 17:44:55 MDT 2014


While looking into a winbindd deadlock, I got this backtrace on one of
the lsasd processes.  Attached is the patch series in case this is hard
to re-produce.  I ran 

make test TESTS=samba3.blackbox.smbclient_auth.plain

This appears to be a genuine nested even loop, not a new context.

warning: no loadable sections found in added symbol-file system-supplied
DSO at 0x7fff675fe000
0x00002b592e135710 in __poll_nocancel ()
at ../sysdeps/unix/syscall-template.S:81
81	../sysdeps/unix/syscall-template.S: No such file or directory.
#0  0x00002b592e135710 in __poll_nocancel ()
at ../sysdeps/unix/syscall-template.S:81
No locals.
#1  0x00002b592c7ff1e5 in s3_event_loop_once (ev=0x2b592a1ebbc0,
location=<optimized out>) at ../source3/lib/events.c:314
        state = 0x2b592a2185a0
        timeout = 2147483647
        num_pfds = 11
        ret = <optimized out>
        poll_errno = <optimized out>
#2  0x00002b592b551ec5 in _tevent_loop_once (ev=ev at entry=0x2b592a1ebbc0,
location=location at entry=0x2b592a181380
"../source3/rpc_server/lsasd.c:345") at ../lib/tevent/tevent.c:530
        ret = <optimized out>
        nesting_stack_ptr = 0x0
#3  0x00002b592a17d83d in lsasd_children_main (ev_ctx=0x2b592a1ebbc0,
msg_ctx=0x2b592a1ebcb0, pf=0x2b592a383150, child_id=<optimized out>,
listen_fd_size=<optimized out>, listen_fds=0x2b592a214350,
private_data=0x0) at ../source3/rpc_server/lsasd.c:345
        data = 0x2b592a237b40
        ret = <optimized out>
        child_id = <optimized out>
        private_data = 0x0
        listen_fd_size = <optimized out>
        pf = 0x2b592a383150
        msg_ctx = 0x2b592a1ebcb0
        listen_fds = 0x2b592a214350
        ev_ctx = 0x2b592a1ebbc0
#4  0x00002b592c800183 in prefork_add_children
(ev_ctx=ev_ctx at entry=0x2b592a1ebbc0,
msg_ctx=msg_ctx at entry=0x2b592a1ebcb0, pfp=pfp at entry=0x2b592a2223b0,
num_children=5) at ../source3/lib/server_prefork.c:206
        pid = <optimized out>
        now = <optimized out>
        ret = <optimized out>
        i = 8
        j = 3
        __FUNCTION__ = "prefork_add_children"
#5  0x00002b592c800c7f in pfh_manage_pool (ev_ctx=0x2b592a1ebbc0,
msg_ctx=0x2b592a1ebcb0, cfg=0x2b592a386040 <pf_lsasd_cfg>,
pool=0x2b592a2223b0) at ../source3/lib/server_prefork_util.c:87
        now = 1398814262
        total = 5
        avail = <optimized out>
        ret = <optimized out>
        n = <optimized out>
        msg = false
        __FUNCTION__ = "pfh_manage_pool"
#6  0x00002b592c7f1c73 in messaging_dispatch_rec
(msg_ctx=0x2b592a1ebcb0, rec=rec at entry=0x7fff675f84d0)
at ../source3/lib/messages.c:568
        cb = <optimized out>
        next = 0x2b592a216fa0
        i = <optimized out>
#7  0x00002b592c7f20a5 in messaging_dgm_recv (ctx=<optimized out>,
msg=0x2b592a1ec198 "h\352?.Y+", msg_len=<optimized out>,
private_data=<optimized out>) at ../source3/lib/messages_dgm.c:356
        dgm_ctx = <optimized out>
        hdr = 0x2b592a1ec198
        rec = {msg_version = 2, msg_type = MSG_PREFORK_CHILD_EVENT, dest
= {pid = 4046, task_id = 0, vnn = 4294967295, unique_id =
2904835721630610611}, src = {pid = 4055, task_id = 0, vnn = 4294967295,
unique_id = 2904835721630610611}, buf = {data = 0x2b592a1ec1d0 "tion
\"dns server\"\n\n\tkernel oplocks = no\n\tkernel change notify = no\n\n
\tsyslog = no\n\tprinting = bsd\n\tprintcap name = /dev/null\n\n
\twinbindd socket directory = /data/samba/git/samba/st/s3dc/winbindd\n
\tnmbd:s"..., length = 0}}
        __FUNCTION__ = "messaging_dgm_recv"
        __func__ = "messaging_dgm_recv"
#8  0x00002b592c7fefd1 in run_events_poll (ev=0x2b592a1ebbc0,
pollrtn=<optimized out>, pfds=0x2b592a215090, num_pfds=3)
at ../source3/lib/events.c:257
        pfd = <optimized out>
        flags = <optimized out>
        state = <optimized out>
        pollfd_idx = 0x2b592a214ff0
        fde = 0x2b592a1efab0
        pollrtn = <optimized out>
        num_pfds = 3
        pfds = 0x2b592a215090
        ev = 0x2b592a1ebbc0
#9  0x00002b592c7ff21f in s3_event_loop_once (ev=0x2b592a1ebbc0,
location=<optimized out>) at ../source3/lib/events.c:326
        state = 0x2b592a2185a0
        timeout = 8991
        num_pfds = 3
        ret = 1
        poll_errno = 2
#10 0x00002b592b551ec5 in _tevent_loop_once (ev=ev at entry=0x2b592a1ebbc0,
location=location at entry=0x2b592a181aa8
"../source3/rpc_server/lsasd.c:950") at ../lib/tevent/tevent.c:530
        ret = <optimized out>
        nesting_stack_ptr = 0x0
#11 0x00002b592b5520fb in tevent_common_loop_wait (ev=0x2b592a1ebbc0,
location=0x2b592a181aa8 "../source3/rpc_server/lsasd.c:950")
at ../lib/tevent/tevent.c:634
        ret = <optimized out>
#12 0x00002b592a17ea5a in start_lsasd
(ev_ctx=ev_ctx at entry=0x2b592a1ebbc0,
msg_ctx=msg_ctx at entry=0x2b592a1ebcb0)
at ../source3/rpc_server/lsasd.c:950
        status = {v = 0}
        listen_fd = {12, 32, 33, 34, 35, 36, 37, 38, 706673536, 11097,
724484754, 11097, 724484740, 11097, 706222997, 11097, 706816000, 11097,
37, 0, 706816016, 11097, 16, 48, 1, 32767, 1734313776, 32767, 0, 0,
724484754, 11097, 107, 0, 706642384, 11097, 706673536, 11097, 114, 0,
706677331, 11097, 719349102, 11097, 1734313856, 32767, 1734313872,
32767, 1, 0, 772629631, 11097, 1, 0, 746604644, 11097, 706870656, 11097,
706677328, 11097, 706222997, 11097, 724484707, 11097}
        listen_fd_size = 8
        pid = <optimized out>
        rc = <optimized out>
        ok = <optimized out>
        __FUNCTION__ = "start_lsasd"
#13 0x00002b592a17bf83 in main (argc=<optimized out>, argv=<optimized
out>) at ../source3/smbd/server.c:1536
        is_daemon = <optimized out>
        interactive = <optimized out>
        Fork = false
        no_process_group = <optimized out>
        log_stdout = <optimized out>
        ports = 0x0
        profile_level = 0x0
        opt = <optimized out>
        pc = <optimized out>
        print_build_options = <optimized out>
        long_options = {{longName = 0x0, shortName = 0 '\000', argInfo =
4, arg = 0x2b592de4e400 <poptHelpOptions>, val = 0, descrip =
0x2b592a182630 "Help options:", argDescrip = 0x0}, {longName =
0x2b592a18263e "daemon", shortName = 68 'D', argInfo = 0, arg = 0x0, val
= 1000, descrip = 0x2b592a182645 "Become a daemon (default)", argDescrip
= 0x0}, {longName = 0x2b592a18265f "interactive", shortName = 105 'i',
argInfo = 0, arg = 0x0, val = 1001, descrip = 0x2b592a1831d8 "Run
interactive (not a daemon)", argDescrip = 0x0}, {longName =
0x2b592a18266b "foreground", shortName = 70 'F', argInfo = 0, arg = 0x0,
val = 1002, descrip = 0x2b592a1831f8 "Run daemon in foreground (for
daemontools, etc.)", argDescrip = 0x0}, {longName = 0x2b592a182676
"no-process-group", shortName = 0 '\000', argInfo = 0, arg = 0x0, val =
1003, descrip = 0x2b592a183230 "Don't create a new process group",
argDescrip = 0x0}, {longName = 0x2b592a182687 "log-stdout", shortName =
83 'S', argInfo = 0, arg = 0x0, val = 1004, descrip = 0x2b592a182692
"Log to stdout", argDescrip = 0x0}, {longName = 0x2b592a1826a0
"build-options", shortName = 98 'b', argInfo = 0, arg = 0x0, val = 98,
descrip = 0x2b592a1826ae "Print build options", argDescrip = 0x0},
{longName = 0x2b592a1826c2 "port", shortName = 112 'p', argInfo = 1, arg
= 0x7fff675f8870, val = 0, descrip = 0x2b592a1826c7 "Listen on the
specified ports", argDescrip = 0x0}, {longName = 0x2b592a1826e5
"profiling-level", shortName = 80 'P', argInfo = 1, arg =
0x7fff675f8880, val = 0, descrip = 0x2b592a1826f5 "Set profiling level",
argDescrip = 0x2b592a182709 "PROFILE_LEVEL"}, {longName = 0x0, shortName
= 0 '\000', argInfo = 4, arg = 0x2b592c59a680 <popt_common_samba>, val =
0, descrip = 0x2b592a182717 "Common samba options:", argDescrip = 0x0},
{longName = 0x0, shortName = 0 '\000', argInfo = 0, arg = 0x0, val = 0,
descrip = 0x0, argDescrip = 0x0}}
        parent = 0x2b592a1efb80
        frame = 0x2b592a1e51b0
        status = <optimized out>
        ev_ctx = 0x2b592a1ebbc0
        msg_ctx = 0x2b592a1ebcb0
        server_id = {pid = 4027, task_id = 0, vnn = 4294967295,
unique_id = 2904835721630610611}
        se = <optimized out>
        np_dir = 0x2b592a211a60
"/data/samba/git/samba/st/s3dc/ncalrpc/np"
        smbd_shim_fns = {cancel_pending_lock_requests_by_fid =
0x2b592b12c7a0 <smbd_cancel_pending_lock_requests_by_fid>,
send_stat_cache_delete_message = 0x2b592b1326c0
<smbd_send_stat_cache_delete_message>, change_to_root_user =
0x2b592b11a450 <smbd_change_to_root_user>,
become_authenticated_pipe_user = 0x2b592b11a4e0
<smbd_become_authenticated_pipe_user>, unbecome_authenticated_pipe_user
= 0x2b592b11a590 <smbd_unbecome_authenticated_pipe_user>,
contend_level2_oplocks_begin = 0x2b592b17bec0
<smbd_contend_level2_oplocks_begin>, contend_level2_oplocks_end =
0x2b592b17c090 <smbd_contend_level2_oplocks_end>, become_root =
0x2b592b11a5a0 <smbd_become_root>, unbecome_root = 0x2b592b11a650
<smbd_unbecome_root>, exit_server = 0x2b592b174aa0 <smbd_exit_server>,
exit_server_cleanly = 0x2b592b174ac0 <smbd_exit_server_cleanly>}
        __FUNCTION__ = "main"

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ad-dc-winbindd-pre.patch
Type: text/x-patch
Size: 23924 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140430/e91d7d7c/attachment.bin>


More information about the samba-technical mailing list