-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
fatal error: error in backend: Empty type name for BTF_TYPE_ID_REMOTE reloc #52779
Comments
@teknoraver thanks for reporting. Will take a look soon. |
The error message is kind of expected. Maybe it can be improved. We kind of delay some checking (sometimes complicated) until backend pass is available, at which point, we may issue a fatal_error explicitly. The following is a simple reproducible test case:
Let us try to reproduce the IR to see what is really going on with command,
The IR,
In the above, we really try to relocate a 'subroutine' (func pointer) type with debuginfo id 13 which is actually "int ()(int)". There are no actually name for type 13 and libbpf is not able to relocate for a function "int ()(int)" as it could have many matches. Do you think the following error message will be better?
|
Yes, that would be much clear |
Matteo Croce reported a bpf backend fatal error in #52779 A simplified case looks like: $ cat bug.c extern int do_smth(int); int test() { return __builtin_btf_type_id(*(typeof(do_smth) *)do_smth, 1); } $ clang -target bpf -O2 -g -c bug.c fatal error: error in backend: Empty type name for BTF_TYPE_ID_REMOTE reloc ... The reason for the fatal error is that the relocation is against a DISubroutineType like type 13 below: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !11 = !{} !12 = !DILocation(line: 3, column: 10, scope: !7) !13 = !DISubroutineType(types: !14) !14 = !{!10, !10} The DISubroutineType doesn't have a name and there is no way for downstream bpfloader/kernel to do proper relocation for it. But we can improve error message to be more specific for this case. The patch improved the error message to be: fatal error: error in backend: SubroutineType not supported for BTF_TYPE_ID_REMOTE reloc Differential Revision: https://reviews.llvm.org/D116063
The issue is fixed with improved error message. |
core-88e556.c.txt
core-88e556.sh.txt
The text was updated successfully, but these errors were encountered: