Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault in uftrace tui #1093

Open
honggyukim opened this issue Jan 22, 2020 · 0 comments
Open

segfault in uftrace tui #1093

honggyukim opened this issue Jan 22, 2020 · 0 comments
Labels

Comments

@honggyukim
Copy link
Collaborator

Here is the gdb backtrace info.

$ gdb -q --args uftrace tui
    ...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68363c7 in memcpy () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff68363c7 in memcpy () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff681fd8f in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff6814469 in fread () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00005555555a79ff in __read_task_ustack (task=0x555556935ed8) at /home/honggyu/work/uftrace/utils/fstack.c:1017
#4  0x00005555555a8ba7 in read_task_ustack (handle=0x7fffffffd9b0, task=0x555556935ed8) at /home/honggyu/work/uftrace/utils/fstack.c:1399
#5  0x00005555555a9278 in get_task_ustack (handle=0x7fffffffd9b0, idx=1) at /home/honggyu/work/uftrace/utils/fstack.c:1453
#6  0x00005555555a933a in read_user_stack (handle=0x7fffffffd9b0, task=0x7fffffffd8e0) at /home/honggyu/work/uftrace/utils/fstack.c:1591
#7  0x00005555555aa671 in __read_rstack (handle=0x7fffffffd9b0, taskp=0x7fffffffd9a0, consume=true) at /home/honggyu/work/uftrace/utils/fstack.c:2060
#8  0x00005555555aac3e in read_rstack (handle=0x7fffffffd9b0, task=0x7fffffffd9a0) at /home/honggyu/work/uftrace/utils/fstack.c:2208
#9  0x0000555555574e71 in command_tui (argc=0, argv=0x7fffffffde58, opts=0x7fffffffdc00) at /home/honggyu/work/uftrace/cmds/tui.c:2625
#10 0x0000555555561554 in main (argc=0, argv=0x7fffffffde58) at /home/honggyu/work/uftrace/uftrace.c:1208

The source location is

1013static int __read_task_ustack(struct uftrace_task_reader *task)
1014│ {
1015FILE *fp = task->fp;
10161017├───────> if (fread(&task->ustack, sizeof(task->ustack), 1, fp) != 1) {
1018if (feof(fp))
1019return -1;
10201021pr_warn("error reading rstack: %s\n", strerror(errno));
1022return -1;
1023│         }
10241025if (task->h->needs_byte_swap)
1026swap_byte_order(&task->ustack);
1027if (task->h->needs_bit_swap)
1028swap_bitfields(&task->ustack);
10291030if (task->ustack.magic != RECORD_MAGIC) {
1031pr_warn("invalid rstack read\n");
1032return -1;
1033│         }
10341035return 0;
1036│ }
1037│
/home/honggyu/work/uftrace/utils/fstack.c
@honggyukim honggyukim added the bug label Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant