[Bug 1207295] New: bpftrace: SIGSEGV on almost any simple program
https://bugzilla.suse.com/show_bug.cgi?id=1207295 Bug ID: 1207295 Summary: bpftrace: SIGSEGV on almost any simple program Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: Other Status: NEW Severity: Major Priority: P5 - None Component: Kernel Assignee: kernel-bugs@opensuse.org Reporter: cartesius68@gmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- SIGSEGV: ``` $ bpftrace -dd -e 'kprobe:do_nanosleep { printf("%d sleeping\n", pid); }' BTF: using data from /sys/kernel/btf/vmlinux BTF: using data from /sys/kernel/btf/vmlinux AST after: parser ------------------- Program kprobe:do_nanosleep call: printf :: type[none, ctx: 0] string: %d sleeping\n :: type[none, ctx: 0] builtin: pid :: type[none, ctx: 0] AST after: Semantic ------------------- Program kprobe:do_nanosleep call: printf :: type[none, ctx: 0] string: %d sleeping\n :: type[string[13], ctx: 0] builtin: pid :: type[unsigned int64, ctx: 0] AST after: NodeCounter ------------------- Program kprobe:do_nanosleep call: printf :: type[none, ctx: 0] string: %d sleeping\n :: type[string[13], ctx: 0] builtin: pid :: type[unsigned int64, ctx: 0] AST after: ResourceAnalyser ------------------- Program kprobe:do_nanosleep call: printf :: type[none, ctx: 0] string: %d sleeping\n :: type[string[13], ctx: 0] builtin: pid :: type[unsigned int64, ctx: 0] Segmentation fault (core dumped) ``` and many other simple programs. ``` Information for package bpftrace: --------------------------------- Repository : Main Repository (OSS) Name : bpftrace Version : 0.16.0-2.1 Arch : x86_64 Vendor : openSUSE Installed Size : 60.5 MiB Installed : Yes Status : up-to-date Source package : bpftrace-0.16.0-2.1.src System: Host: pn52 Kernel: 6.1.6-1-default arch: x86_64 bits: 64 Console: pty pts/0 Distro: openSUSE Tumbleweed 20230117 ``` -- You are receiving this mail because: You are the assignee for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1207295
https://bugzilla.suse.com/show_bug.cgi?id=1207295#c1
Jiri Slaby
#0 0x00005555556e3a6b in llvm::Type::getNonOpaquePointerElementType (this=<optimized out>) at /usr/include/llvm/IR/Type.h:391
This is: return ContainedTys[0]; and: => 0x00005555556e3a6b <+315>: mov (%rcx),%rsi where p $rcx $1 = 0 So likely ContainedTys is NULL.
#1 llvm::Type::getPointerElementType (this=<optimized out>) at /usr/include/llvm/IR/Type.h:381 #2 bpftrace::ast::IRBuilderBPF::createCall (this=0x7fffffffd308, callee=0x555555d06890, args=..., Name=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/irbuilderbpf.cpp:300 #3 bpftrace::ast::IRBuilderBPF::CreateHelperCall (this=this@entry=0x7fffffffd308, func_id=<optimized out>, func_id@entry=libbpf::BPF_FUNC_get_current_pid_tgid, helper_type=0x555555d04748, args=..., Name=..., loc=0x55555589d0b8) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/irbuilderbpf.cpp:291 #4 0x00005555556e2cbf in bpftrace::ast::IRBuilderBPF::CreateGetPidTgid (this=0x7fffffffd308, loc=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/irbuilderbpf.cpp:883 #5 0x00005555556c34a4 in bpftrace::ast::CodegenLLVM::visit (this=0x7fffffffd2e0, builtin=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:152 #6 0x00005555556cb2e3 in bpftrace::ast::CodegenLLVM::accept (this=this@entry=0x7fffffffd2e0, node=node@entry=0x55555589d0b0) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3372 #7 0x00005555556cde7d in bpftrace::ast::CodegenLLVM::createFormatStringCall (this=this@entry=0x7fffffffd2e0, call=..., id=@0x7fffffffd4c0: 0, call_args=std::vector of length 1, capacity 1 = {...}, call_name="printf", async_action=async_action@entry=bpftrace::AsyncAction::printf) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3024 #8 0x00005555556c81d2 in bpftrace::ast::CodegenLLVM::visit (this=0x7fffffffd2e0, call=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:922 #9 0x00005555556cb2e3 in bpftrace::ast::CodegenLLVM::accept (this=0x7fffffffd2e0, node=0x55555589cf70) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3372 #10 0x00005555556d6894 in bpftrace::ast::CodegenLLVM::visit (this=0x555555d06890, expr=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:1998 #11 0x00005555556cb2e3 in bpftrace::ast::CodegenLLVM::accept (this=this@entry=0x7fffffffd2e0, node=0x7fffe8047170) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3372 #12 0x00005555556d8a49 in bpftrace::ast::CodegenLLVM::generateProbe (this=this@entry=0x7fffffffd2e0, probe=..., full_func_id="kprobe:do_nanosleep", section_name="kprobe:do_nanosleep", func_type=0x555555d04360, func_type@entry=0x7fffffffc920, expansion=false, usdt_location_index=std::optional<int> [no contained value], dummy=<optimized out>) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:2333 #13 0x00005555556dadd6 in bpftrace::ast::CodegenLLVM::visit (this=0x7fffffffd2e0, probe=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:2419 #14 0x00005555556cb2e3 in bpftrace::ast::CodegenLLVM::accept (this=this@entry=0x7fffffffd2e0, node=0x7fffe8045290) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3372 #15 0x00005555556db3d7 in bpftrace::ast::CodegenLLVM::visit (this=0x7fffffffd2e0, program=...) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:2552 #16 0x00005555556cb2e3 in bpftrace::ast::CodegenLLVM::accept (this=this@entry=0x7fffffffd2e0, node=0x7fffe8045000) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3372 #17 0x00005555556dbd67 in bpftrace::ast::CodegenLLVM::generate_ir (this=0x7fffffffd2e0) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/ast/passes/codegen_llvm.cpp:3206 #18 0x00005555555da60f in main (argc=<optimized out>, argv=<optimized out>) at /home/abuild/rpmbuild/BUILD/bpftrace-0.16.0/src/main.cpp:899
-- You are receiving this mail because: You are the assignee for the bug.
participants (1)
-
bugzilla_noreply@suse.com