Skip to content

PLT hook segfault about GCC 7 #4

@namu1823

Description

@namu1823

gcc 5.4.1에 의해 빌드 된 uftrace 문제는 없습니다.
그러나 gcc 7.0.1로 uftrace를 빌드 할 때 아래와 같이 PLT 후크에 대한 segmentation 오류가 있음을 발견했습니다.

# normal tracing

$ uftrace tests/t-abc
WARN: invalid task file
child terminated by signal: 11: Segmentation fault
# DURATION    TID     FUNCTION

그러나 --no-libcall을 사용하면 세그먼트 화 오류가 나타나지 않습니다.

$ uftrace --no-libcall t-abc

DURATION TID FUNCTION

        [ 5133] | main() {
        [ 5133] |   a() {
        [ 5133] |     b() {

0.982 us [ 5133] | c();
1.854 us [ 5133] | } /* b /
2.170 us [ 5133] | } /
a /
2.792 us [ 5133] | } /
main */
코어 파일을 검사하면 libmcount / plthook.c : 429를 볼 수 있습니다.

Reading symbols from t-abc...(no debugging symbols found)...done.
[New LWP 5249]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `t-abc'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ff5a1b8a322 in plthook_entry (ret_addr=0x7ffd79fb0378, child_idx=1, 
    module_id=140692961395048, regs=0x7ffd79fb0338)
    at /home/taeung/git/uftrace/libmcount/plthook.c:429
429		struct ftrace_trigger tr = {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions