-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling postject_find_resource()
segfaults on rhel8-ppc64le
#70
Comments
The implementation should be something like https://github.com/iovisor/bpftrace/blob/1326f040a0f88287ccbc8c18fe8956bca4cc225d/src/utils.cpp#L1017-L1050. I'll see if I can find any obvious differences. Meanwhile maybe @dsanders11 and @robertgzr could help? |
Also, cc @nodejs/single-executable if anyone else also has any clue |
This also serves as a workaround for nodejs/postject#70. Signed-off-by: Darshan Sen <[email protected]>
This also serves as a workaround for nodejs/postject#70. Signed-off-by: Darshan Sen <[email protected]>
That implementation is a bit different - it's looking for
While I don't see anything obvious, so I'll try to dig into this later and see what I can find. There might be some slight difference on |
This also serves as a workaround for nodejs/postject#70. Signed-off-by: Darshan Sen <[email protected]>
Hmm, weird find - I'm able to reproduce this on Linux when I compile this on an x64 Ubuntu Linux:
|
FWIW, I tried using @dsanders11 I'll send a PR for this soon if you're not aware of anything obviously wrong with function which I haven't considered. |
The program headers base address values returned by `getauxval(AT_PHDR)` and `dl_iterate_phdr()` are identical only on `g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0`. However, the values are totally different on `clang version 10.0.0-4ubuntu1` and `g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-16)`. Since the `dl_iterate_phdr()` approach seems to work for all the 3 compilers, I think we should proceed with that. Fixes: #70 Refs: #76 Signed-off-by: Darshan Sen <[email protected]>
Fix - #77 |
The crash originates from here:
postject/postject-api.h
Line 141 in 3534343
while dereferencing the
note
pointer. Note thatnote
is not a null pointer here.This is happening for the case where the resource hasn't been injected into the node binary.
This is one of the blockers for the single-executable PR in core - nodejs/node#45038.I think callingpostject_has_resource()
first would also unblock that PR.Refs: nodejs/build#3168
The text was updated successfully, but these errors were encountered: