• Bug#1100604: PANIC: assert failed at source3/smbd/smb2_oplock.c(156): s

    From Etienne Dechamps@21:1/5 to All on Mon Mar 17 21:30:02 2025
    Some additional information:

    Excerpt from my smb.conf:

    unix extensions = no
    wide links = yes
    kernel oplocks = yes
    use sendfile = yes
    ea support = no

    Notably, `kernel oplocks = yes` is not the default, which may explain
    why only some people appear to be affected by this issue.

    Running Debian kernel 6.12.17-amd64.

    My smbd log follows. Note in particular the first 2 lines about a
    linux kernel oplock error - these lines are missing from the original
    report:

    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.955307, 0] source3/smbd/oplock_linux.c:168(linux_release_kernel_oplock)
    Mar 17 18:50:10 smbd[12006]: linux_release_kernel_oplock: Error when
    removing kernel oplock on file ., file_id = 41:4:0, gen_id = 1481.
    Error was Invalid argument
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.955749, 0] source3/smbd/smb2_oplock.c:157(release_file_oplock)
    Mar 17 18:50:10 smbd[12006]: PANIC: assert failed at source3/smbd/smb2_oplock.c(157): sconn->oplocks.level_II_open>=0
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.955888, 0] lib/util/fault.c:178(smb_panic_log)
    Mar 17 18:50:10 smbd[12006]: ===============================================================
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.955947, 0] lib/util/fault.c:179(smb_panic_log)
    Mar 17 18:50:10 smbd[12006]: INTERNAL ERROR: assert failed: sconn->oplocks.level_II_open>=0 in smbd (smbd[10.172.1.2) (client
    [10.172.1.2]) pid 12006 (4.22.0-Debian-4.22.0+dfsg-1+b1)
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.956007, 0] lib/util/fault.c:186(smb_panic_log)
    Mar 17 18:50:10 smbd[12006]: If you are running a recent Samba
    version, and if you think this problem is not yet fixed in the latest
    versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.956067, 0] lib/util/fault.c:191(smb_panic_log)
    Mar 17 18:50:10 smbd[12006]: ===============================================================
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.956118, 0] lib/util/fault.c:192(smb_panic_log)
    Mar 17 18:50:10 smbd[12006]: PANIC (pid 12006): assert failed: sconn->oplocks.level_II_open>=0 in 4.22.0-Debian-4.22.0+dfsg-1+b1
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.958600, 0] lib/util/fault.c:303(log_stack_trace)
    Mar 17 18:50:10 smbd[12006]: BACKTRACE: 26 stack frames:
    Mar 17 18:50:10 smbd[12006]: #0 /usr/lib/x86_64-linux-gnu/samba/libgenrand-private-samba.so.0(log_stack_trace+0x2d)
    [0x7f968d2285bd]
    Mar 17 18:50:10 smbd[12006]: #1 /usr/lib/x86_64-linux-gnu/samba/libgenrand-private-samba.so.0(smb_panic+0xd) [0x7f968d22885d]
    Mar 17 18:50:10 smbd[12006]: #2 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(release_file_oplock+0x122)
    [0x7f968d6caf72]
    Mar 17 18:50:10 smbd[12006]: #3 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(close_file_smb+0x6f8)
    [0x7f968d66a018]
    Mar 17 18:50:10 smbd[12006]: #4 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(+0xc33a5) [0x7f968d6a33a5]
    Mar 17 18:50:10 smbd[12006]: #5 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(smbd_smb2_request_process_close+0x1ee)
    [0x7f968d6a3d8e]
    Mar 17 18:50:10 smbd[12006]: #6 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(smbd_smb2_request_dispatch+0x1b04)
    [0x7f968d696184]
    Mar 17 18:50:10 smbd[12006]: #7 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(+0xb77f2) [0x7f968d6977f2]
    Mar 17 18:50:10 smbd[12006]: #8 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_invoke_fd_handler+0x95) [0x7f968d396815]
    Mar 17 18:50:10 smbd[12006]: #9 /lib/x86_64-linux-gnu/libtevent.so.0(+0xfa56) [0x7f968d39da56]
    Mar 17 18:50:10 smbd[12006]: #10 /lib/x86_64-linux-gnu/libtevent.so.0(+0xd48b) [0x7f968d39b48b]
    Mar 17 18:50:10 smbd[12006]: #11 /lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x93)
    [0x7f968d395953]
    Mar 17 18:50:10 smbd[12006]: #12 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f968d395c4b]
    Mar 17 18:50:10 smbd[12006]: #13 /lib/x86_64-linux-gnu/libtevent.so.0(+0xd41b) [0x7f968d39b41b]
    Mar 17 18:50:10 smbd[12006]: #14 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-private-samba.so.0(smbd_process+0x895)
    [0x7f968d6840e5]
    Mar 17 18:50:10 smbd[12006]: #15 smbd: client [10.172.1.2](+0xa1e7) [0x55adcbde31e7]
    Mar 17 18:50:10 smbd[12006]: #16 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_invoke_fd_handler+0x95) [0x7f968d396815]
    Mar 17 18:50:10 smbd[12006]: #17 /lib/x86_64-linux-gnu/libtevent.so.0(+0xfa56) [0x7f968d39da56]
    Mar 17 18:50:10 smbd[12006]: #18 /lib/x86_64-linux-gnu/libtevent.so.0(+0xd48b) [0x7f968d39b48b]
    Mar 17 18:50:10 smbd[12006]: #19 /lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x93)
    [0x7f968d395953]
    Mar 17 18:50:10 smbd[12006]: #20 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f968d395c4b]
    Mar 17 18:50:10 smbd[12006]: #21 /lib/x86_64-linux-gnu/libtevent.so.0(+0xd41b) [0x7f968d39b41b]
    Mar 17 18:50:10 smbd[12006]: #22 smbd: client
    [10.172.1.2](main+0x14a0) [0x55adcbde0330]
    Mar 17 18:50:10 smbd[12006]: #23
    /lib/x86_64-linux-gnu/libc.so.6(+0x29ca8) [0x7f968d006ca8]
    Mar 17 18:50:10 smbd[12006]: #24 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)
    [0x7f968d006d65]
    Mar 17 18:50:10 smbd[12006]: #25 smbd: client
    [10.172.1.2](_start+0x21) [0x55adcbde0e31]
    Mar 17 18:50:10 smbd[12006]: [2025/03/17 18:50:10.959320, 0] source3/lib/dumpcore.c:318(dump_core)
    Mar 17 18:50:10 smbd[12006]: coredump is handled by helper binary
    specified at /proc/sys/kernel/core_pattern
    Mar 17 18:50:10 smbd[12006]:
    Mar 17 18:50:11 systemd-coredump[12135]: Process 12006
    (smbd[10.172.1.2) of user 0 dumped core.

    Module libnss_systemd.so.2 from deb systemd-257.4-3.amd64
    Module
    libzstd.so.1 from deb libzstd-1.5.7+dfsg-1.amd64
    Module libgcc_s.so.1 from deb gcc-14-14.2.0-19.amd64
    Module libstdc++.so.6 from deb gcc-14-14.2.0-19.amd64
    Module libsystemd.so.0 from deb systemd-257.4-3.amd64
    Stack
    trace of thread 12006:
    #0 0x00007f968d07195c __pthread_kill_implementation (libc.so.6 + 0x9495c)
    #1 0x00007f968d01ccc2 __GI_raise (libc.so.6 + 0x3fcc2)
    #2 0x00007f968d0054ac __GI_abort (libc.so.6 + 0x284ac)
    #3 0x00007f968d560894 dump_core (libsmbconf.so.0 + 0x5a894)
    #4 0x00007f968d556224 smb_panic_s3 (libsmbconf.so.0 + 0x50224)
    #5 0x00007f968d22886e smb_panic (libgenrand-private-samba.so.0 + 0x286e)
    #6 0x00007f968d6caf72 release_file_oplock
    (libsmbd-base-private-samba.so.0 + 0xeaf72)
    #7 0x00007f968d66a018 close_file_smb (libsmbd-base-private-samba.so.0 +
    0x8a018)
    #8 0x00007f968d6a33a5 n/a (libsmbd-base-private-samba.so.0 + 0xc33a5)
    #9 0x00007f968d6a3d8e smbd_smb2_request_process_close (libsmbd-base-private-samba.so.0 + 0xc3d8e)
    #10 0x00007f968d696184 smbd_smb2_request_dispatch
    (libsmbd-base-private-samba.so.0 + 0xb6184)
    #11 0x00007f968d6977f2 n/a (libsmbd-base-private-samba.so.0 + 0xb77f2)
    #12 0x00007f968d396815 tevent_common_invoke_fd_handler (libtevent.so.0 +
    0x8815)
    #13 0x00007f968d39da56 n/a (libtevent.so.0 + 0xfa56)
    #14 0x00007f968d39b48b n/a (libtevent.so.0 + 0xd48b)
    #15 0x00007f968d395953 _tevent_loop_once (libtevent.so.0 + 0x7953)
    #16 0x00007f968d395c4b tevent_common_loop_wait (libtevent.so.0 + 0x7c4b)
    #17 0x00007f968d39b41b n/a (libtevent.so.0 + 0xd41b)
    #18 0x00007f968d6840e5 smbd_process (libsmbd-base-private-samba.so.0 +
    0xa40e5)
    #19 0x000055adcbde31e7 n/a (n/a + 0x0)
    ELF object
    binary architecture: AMD x86-64

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Timo van Roermund@21:1/5 to [email protected] on Mon Mar 17 22:40:01 2025
    On Mon, 17 Mar 2025 20:11:47 +0000 Etienne Dechamps
    <[email protected]> wrote:
    Some additional information:

    Excerpt from my smb.conf:

    unix extensions = no
    wide links = yes
    kernel oplocks = yes
    use sendfile = yes
    ea support = no

    Notably, `kernel oplocks = yes` is not the default, which may explain
    why only some people appear to be affected by this issue.

    My settings are rather different:

    unix extensions = No
    wide links = No
    kernel oplocks = No
    use sendfile = No
    ea support = Yes

    (Verified using: testparm --parameter-name "<setting>".)

    Cheers,

    Timo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Timo van Roermund@21:1/5 to All on Wed Mar 19 22:20:01 2025
    ------Q3K7RDVVRE7RSHB8HQTWJMI6X4IYV6
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    Thanks for looking into this.

    I'm not sure if it's relevant, but the printer that triggers the panic is using an older protocol version (SMB2_02).

    In my config, I have this line:

    server min protocol = SMB2_02

    When I increase this minimum version number, then the printer can no longer access the shares.

    Cheers,

    Timo
    ------Q3K7RDVVRE7RSHB8HQTWJMI6X4IYV6
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE html><html><body><div dir="auto">Thanks for looking into this. <br><br>I'm not sure if it's relevant, but the printer that triggers the panic is using an older protocol version (SMB2_02).<br><br>In my config, I have this line:<br><br>server min
    protocol = SMB2_02<br><br>When I increase this minimum version number, then the printer can no longer access the shares.<br><br>Cheers, <br><br>Timo</div></body></html>
    ------Q3K7RDVVRE7RSHB8HQTWJMI6X4IYV6--

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Timo van Roermund@21:1/5 to All on Thu Mar 20 07:30:01 2025
    ------SDAU6IW42PYRX72F20W5TNI3M1BNCE
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    Also, for anyone who can repro this, please at least post smb.log
    with log level 5, complete interaction between samba and the client
    up to the assertion failure.

    I'm currently traveling, with no access to my printer. Etienne, would you be able to produce such log in the coming days? Otherwise, I will look at it on my side when I'm back.

    Cheers,

    Timo
    ------SDAU6IW42PYRX72F20W5TNI3M1BNCE
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE html><html><body><div dir="auto">&gt; Also, for anyone who can repro this, please at least post smb.log<br>&gt; with log level 5, complete interaction between samba and the client<br>&gt; up to the assertion failure.<br><br>I'm currently
    traveling, with no access to my printer. Etienne, would you be able to produce such log in the coming days? Otherwise, I will look at it on my side when I'm back.<br><br>Cheers, <br><br>Timo</div></body></html>
    ------SDAU6IW42PYRX72F20W5TNI3M1BNCE--

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Timo van Roermund@21:1/5 to All on Sun Mar 23 22:30:01 2025
    A patch was made available. See:

    https://gitlab.com/samba-team/samba/-/merge_requests/4013

    https://bugzilla.samba.org/show_bug.cgi?id=15836

    I will validate/confirm the fix when a new release is available.

    Cheers,

    Timo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)