tks98 / snoopy

Inspect SSL/TLS traffic using eBPF
MIT License
13 stars 2 forks source link

not enough arguments in call to (_C2func_bcc_func_load) #1

Open NobinPegasus opened 1 month ago

NobinPegasus commented 1 month ago

When I try to build using go build -o snoopy this command I find the following error:

pegasus@pegasus:~/Documents/ssl-ebpf-projects/snoopy$ go build -o snoopy
# github.com/iovisor/gobpf/bcc
../../../go/pkg/mod/github.com/iovisor/gobpf@v0.2.0/bcc/module.go:230:132: not enough arguments in call to (_C2func_bcc_func_load)
    have (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, nil)
    want (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, *_Ctype_char, _Ctype_int)
tks98 commented 1 month ago

@NobinPegasus this is most likely due to the gobpf bindings not being updated to fully support the latest version of bcc.

I installed bcc using the guide provided here: https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary

You may need to target an older version of bcc that is compatible with gobpf v0.2.0. Here are the relevant versions that you might need:

For reference, here is a screenshot showing the versions installed on my setup

Screenshot 2024-05-31 at 4 53 11 PM

NobinPegasus commented 1 month ago

The iovisor build documentation is not up to date. They normally don't respond to issues. Or response very slow. Here's my configuration:

pegasus@pegasus:~/Documents/ssl-ebpf-projects/snoopy$ uname -a
Linux pegasus 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
pegasus@pegasus:~/Documents/ssl-ebpf-projects/snoopy$ cat go.mod | grep "gobpf"
    github.com/iovisor/gobpf v0.2.0
pegasus@pegasus:~/Documents/ssl-ebpf-projects/snoopy$ dpkg -l | grep "bcc"
ii  libcc1-0:amd64                                 14-20240412-0ubuntu1                       amd64        GCC cc1 plugin for GDB
tks98 commented 1 month ago

@NobinPegasus it doesn't look bcc-tools are installed - I'd start here and install it for your OS https://github.com/iovisor/bcc/blob/master/INSTALL.md and then see if you can compile snoopy.

NobinPegasus commented 1 month ago

@tks98 I've the bcc-tools installed