Bug 15275 - smbd_scavenger crashes when service smbd is stopped
Summary: smbd_scavenger crashes when service smbd is stopped
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.17.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-01 16:10 UTC by Lev
Modified: 2023-08-16 16:56 UTC (History)
1 user (show)

See Also:


Attachments
Patch for v4-18-test (1.79 KB, text/plain)
2023-07-05 18:48 UTC, Stefan Metzmacher
slow: review+
Details
Patch for v4-17-test (1.79 KB, text/plain)
2023-07-05 18:48 UTC, Stefan Metzmacher
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lev 2023-01-01 16:10:51 UTC
One of smbd processes crashes, when systemd service is stopped:

Jan  1 12:24:26.883533 vsa-00000049-vc-0 systemd[1]: Stopping Samba SMB Daemon...

[2023/01/01 12:24:26.886039,  0, pid=28057, effective(0, 0), real(0, 0)] ../../lib/util/fault.c:173(smb_panic_log)
  ===============================================================
[2023/01/01 12:24:26.886308,  0, pid=28057, effective(0, 0), real(0, 0)] ../../lib/util/fault.c:177(smb_panic_log)
  INTERNAL ERROR: smbd_scavenger_parent_dead in pid 28057 (4.17.2)
[2023/01/01 12:24:26.886335,  0, pid=28057, effective(0, 0), real(0, 0)] ../../lib/util/fault.c:182(smb_panic_log)
  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
[2023/01/01 12:24:26.886348,  0, pid=28057, effective(0, 0), real(0, 0)] ../../lib/util/fault.c:183(smb_panic_log)
  ===============================================================
[2023/01/01 12:24:26.886355,  0, pid=28057, effective(0, 0), real(0, 0)] ../../lib/util/fault.c:185(smb_panic_log)
  PANIC (pid 28057): smbd_scavenger_parent_dead in 4.17.2

(gdb) bt
#0  0x00007f25b7f76e87 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f25b7f787f1 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f25bac72656 in dump_core () at ../../source3/lib/dumpcore.c:338
#3  0x00007f25bac87f65 in smb_panic_s3 (why=0x7f25bb77b8a9 "smbd_scavenger_parent_dead") at ../../source3/lib/util.c:721
#4  0x00007f25b877d940 in smb_panic (why=0x7f25bb77b8a9 "smbd_scavenger_parent_dead") at ../../lib/util/fault.c:198
#5  0x00007f25bb6a9555 in exit_server_common (how=SERVER_EXIT_ABNORMAL, reason=0x7f25bb77b8a9 "smbd_scavenger_parent_dead") at ../../source3/smbd/server_exit.c:224
#6  0x00007f25bb6a9603 in smbd_exit_server (explanation=0x7f25bb77b8a9 "smbd_scavenger_parent_dead") at ../../source3/smbd/server_exit.c:241
#7  0x00007f25b8980cfd in exit_server (reason=0x7f25bb77b8a9 "smbd_scavenger_parent_dead") at ../../source3/lib/smbd_shim.c:113
#8  0x00007f25bb6ad370 in smbd_scavenger_parent_dead (event_ctx=0x562fffedd830, fde=0x562ffff09a70, flags=1, private_data=0x562fffef40c0) at ../../source3/smbd/scavenger.c:107
#9  0x00007f25b9f8a2ee in tevent_common_invoke_fd_handler (fde=0x562ffff09a70, flags=1, removed=0x0) at ../../lib/tevent/tevent_fd.c:142
#10 0x00007f25b9f950af in epoll_event_loop (epoll_ev=0x562fffef44e0, tvalp=0x7ffd9bb20630) at ../../lib/tevent/tevent_epoll.c:737
#11 0x00007f25b9f95792 in epoll_event_loop_once (ev=0x562fffedd830, location=0x7f25bb77b698 "../../source3/smbd/scavenger.c:66") at ../../lib/tevent/tevent_epoll.c:938
#12 0x00007f25b9f91f28 in std_event_loop_once (ev=0x562fffedd830, location=0x7f25bb77b698 "../../source3/smbd/scavenger.c:66") at ../../lib/tevent/tevent_standard.c:110
#13 0x00007f25b9f89031 in _tevent_loop_once (ev=0x562fffedd830, location=0x7f25bb77b698 "../../source3/smbd/scavenger.c:66") at ../../lib/tevent/tevent.c:825
#14 0x00007f25bb6acff1 in smbd_scavenger_main (state=0x562fffef40c0) at ../../source3/smbd/scavenger.c:66
#15 0x00007f25bb6ade3f in smbd_scavenger_start (state=0x562fffef40c0) at ../../source3/smbd/scavenger.c:283
#16 0x00007f25bb6ae133 in smbd_scavenger_msg (msg_ctx=0x562fffedf370, private_data=0x562fffef40c0, msg_type=789, src=..., data=0x7ffd9bb20af8) at ../../source3/smbd/scavenger.c:339
#17 0x00007f25bac6ecce in messaging_dispatch_classic (msg_ctx=0x562fffedf370, rec=0x7ffd9bb20ab0) at ../../source3/lib/messages.c:1301
#18 0x00007f25bac6ee99 in messaging_dispatch_rec (msg_ctx=0x562fffedf370, ev=0x562fffedd830, rec=0x7ffd9bb20ab0) at ../../source3/lib/messages.c:1364
#19 0x00007f25bac6c863 in messaging_recv_cb (ev=0x562fffedd830, msg=0x7ffd9bb20f88 "\340\b", msg_len=92, fds=0x7ffd9bb20f7c, num_fds=0, private_data=0x562fffedf370) at ../../source3/lib/messages.c:430
#20 0x00007f25b28d7559 in msg_dgm_ref_recv (ev=0x562fffedd830, msg=0x7ffd9bb20f88 "\340\b", msg_len=92, fds=0x7ffd9bb20f7c, num_fds=0, private_data=0x0) at ../../lib/messaging/messages_dgm_ref.c:144
#21 0x00007f25b28d5ed5 in messaging_dgm_recv (ctx=0x562fffed9ce0, ev=0x562fffedd830, buf=0x7ffd9bb20f88 "\340\b", buflen=92, fds=0x7ffd9bb20f7c, num_fds=0) at ../../lib/messaging/messages_dgm.c:1362
#22 0x00007f25b28d5b34 in messaging_dgm_read_handler (ev=0x562fffedd830, fde=0x562fffef63f0, flags=1, private_data=0x562fffed9ce0) at ../../lib/messaging/messages_dgm.c:1299
#23 0x00007f25b9f8a2ee in tevent_common_invoke_fd_handler (fde=0x562fffef63f0, flags=1, removed=0x0) at ../../lib/tevent/tevent_fd.c:142
#24 0x00007f25b9f950af in epoll_event_loop (epoll_ev=0x562fffec1b30, tvalp=0x7ffd9bb21480) at ../../lib/tevent/tevent_epoll.c:737
#25 0x00007f25b9f95792 in epoll_event_loop_once (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent_epoll.c:938
#26 0x00007f25b9f91f28 in std_event_loop_once (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent_standard.c:110
#27 0x00007f25b9f89031 in _tevent_loop_once (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent.c:825
#28 0x00007f25b9f89383 in tevent_common_loop_wait (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent.c:948
#29 0x00007f25b9f91fca in std_event_loop_wait (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent_standard.c:141
#30 0x00007f25b9f89426 in _tevent_loop_wait (ev=0x562fffedd830, location=0x562ffddec1f0 "../../source3/smbd/server.c:1388") at ../../lib/tevent/tevent.c:967
#31 0x0000562ffdde7d9e in smbd_parent_loop (ev_ctx=0x562fffedd830, parent=0x562fffef1fc0) at ../../source3/smbd/server.c:1388
#32 0x0000562ffddea058 in main (argc=3, argv=0x7ffd9bb21a18) at ../../source3/smbd/server.c:2154

The issue was discussed 4.5 years ago in https://lists.samba.org/archive/samba-technical/2018-August/129949.html but looks like was not eventually fixed.
Comment 1 Samba QA Contact 2023-07-05 13:15:03 UTC
This bug was referenced in samba master:

083fe1c28c6ec69cbd15d8cc2f7f06b1b630f2bc
Comment 2 Stefan Metzmacher 2023-07-05 18:48:13 UTC
Created attachment 17974 [details]
Patch for v4-18-test
Comment 3 Stefan Metzmacher 2023-07-05 18:48:39 UTC
Created attachment 17975 [details]
Patch for v4-17-test
Comment 4 Jule Anger 2023-07-06 11:45:19 UTC
Pushed to autobuild-v4-{18,17}-test.
Comment 5 Samba QA Contact 2023-07-06 13:02:20 UTC
This bug was referenced in samba v4-18-test:

36bb9480604b17d23da34f05c3a0a64a85701431
Comment 6 Samba QA Contact 2023-07-06 13:30:19 UTC
This bug was referenced in samba v4-17-test:

426b6ecca6dc57c6d6fe016c24fa5d26818d2b1b
Comment 7 Jule Anger 2023-07-06 13:37:45 UTC
Closing out bug report.

Thanks!
Comment 8 Samba QA Contact 2023-07-06 13:59:52 UTC
This bug was referenced in samba v4-17-stable (Release samba-4.17.9):

426b6ecca6dc57c6d6fe016c24fa5d26818d2b1b
Comment 9 Samba QA Contact 2023-08-16 16:56:47 UTC
This bug was referenced in samba v4-18-stable (Release samba-4.18.6):

36bb9480604b17d23da34f05c3a0a64a85701431