Can I call dr_app_setup_and_start in a signal handler ?

11 views
Skip to first unread message

吕志宏

unread,
Nov 14, 2025, 11:28:52 AMNov 14
to DynamoRIO Users
I want to perform tracing at a certain stage during application execution. Is it possible to call `dr_app_setup_and_start` by sending a signal? Or is there a better alternative?

Kai Luk

unread,
Nov 14, 2025, 12:09:36 PMNov 14
to DynamoRIO Users
Could you modify the application?

> If the application can be modified, it can be linked with the \p drmemtrace
tracer and use DynamoRIO's start/stop API routines dr_app_setup_and_start()
and dr_app_stop_and_cleanup() to delimit the desired trace region.

for an example.

Kai 

Derek Bruening

unread,
Nov 18, 2025, 12:35:00 AM (12 days ago) Nov 18
to DynamoRIO Users
If you cannot modify the application, you can use instruction counts to delay tracing (-trace_after_instrs), or trim the trace in post-processing (-trim_before_instr).

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dynamorio-users/e7a54766-f36f-4180-84f7-e9c5b682b27fn%40googlegroups.com.

吕志宏

unread,
Nov 20, 2025, 9:24:25 PM (9 days ago) Nov 20
to DynamoRIO Users
Hi, I'm using `drrun attach` to try and take over a test program, but I'm encountering a problem. After execution, there's no response. Using gdb, I see that the `drrun` program is stuck in a `dr_inject_wait_for_child` loop, seemingly unable to wait for the child thread to exit. My test program is a user-space program similar to DPDK, and the child threads are all polling. I'd like to ask if there are any solutions?

吕志宏

unread,
Nov 20, 2025, 10:09:45 PM (9 days ago) Nov 20
to DynamoRIO Users
I suspect the program might be blocking or ignoring certain Dynamorio essential signals. Are there any signals that the program cannot block or ignore?

Derek Bruening

unread,
Nov 21, 2025, 4:11:03 PM (8 days ago) Nov 21
to 吕志宏, DynamoRIO Users
For the start/stop interface, yes: but it's usually SIGILL: see https://github.com/DynamoRIO/dynamorio/blob/master/core/unix/os.c#L995.
For ptrace attach, no, I don't think it should matter as it uses ptrace to attach and once in control it does a decent job of distinguishing its own from app signals.
But ptrace attach in the middle of certain syscalls can be tricky: see PR #5462 and the earlier code #5019 talking about auto-restart syscall issues.


Reply all
Reply to author
Forward
0 new messages