Skip to content

Docker image created successfully but compilation error reported #4

Open
@tongyuanww

Description

@tongyuanww

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions