Skip to content
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

error: 'BPF_FUNC_send_signal' was not declared #1014

Closed
mwuertinger opened this issue Dec 15, 2019 · 8 comments
Closed

error: 'BPF_FUNC_send_signal' was not declared #1014

mwuertinger opened this issue Dec 15, 2019 · 8 comments
Milestone

Comments

@mwuertinger
Copy link
Contributor

@mwuertinger mwuertinger commented Dec 15, 2019

Building master (d95a2d1) on Ubuntu 19.10 currently fails with:

/home/mw/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'void bpftrace::ast::IRBuilderBPF::CreateSignal(llvm::Value*)':
/home/mw/bpftrace/src/ast/irbuilderbpf.cpp:669:16: error: 'BPF_FUNC_send_signal' was not declared in this scope
  669 |       getInt64(BPF_FUNC_send_signal),
      |                ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/ast/CMakeFiles/ast.dir/build.make:89: src/ast/CMakeFiles/ast.dir/irbuilderbpf.cpp.o] Error 1
@mwuertinger mwuertinger changed the title error: 'BPF_FUNC_send_signal' was not error: 'BPF_FUNC_send_signal' was not declared Dec 15, 2019
@fbs

This comment has been minimized.

Copy link
Contributor

@fbs fbs commented Dec 16, 2019

Weird, cmake should detect whether that feature is available. I'll try to reproduce it

@mwuertinger

This comment has been minimized.

Copy link
Contributor Author

@mwuertinger mwuertinger commented Dec 16, 2019

It can be reproduced in a ubuntu:19.10 docker container by following the official build steps from https://github.com/iovisor/bpftrace/blob/master/INSTALL.md#ubuntu

Please let me know if you need any more info from me.

@fbs

This comment has been minimized.

Copy link
Contributor

@fbs fbs commented Dec 16, 2019

Hmm what happens here is that your kernel supports send_signal but bcc does not:

$ grep -ri 'FN(send_signal' /usr/include/
/usr/include/linux/bpf.h:	FN(send_signal),

Compared to cgroupid

$ grep -ri 'FN(get_current_cgroup' /usr/include/
/usr/include/linux/bpf.h:	FN(get_current_cgroup_id),	\
/usr/include/bcc/compa1t/linux/bpf.h:	FN(get_current_cgroup_id),	\
/usr/include/bcc/compat/linux/virtual_bpf.h:	FN(get_current_cgroup_id),	\

We're using the kernel headers to verify whether the option is present but use the bpf.h shipped with bcc in the code generation.

I guess we could first check whether the kernel has the feature. If it does we check bcc. If bcc has it we set the flag. If bcc doesn't we emit a warning advising the user to upgrade to a bcc that has been synced with their kernel to enable more features.

Or maybe we can use the bpf.h shipped with the kernel.

@fbs fbs added this to the 0.9.4 milestone Dec 16, 2019
@zedware

This comment has been minimized.

Copy link

@zedware zedware commented Dec 23, 2019

Found the same problem in my Ubuntu 19.10 QEMU env.

@fbs

This comment has been minimized.

Copy link
Contributor

@fbs fbs commented Dec 30, 2019

I tried switching irbuilderbpf.h to the systems <linux/bpf.h> and it seems to work fine, except for the static build. The build can be found here

@ajor / @danobi any objections to switching to the system bpf.h for irbuilder ?

@ajor

This comment has been minimized.

Copy link
Member

@ajor ajor commented Dec 30, 2019

Sounds good to me as long as the static build can be fixed

@dalehamel

This comment has been minimized.

Copy link
Member

@dalehamel dalehamel commented Jan 14, 2020

once #1063 lands the static build issue can probably be revisited to see if it is still an issue.

@fbs

This comment has been minimized.

Copy link
Contributor

@fbs fbs commented Jan 21, 2020

So we ended up switching to our own bpf.h in #1088, I think this can be closed

@fbs fbs closed this Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.