EPOLL_CTL_ADD failed (Bad file descriptor) in TP5

Frank Gruman fgatwork at verizon.net
Fri Jun 15 01:13:36 GMT 2007


Tridge,

On Wed, 2007-06-13 at 13:37 +1000, tridge at samba.org wrote:

> Frank,
> 
>  > Yes - this happens with just about every network operation (login,
>  > folder access, file access, etc).  
>  > 
>  > 
>  >         toybox:~ # smbd -i
>  >         smbd version 4.0.0tp5-SVN-build-23403 started.
>  >         Copyright Andrew Tridgell and the Samba Team 1992-2007
>  >         smbd: using 'standard' process model
>  >         EPOLL_CTL_ADD failed (Bad file descriptor) - falling back to
>  >         select()
> 
> Does this happen with smbclient or smbtorture?


With both.  I have add both logs.

The commands I used were:
  smbtorture -Uadministrator //localhost/test ALL
  smbclient //localhost/test -Uadministrator



> 
> What we really need is a backtrace showing the code path that causes
> this. 

Attached...

I am running kernel version 2.6.22-rc4-2-default with openSUSE 10.3
Alpha 4(+)
gcc (GCC) 4.1.3 20070521 (prerelease) (SUSE Linux)

Regards,
Frank
-------------- next part --------------
toybox:~/samba4/source # gdb --args smbd -i
GNU gdb 6.6.50.20070608-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) b events_standard.c:162
Breakpoint 1 at 0xb05564: file lib/events/events_standard.c, line 162.
(gdb) set follow-fork-mode child
(gdb) r
Starting program: /usr/sbin/smbd -i
[Thread debugging using libthread_db enabled]
[New Thread 0x2ad758167700 (LWP 21864)]
smbd version 4.0.0tp6-SVN-build-23493 started.
Copyright Andrew Tridgell and the Samba Team 1992-2007
smbd: using 'standard' process model
[Switching to process 21877]

Breakpoint 1, epoll_add_event (std_ev=0x1031b40, fde=0x10325e0) at lib/events/events_standard.c:162
162                     epoll_fallback_to_select(std_ev, "EPOLL_CTL_ADD failed");
(gdb)
(gdb) info program
        Using the running image of child process 21877.
Program stopped at 0xb05564.
It stopped at breakpoint 1.
(gdb) bt full
#0  epoll_add_event (std_ev=0x1031b40, fde=0x10325e0) at lib/events/events_standard.c:162
        event = {events = 25, data = {ptr = 0x10325e0, fd = 16983520, u32 = 16983520, u64 = 16983520}}
#1  0x0000000000b054b7 in epoll_check_reopen (std_ev=0x1031b40) at lib/events/events_standard.c:137
        fde = (struct fd_event *) 0x10325e0
        __FUNCTION__ = "epoll_check_reopen"
#2  0x0000000000b05c33 in std_event_fd_destructor (fde=0x10325e0) at lib/events/events_standard.c:382
        ev = (struct event_context *) 0x1031ab0
        std_ev = (struct std_event_context *) 0x1031b40
#3  0x0000000000c29ce5 in _talloc_free (ptr=0x10325e0) at lib/talloc/talloc.c:373
        d = (talloc_destructor_t) 0xb05bfa <std_event_fd_destructor>
        tc = (struct talloc_chunk *) 0x1032590
#4  0x0000000000c29ec4 in _talloc_free (ptr=0x1032550) at lib/talloc/talloc.c:404
        child = (void *) 0x10325e0
        new_parent = (const void *) 0x0
        tc = (struct talloc_chunk *) 0x1032500
#5  0x0000000000c2a695 in talloc_free (ptr=0x1032550) at lib/talloc/talloc.c:750
No locals.
#6  0x0000000000c0c8b1 in standard_accept_connection (ev=0x1031ab0, sock=0x1032550, new_conn=0x4c38de <stream_new_connection>,
    private=0x10324c0) at smbd/process_standard.c:103
        status = {v = 0}
        sock2 = (struct socket_context *) 0x1032840
        pid = 21877
        ev2 = (struct event_context *) 0x10328d0
        c = (struct socket_address *) 0xc339a6
        s = (struct socket_address *) 0x10324c0
        __FUNCTION__ = "standard_accept_connection"
#7  0x00000000004c3baf in stream_accept_handler (ev=0x1031ab0, fde=0x10325e0, flags=1, private=0x10324c0)
    at smbd/service_stream.c:222
        stream_socket = (struct stream_socket *) 0x10324c0
#8  0x0000000000b05b07 in epoll_event_loop (std_ev=0x1031b40, tvalp=0x7fff54639440) at lib/events/events_standard.c:316
        fde = (struct fd_event *) 0x10325e0
        flags = 1
        ret = 1
        i = 0
        events = {{events = 1, data = {ptr = 0x10325e0, fd = 16983520, u32 = 16983520, u64 = 16983520}}, {events = 0, data = {
      ptr = 0x1e, fd = 30, u32 = 30, u64 = 30}}, {events = 0, data = {ptr = 0xd211d500000000, fd = 0, u32 = 0,
      u64 = 59129351634944000}}, {events = 0, data = {ptr = 0x1031ab0, fd = 16980656, u32 = 16980656, u64 = 16980656}}, {
    events = 1415812144, data = {ptr = 0x1031af000007fff, fd = 32767, u32 = 32767, u64 = 72931637062565887}}, {events = 0,
    data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x1e00000000, fd = 0, u32 = 0,
      u64 = 128849018880}}, {events = 0, data = {ptr = 0xb05423, fd = 11555875, u32 = 11555875, u64 = 11555875}}}
        destruction_count = 1
        timeout = 30000
#9  0x0000000000b06366 in std_event_loop_once (ev=0x1031ab0) at lib/events/events_standard.c:563
        std_ev = (struct std_event_context *) 0x1031b40
        tval = {tv_sec = 30, tv_usec = 0}
#10 0x0000000000b063c2 in std_event_loop_wait (ev=0x1031ab0) at lib/events/events_standard.c:580
        std_ev = (struct std_event_context *) 0x1031b40
#11 0x0000000000b05295 in event_loop_wait (ev=0x1031ab0) at lib/events/events.c:303
No locals.
#12 0x0000000000c0ca9d in standard_new_task (ev=0x1031880, new_task=0x4c3f8e <task_server_callback>, private=0x1031a40)
    at smbd/process_standard.c:187
        pid = 21867
        ev2 = (struct event_context *) 0x1031ab0
        __FUNCTION__ = "standard_new_task"
#13 0x00000000004c40c1 in task_server_startup (event_ctx=0x1031880, model_ops=0x102efc0, task_init=0x4b6c57 <smbsrv_task_init>)
    at smbd/service_task.c:90
        state = (struct task_state *) 0x1031a40
#14 0x00000000004b6d34 in smbsrv_init (event_context=0x1031880, model_ops=0x102efc0) at smb_server/smb_server.c:235
No locals.
#15 0x00000000004a394a in server_service_init (name=0x102a590 "smb", event_ctx=0x1031880, model_ops=0x102efc0)
    at smbd/service.c:63
        srv = (struct registered_server *) 0x102f730
#16 0x00000000004a3a63 in server_service_startup (event_ctx=0x1031880, model=0xc2bd31 "standard", server_services=0x102a9d0)
    at smbd/service.c:93
        status = {v = 0}
        i = 0
        model_ops = (const struct model_ops *) 0x102efc0
        __FUNCTION__ = "server_service_startup"
#17 0x00000000004a339b in binary_smbd_main (binary_name=0xc2bf17 "smbd", argc=2, argv=0x7fff54639998) at smbd/server.c:312
        interactive = true
        opt = -1
        pc = (poptContext) 0x1029040
        static_init = {0x4a4c76 <server_service_wrepl_init>, 0x4ac87e <server_service_kdc_init>,
  0x4af2c0 <server_service_ldap_init>, 0x4b3174 <server_service_nbtd_init>, 0x4b6d36 <server_service_smb_init>,
  0x4b75c4 <server_service_web_init>, 0x4baf40 <server_service_drepl_init>, 0x4bd67f <server_service_winbind_init>,
  0x641440 <server_service_rpc_init>, 0x89f701 <server_service_auth_init>, 0x4c20db <server_service_cldapd_init>, 0}
        shared_init = (init_module_fn *) 0x0
        event_ctx = (struct event_context *) 0x1031880
        status = {v = 1}
        model = 0xc2bd31 "standard"
        max_runtime = 0
        long_options = {{longName = 0x0, shortName = 0 '\0', argInfo = 4, arg = 0x101c060, val = 0,
    descrip = 0xc2bd3a "Help options:", argDescrip = 0x0}, {longName = 0xc2bd48 "interactive", shortName = 105 'i', argInfo = 0,
    arg = 0x0, val = 1000, descrip = 0xc2bd58 "Run interactive (not a daemon)", argDescrip = 0x0}, {longName = 0xc2bd77 "model",
    shortName = 77 'M', argInfo = 1, arg = 0x0, val = 1001, descrip = 0xc2bd7d "Select process model",
    argDescrip = 0xc2bd92 "MODEL"}, {longName = 0xc2bd98 "maximum-runtime", shortName = 0 '\0', argInfo = 2,
    arg = 0x7fff546397cc, val = 0, descrip = 0xc2bda8 "set maximum runtime of the server process, till autotermination",
    argDescrip = 0xc2bde8 "seconds"}, {longName = 0x0, shortName = 0 '\0', argInfo = 4, arg = 0x101bbe0, val = 0,
    descrip = 0xc2bdf0 "Common samba options:", argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\0', argInfo = 4,
    arg = 0x101bda0, val = 0, descrip = 0xc2bdf0 "Common samba options:", argDescrip = 0x0}, {longName = 0x0,
    shortName = 0 '\0', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}}
        __FUNCTION__ = "binary_smbd_main"
#18 0x00000000004a3449 in main (argc=2, argv=0x7fff54639998) at smbd/server.c:331
No locals.
(gdb)  
-------------- next part --------------
toybox:~/samba4/source # gdb --args smbd -i
GNU gdb 6.6.50.20070608-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) break
No default breakpoint address now.
(gdb) break events_standard.c:162
Breakpoint 1 at 0xb05564: file lib/events/events_standard.c, line 162.
(gdb) set follow-fork-mode child
(gdb) r
Starting program: /usr/sbin/smbd -i
[Thread debugging using libthread_db enabled]
[New Thread 0x2ab79dbd1700 (LWP 21983)]
smbd version 4.0.0tp6-SVN-build-23493 started.
Copyright Andrew Tridgell and the Samba Team 1992-2007
smbd: using 'standard' process model
[Switching to process 21994]

Breakpoint 1, epoll_add_event (std_ev=0x1031b40, fde=0x10325e0) at lib/events/events_standard.c:162
162                     epoll_fallback_to_select(std_ev, "EPOLL_CTL_ADD failed");
(gdb) info program
        Using the running image of child process 21994.
Program stopped at 0xb05564.
It stopped at breakpoint 1.
(gdb) bt full
#0  epoll_add_event (std_ev=0x1031b40, fde=0x10325e0) at lib/events/events_standard.c:162
        event = {events = 25, data = {ptr = 0x10325e0, fd = 16983520, u32 = 16983520, u64 = 16983520}}
#1  0x0000000000b054b7 in epoll_check_reopen (std_ev=0x1031b40) at lib/events/events_standard.c:137
        fde = (struct fd_event *) 0x10325e0
        __FUNCTION__ = "epoll_check_reopen"
#2  0x0000000000b05c33 in std_event_fd_destructor (fde=0x10325e0) at lib/events/events_standard.c:382
        ev = (struct event_context *) 0x1031ab0
        std_ev = (struct std_event_context *) 0x1031b40
#3  0x0000000000c29ce5 in _talloc_free (ptr=0x10325e0) at lib/talloc/talloc.c:373
        d = (talloc_destructor_t) 0xb05bfa <std_event_fd_destructor>
        tc = (struct talloc_chunk *) 0x1032590
#4  0x0000000000c29ec4 in _talloc_free (ptr=0x1032550) at lib/talloc/talloc.c:404
        child = (void *) 0x10325e0
        new_parent = (const void *) 0x0
        tc = (struct talloc_chunk *) 0x1032500
#5  0x0000000000c2a695 in talloc_free (ptr=0x1032550) at lib/talloc/talloc.c:750
No locals.
#6  0x0000000000c0c8b1 in standard_accept_connection (ev=0x1031ab0, sock=0x1032550, new_conn=0x4c38de <stream_new_connection>,
    private=0x10324c0) at smbd/process_standard.c:103
        status = {v = 0}
        sock2 = (struct socket_context *) 0x1032840
        pid = 21994
        ev2 = (struct event_context *) 0x10328d0
        c = (struct socket_address *) 0xc339a6
        s = (struct socket_address *) 0x10324c0
        __FUNCTION__ = "standard_accept_connection"
#7  0x00000000004c3baf in stream_accept_handler (ev=0x1031ab0, fde=0x10325e0, flags=1, private=0x10324c0)
    at smbd/service_stream.c:222
        stream_socket = (struct stream_socket *) 0x10324c0
#8  0x0000000000b05b07 in epoll_event_loop (std_ev=0x1031b40, tvalp=0x7fff0ebcf9d0) at lib/events/events_standard.c:316
        fde = (struct fd_event *) 0x10325e0
        flags = 1
        ret = 1
        i = 0
        events = {{events = 1, data = {ptr = 0x10325e0, fd = 16983520, u32 = 16983520, u64 = 16983520}}, {events = 0, data = {
      ptr = 0x1e, fd = 30, u32 = 30, u64 = 30}}, {events = 0, data = {ptr = 0xd211d500000000, fd = 0, u32 = 0,
      u64 = 59129351634944000}}, {events = 0, data = {ptr = 0x1031ab0, fd = 16980656, u32 = 16980656, u64 = 16980656}}, {
    events = 247265728, data = {ptr = 0x1031af000007fff, fd = 32767, u32 = 32767, u64 = 72931637062565887}}, {events = 0,
    data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x1e00000000, fd = 0, u32 = 0,
      u64 = 128849018880}}, {events = 0, data = {ptr = 0xb05423, fd = 11555875, u32 = 11555875, u64 = 11555875}}}
        destruction_count = 1
        timeout = 30000
#9  0x0000000000b06366 in std_event_loop_once (ev=0x1031ab0) at lib/events/events_standard.c:563
        std_ev = (struct std_event_context *) 0x1031b40
        tval = {tv_sec = 30, tv_usec = 0}
#10 0x0000000000b063c2 in std_event_loop_wait (ev=0x1031ab0) at lib/events/events_standard.c:580
        std_ev = (struct std_event_context *) 0x1031b40
#11 0x0000000000b05295 in event_loop_wait (ev=0x1031ab0) at lib/events/events.c:303
No locals.
#12 0x0000000000c0ca9d in standard_new_task (ev=0x1031880, new_task=0x4c3f8e <task_server_callback>, private=0x1031a40)
    at smbd/process_standard.c:187
        pid = 21984
        ev2 = (struct event_context *) 0x1031ab0
        __FUNCTION__ = "standard_new_task"
#13 0x00000000004c40c1 in task_server_startup (event_ctx=0x1031880, model_ops=0x102efc0, task_init=0x4b6c57 <smbsrv_task_init>)
    at smbd/service_task.c:90
        state = (struct task_state *) 0x1031a40
#14 0x00000000004b6d34 in smbsrv_init (event_context=0x1031880, model_ops=0x102efc0) at smb_server/smb_server.c:235
No locals.
#15 0x00000000004a394a in server_service_init (name=0x102a590 "smb", event_ctx=0x1031880, model_ops=0x102efc0)
    at smbd/service.c:63
        srv = (struct registered_server *) 0x102f730
#16 0x00000000004a3a63 in server_service_startup (event_ctx=0x1031880, model=0xc2bd31 "standard", server_services=0x102a9d0)
    at smbd/service.c:93
        status = {v = 0}
        i = 0
        model_ops = (const struct model_ops *) 0x102efc0
        __FUNCTION__ = "server_service_startup"
#17 0x00000000004a339b in binary_smbd_main (binary_name=0xc2bf17 "smbd", argc=2, argv=0x7fff0ebcff28) at smbd/server.c:312
        interactive = true
        opt = -1
        pc = (poptContext) 0x1029040
        static_init = {0x4a4c76 <server_service_wrepl_init>, 0x4ac87e <server_service_kdc_init>,
  0x4af2c0 <server_service_ldap_init>, 0x4b3174 <server_service_nbtd_init>, 0x4b6d36 <server_service_smb_init>,
  0x4b75c4 <server_service_web_init>, 0x4baf40 <server_service_drepl_init>, 0x4bd67f <server_service_winbind_init>,
  0x641440 <server_service_rpc_init>, 0x89f701 <server_service_auth_init>, 0x4c20db <server_service_cldapd_init>, 0}
        shared_init = (init_module_fn *) 0x0
        event_ctx = (struct event_context *) 0x1031880
        status = {v = 1}
        model = 0xc2bd31 "standard"
        max_runtime = 0
        long_options = {{longName = 0x0, shortName = 0 '\0', argInfo = 4, arg = 0x101c060, val = 0,
    descrip = 0xc2bd3a "Help options:", argDescrip = 0x0}, {longName = 0xc2bd48 "interactive", shortName = 105 'i', argInfo = 0,
    arg = 0x0, val = 1000, descrip = 0xc2bd58 "Run interactive (not a daemon)", argDescrip = 0x0}, {longName = 0xc2bd77 "model",
    shortName = 77 'M', argInfo = 1, arg = 0x0, val = 1001, descrip = 0xc2bd7d "Select process model",
    argDescrip = 0xc2bd92 "MODEL"}, {longName = 0xc2bd98 "maximum-runtime", shortName = 0 '\0', argInfo = 2,
    arg = 0x7fff0ebcfd5c, val = 0, descrip = 0xc2bda8 "set maximum runtime of the server process, till autotermination",
    argDescrip = 0xc2bde8 "seconds"}, {longName = 0x0, shortName = 0 '\0', argInfo = 4, arg = 0x101bbe0, val = 0,
    descrip = 0xc2bdf0 "Common samba options:", argDescrip = 0x0}, {longName = 0x0, shortName = 0 '\0', argInfo = 4,
    arg = 0x101bda0, val = 0, descrip = 0xc2bdf0 "Common samba options:", argDescrip = 0x0}, {longName = 0x0,
    shortName = 0 '\0', argInfo = 0, arg = 0x0, val = 0, descrip = 0x0, argDescrip = 0x0}}
        __FUNCTION__ = "binary_smbd_main"
#18 0x00000000004a3449 in main (argc=2, argv=0x7fff0ebcff28) at smbd/server.c:331
No locals.
(gdb)  


More information about the samba-technical mailing list