-
Notifications
You must be signed in to change notification settings - Fork 7
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
Docker image created successfully but compilation error reported #4
Comments
+1 |
Same error (no Docker involved), Linux 6.8.0, Python bcc 0.29.1 (python3-bpfcc)
|
Hello, |
24.04 What is actually distribution-specific? Kernel or specific user-space version? |
Same error on Ubuntu 20.04.5 LTS. Linux kernel version 5.4.0-139-generic |
This seems to be caused by a weird macro expansion that is not handled correctly within its context in the bpf code. Though I am not sure of the exact source of this issue (tought at first it was a BCC bug on versions >= 0.29.1 but people saying that it happens with ubuntu 20.04.5 LTS hinder that hypothesis) I have resolved the issue in my fork while porting to 24.04 (see my patched file at lines 69-74). If you are interested in a port to ubuntu 24.04, there is a PR pending with the corresponding branch there. |
The Docker image has been successfully created. The following is the information displayed:docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tls-traffic-analyzer latest 0e79c8df13a6 10 days ago 3.05GB
I encountered an error while running the container. The following is the error message. I hope someone can answer it for me
/virtual/main.c:84:145: error: expected expression
struct inet_sock *inet = ({ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *)net_sk); _val; })); _val; })); _val; })); _val; })); _val; })(skp);
^
/virtual/main.c:84:627: error: expected '}'
struct inet_sock *inet = ({ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *){ typeof(struct sock) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *)net_sk); _val; })); _val; })); _val; })); _val; })); _val; })(skp);
It appears to be a syntax error, but the file/virtual/main. c cannot be found
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/app/src/dumper/handshake_detector.py", line 75, in run
bpf = setup_bpf(self.interface)
File "/app/src/dumper/bpf.py", line 40, in setup_bpf
bpf = BPF(src_file="src/dumper/handshake_detector.c", debug=False)
File "/usr/lib/python3/dist-packages/bcc/init.py", line 479, in init
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module b'src/dumper/handshake_detector.c'
This is the final error message
The text was updated successfully, but these errors were encountered: