oracle / oracle/dtrace

Crash with mismatched CTF archive

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Important
Dominant language
C
Stars
189
Forks
23
PR merge metrics
No merged PRs in 30d

Description

This happens sometimes after rebuilding the kernel and the CTF archive doesn't match the running kernel.

(gdb) bt
#0  0x00007ffff7eaf157 in dt_btf_add_to_ctf (dtp=dtp@entry=0x555555561350, btf=btf@entry=0x55555cd11b40, ctf=ctf@entry=0x55555cd4d6c0, type_id=25) at libdtrace/dt_btf.c:386
#1  0x00007ffff7eaf079 in dt_btf_add_to_ctf (dtp=dtp@entry=0x555555561350, btf=btf@entry=0x55555cd11b40, ctf=ctf@entry=0x55555cd4d6c0, type_id=<optimized out>, type_id@entry=148898)
    at libdtrace/dt_btf.c:597
#2  0x00007ffff7eafb1a in dt_btf_to_ctf (dtp=0x555555561350, dmp=<optimized out>, btf=0x55555cd11b40) at libdtrace/dt_btf.c:750
#3  0x00007ffff7eafc51 in dt_btf_module_ctf (dtp=dtp@entry=0x555555561350, dmp=dmp@entry=0x555556bf14d0) at libdtrace/dt_btf.c:806
#4  0x00007ffff7eebda2 in dt_kern_module_ctf_from_btf (dtp=0x555555561350, dmp=0x555556bf14d0) at libdtrace/dt_module.c:848
#5  dt_kern_module_find_ctf (dtp=0x555555561350, dmp=0x555556bf14d0) at libdtrace/dt_module.c:1023
#6  dt_module_load (dtp=dtp@entry=0x555555561350, dmp=dmp@entry=0x555556bf14d0) at libdtrace/dt_module.c:403
#7  0x00007ffff7eed946 in dtrace_lookup_by_name (dtp=dtp@entry=0x555555561350, object=object@entry=0xfffffffffffffffe <error: Cannot access memory at address 0xfffffffffffffffe>,
    name=name@entry=0x555556d86590 "event_show", symp=<optimized out>, symp@entry=0x0, sip=sip@entry=0x7fffffffdee0) at libdtrace/dt_module.c:1658
#8  0x00007ffff7f1215c in populate (dtp=0x555555561350) at libdtrace/dt_prov_fbt.c:126
#9  0x00007ffff7eee66b in dtrace_init (dtp=0x555555561350) at libdtrace/dt_open.c:1218
#10 0x0000555555555f8a in main (argc=2, argv=0x7fffffffe388) at cmd/dtrace.c:1343
(gdb) frame 0
#0  0x00007ffff7eaf157 in dt_btf_add_to_ctf (dtp=dtp@entry=0x555555561350, btf=btf@entry=0x55555cd11b40, ctf=ctf@entry=0x55555cd4d6c0, type_id=25) at libdtrace/dt_btf.c:386
386                             return dtp->dt_shared_btf->ctfids[type_id];
(gdb) p type_id
$1 = 25
(gdb) p dtp->dt_shared_btf
$2 = (struct dt_btf *) 0x5555569ef0f0
(gdb) p *dtp->dt_shared_btf
$3 = {data = 0x7ffff4e00010, size = 6610139, hdr = 0x7ffff4e00010, sdata = 0x7ffff51a62a0 "", ssize = 0, type_cnt = 148895, types = 0x555557093140, ctfids = 0x0}
(gdb)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash after rebuilding the kernel, then start at libdtrace/dt_btf.c:386 and trace the callers through dt_btf_to_ctf and dt_btf_module_ctf. The work is done when a mismatched CTF archive no longer causes the crash shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.