Summary: | net-fs/samba-4.12.9-r1: smbd terminated w/ SIGEV when build w/ clang, while not w/ gcc | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Zhixu Liu <zhixu.liu> |
Component: | Current packages | Assignee: | Gentoo's SAMBA Team <samba> |
Status: | RESOLVED OBSOLETE | ||
Severity: | critical | CC: | bkohler, llvm |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
asm of source3/lib/messages.c from clang
asm of source3/lib/messages.c from gcc |
Description
Zhixu Liu
2021-02-12 12:52:26 UTC
Created attachment 686460 [details]
asm of source3/lib/messages.c from clang
Created attachment 686463 [details]
asm of source3/lib/messages.c from gcc
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0 0x00007fd4c369760b in messaging_recv_cb (ev=0x562c18d05890,
> msg=0x7ffd31fce8c8 "\251\312\001", msg_len=52, fds=0x7ffd31fce8bc,
> num_fds=0, private_data=<optimized out>) at
> ../../source3/lib/messages.c:395
> 395 int64_t fds64[MIN(num_fds, INT8_MAX)];
line 395 should be 394, I add a printf before the original line.
build w/ clang after apply following patch: diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 63d6362..af508bc 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -391,6 +391,9 @@ static void messaging_recv_cb(struct tevent_context *ev, private_data, struct messaging_context); struct server_id_buf idbuf; struct messaging_rec rec; + #include <unistd.h> + printf("%s:%d %d\n", __FILE__, __LINE__, getpid()); + sleep(10); int64_t fds64[MIN(num_fds, INT8_MAX)]; size_t i; then gdb attach to the pid, and stepi see what happens. a infited loop found: (gdb)stepi 0x00007f0eaeb77845 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77833 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb7783b 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77842 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77845 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77833 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb7783b 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77842 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; (gdb) 0x00007f0eaeb77845 397 int64_t fds64[MIN(num_fds, INT8_MAX)]; disassemble shows: => 0x00007f0eaeb77833 <+163>: movq $0x0,(%rsp) 0x00007f0eaeb7783b <+171>: sub $0x1000,%rsp 0x00007f0eaeb77842 <+178>: cmp %rsp,%rax 0x00007f0eaeb77845 <+181>: jge 0x7f0eaeb77833 <messaging_recv_cb+163> this might be a bug of clang compiler? problem disappeared after upgrade clang to v11.0.1 |