Project

General

Profile

Actions

Bug #14714

open

DTrace apparently crashed target process

Added by David Pacheco 30 days ago. Updated 30 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

I was trying to profile `ld` invocations being made as part of a build. I'm using a two-step DTrace: the first step is that I run "ld-trace.d (attached) to watch for ld invocations. When it sees one, it starts a second D script (also attached) to profile the new process.

To start tracing, I ran `./ld-trace.d 27131`. From pid 27131 (my shell), I run "ld". It segfaults:

$ ld
Trace/Breakpoint Trap (core dumped)

The output of the "ld-trace" script is:

$ pfexec ./ld-trace.d 27131
tracing ld(1) execs...^C to stop
  pid 801 gen 1: exec ld
  pid 801 gen 1: ran for 1119ms, then exit
^C

I'm also attaching ld-args-801-1.out and ld-stacks-801-2.out, which contain the `pargs` output and profiling stack traces from this `ld` invocation. They're not interesting in this case except to show there's nothing very funny going on (i.e., the arguments are what you expect).

This is all on helios-1.0.21004.

One other data point: this started happening when I modified `ld-trace-one.d` to use `$target` instead of accepting the pid as a command-line argument.


Files

ld-args-801-1.out (20 Bytes) ld-args-801-1.out David Pacheco, 2022-05-26 09:37 PM
ld-stacks-801-1.out (1 Byte) ld-stacks-801-1.out David Pacheco, 2022-05-26 09:37 PM
ld-trace-one.d (288 Bytes) ld-trace-one.d David Pacheco, 2022-05-26 09:37 PM
ld-trace.d (701 Bytes) ld-trace.d David Pacheco, 2022-05-26 09:37 PM
buggy-ld-core.gz (754 KB) buggy-ld-core.gz core file from ld that crashed David Pacheco, 2022-05-26 09:38 PM
Actions #1

Updated by David Pacheco 30 days ago

The core file from `ld` is attached. I looked briefly at it but it looks like we're in outer space:

$ mdb core 
Loading modules: [ ld libc.so.1 ld.so.1 ]
> ::stack
mdb: failed to get current register set: invalid thread identifier
> ::walk ulwp
> <eip=E
                0                    
> <esp=E
                0                    
> <ebp=E
                0  
> ::status
debugging core file of ld (32-bit) from ivanova
file: /usr/bin/ld
initial argv: ld
threading model: native threads
status: process terminated by SIGTRAP (Trace/Breakpoint Trap), addr=fbdf2e20

pstack is able to show a bit more for some reason:

$ pstack core 
core 'core' of 801:    ld
 fbdf2e20 rtld_db_dlactivity (fbe23be0)
 fbdf27a4 setup    (80455e4, 8045660, 0, 8045a48, 1000, fbde06c9, fbdda000, fbdda000, ...) + 138b
 fbe02470 _setup   (8045588, d4) + 369
 fbde6f81 _rt_boot (0, 80456eb, 80456fb, 804573a, 8045768, 8045773) + 5b
 080456e8 ???????? ()

The trap address appears to be in ld.so.1:

> fbdf2e20$m
    BASE    LIMIT     SIZE NAME
fbdda000 fbe12000    38000 /lib/ld.so.1
Actions

Also available in: Atom PDF