iovisor / iovisor/bcc

test_trace1.py test_trace1.b kprobe.b always get segment fault

Open
#3,237 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

My os version is based on centos8, x86_64, while I use clang-10.0.1/llvm-10.0.1/glibc2.32/gcc10.2.1, "test_trace1.py test_trace1.b kprobe.b" will always get crash.
I also try llvm-11.0.0/clang-11.0.0, the same result.
the backtrace of core is :
```
(gdb) bt
#0 0x00007fafc677326e in llvm::BTFDebug::beginInstruction (MI=0x55cd0c2305c0, this=0x55cd0b9ec610) at ../include/llvm/CodeGen/MachineFunction.h:456
#1 llvm::BTFDebug::beginInstruction (this=0x55cd0b9ec610, MI=0x55cd0c2305c0) at ../lib/Target/BPF/BTFDebug.cpp:1011
#2 0x00007fafc4e13990 in llvm::AsmPrinter::EmitFunctionBody (this=) at /usr/include/c++/10/bits/unique_ptr.h:421
#3 0x00007fafc4e15479 in llvm::AsmPrinter::runOnMachineFunction (this=0x55cd0ba254d0, MF=...) at ../include/llvm/CodeGen/AsmPrinter.h:314
#4 0x00007fafc49dcdb7 in llvm::MachineFunctionPass::runOnFunction (this=0x55cd0ba254d0, F=...) at ../lib/CodeGen/MachineFunctionPass.cpp:73
#5 0x00007fafc480d28d in llvm::FPPassManager::runOnFunction (this=0x55cd0c562020, F=...) at ../lib/IR/LegacyPassManager.cpp:1481
#6 0x00007fafc480d74b in llvm::FPPassManager::runOnModule (this=0x55cd0c562020, M=...) at ../lib/IR/LegacyPassManager.cpp:1517
#7 0x00007fafc480dabd in llvm::legacy::PassManagerImpl::run (this=0x55cd0c5d60b0, M=...) at ../lib/IR/LegacyPassManager.cpp:1582
#8 0x00007fafc5c1c66e in llvm::MCJIT::emitObject (this=this@entry=0x55cd0c36b1f0, M=M@entry=0x55cd0c029510) at ../lib/ExecutionEngine/MCJIT/MCJIT.cpp:168
#9 0x00007fafc5c1cd4e in llvm::MCJIT::generateCodeForModule (this=0x55cd0c36b1f0, M=0x55cd0c029510) at ../lib/ExecutionEngine/MCJIT/MCJIT.cpp:207
#10 0x00007fafc5c18a38 in llvm::MCJIT::finalizeObject (this=0x55cd0c36b1f0) at ../lib/ExecutionEngine/MCJIT/MCJIT.cpp:262
#11 0x00007fafcb1f3bbe in ebpf::BPFModule::finalize() () from /lib64/libbcc.so.0
#12 0x00007fafcb1f3e06 in ebpf::BPFModule::load_b(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) () from /lib64/libbcc.so.0
#13 0x00007fafcb1eaad0 in bpf_module_create_b () from /lib64/libbcc.so.0
#14 0x00007fafcb5c6b70 in ffi_call_unix64 () from /lib64/libffi.so.6
#15 0x00007fafcb5c632b in ffi_call () from /lib64/libffi.so.6
#16 0x00007fafcb5d4db3 in _ctypes_callproc.cold () from /usr/lib64/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so
#17 0x00007fafcb5de30f in PyCFuncPtr_call () from /usr/lib64/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so
#18 0x00007fafd9151439 in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#19 0x00007fafd9150a0d in call_function () from /lib64/libpython3.6m.so.1.0
#20 0x00007fafd9148e0b in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#21 0x00007fafd9147c85 in _PyEval_EvalCodeWithName () from /lib64/libpython3.6m.so.1.0
#22 0x00007fafd915c744 in _PyFunction_FastCallDict () from /lib64/libpython3.6m.so.1.0
#23 0x00007fafd91514e9 in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#24 0x00007fafd915c382 in _PyObject_Call_Prepend () from /lib64/libpython3.6m.so.1.0
#25 0x00007fafd9156b5c in PyObject_Call () from /lib64/libpython3.6m.so.1.0
#26 0x00007fafd915c051 in slot_tp_init () from /lib64/libpython3.6m.so.1.0
#27 0x00007fafd9151c0b in type_call () from /lib64/libpython3.6m.so.1.0
#28 0x00007fafd9151439 in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#29 0x00007fafd915589c in _PyObject_FastCallKeywords () from /lib64/libpython3.6m.so.1.0
#30 0x00007fafd9150a0d in call_function () from /lib64/libpython3.6m.so.1.0
#31 0x00007fafd9149e18 in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#32 0x00007fafd91571c1 in _PyFunction_FastCall () from /lib64/libpython3.6m.so.1.0
#33 0x00007fafd9150983 in call_function () from /lib64/libpython3.6m.so.1.0
#34 0x00007fafd9148e0b in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
```

and I am a bit confused about this case, what is this case test for ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported command `test_trace1.py test_trace1.b kprobe.b` on the stated environment, then inspect `test_trace1.py`, `test_trace1.b`, and LLVM's `BTFDebug.cpp` around `beginInstruction`, as identified by the backtrace. Confirm what the test case exercises and establish whether the run completes without the reported segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
compilers, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.