xrprof icon indicating copy to clipboard operation
xrprof copied to clipboard

How to deal with 'fatal: Failed to get proc symbol via libunwind: -2.'

Open eddelbuettel opened this issue 2 years ago • 7 comments

Once I set -m I seem to end up with the error above. Any idea how to overcome this?

Ubuntu 23.10.

eddelbuettel avatar Dec 04 '23 23:12 eddelbuettel

That code is UNW_ENOMEM. According to unw_get_proc_name(3) this means that the symbol is too long for the buffer provided, so evidently we need to (1) increase the size of that buffer; and (2) handle that as the non-fatal error that it is, as per their docs.

atheriel avatar Dec 05 '23 15:12 atheriel

Very nice. I can try that locally. Can you point to the respective line(s) ?

eddelbuettel avatar Dec 05 '23 16:12 eddelbuettel

It's here: https://github.com/atheriel/xrprof/blob/00d4d7a9fc6ad509f4c13e5e781a67181502a83e/src/xrprof.c#L240-L251

atheriel avatar Dec 05 '23 16:12 atheriel

So size of sym is what needs to change?

eddelbuettel avatar Dec 05 '23 16:12 eddelbuettel

That worked! Care for a PR? Preferred size. I picked 1024 because why not? and 512 may work too.

eddelbuettel avatar Dec 05 '23 16:12 eddelbuettel

The poor soul who encounters a symbol longer than 1KB. A PR would be great!

atheriel avatar Dec 05 '23 16:12 atheriel

Narrator: Dirk was last heard mumbling something about Pareto-Efficiency ... Can't take Economics out of him it seems.

PR will be forthcoming.

eddelbuettel avatar Dec 05 '23 16:12 eddelbuettel