Generate core file with original process name
Asked Answered
G

0

2

I have a binary which will create multiple threads. Now when one of those threads crashes, I want the name of the core file generated to contain the original process name instead of the thread name.

When I use the %e specifier, it gives the thread name only (I think it is because in Linux, all threads are considered as LWPs).

How do I get the original process which created the thread in the core file name?

I looked at the man file, but it does not have any other specifier which I can use.

Glaciate answered 16/6, 2015 at 11:49 Comment(6)
I get the thread name when I use %e. I want to get the executable name (the process which created the thread)Glaciate
What thread name? Theads don't have names. Please provide an example.Dungdungan
%E adds the path with the name of the executable.Bats
Did you find a solution? I'm having the same problem. See https://mcmap.net/q/1559137/-core-dump-filename-gets-thread-name-instead-of-executable-name-with-core_pattern-e-p-core/564626Kaciekacy
@Kaciekacy Nope, I did not :(Glaciate
See the other question (https://mcmap.net/q/1559137/-core-dump-filename-gets-thread-name-instead-of-executable-name-with-core_pattern-e-p-core/564626) for a workaround that I came up with.Kaciekacy

© 2022 - 2024 — McMap. All rights reserved.