lizrice / learning-ebpf

Learning eBPF, published by O'Reilly - out now! Here's where you'll find a VM config for the examples, and more
https://www.amazon.com/Learning-eBPF-Programming-Observability-Networking/dp/1098135121
Apache License 2.0
1.19k stars 255 forks source link

Chapter 8 Make fails #20

Closed sherwoodzern closed 1 year ago

sherwoodzern commented 1 year ago

I execute sudo make for the components in chapter 8. I get the following output. There are a number of failures in the process. I do not have a /sys/fs/bpf/hello.

bpftool net detach xdp dev lo rm -f /sys/fs/bpf/hello bpftool prog load hello.bpf.o /sys/fs/bpf/hello libbpf: load bpf program failed: Invalid argument libbpf: -- BEGIN DUMP LOG --- libbpf: 0: (61) r2 = (u32 )(r1 +4) 1: (61) r1 = (u32 )(r1 +0) 2: (bf) r3 = r1 3: (07) r3 += 14 4: (2d) if r3 > r2 goto pc+11 R1_w=pkt(id=0,off=0,r=14,imm=0) R2_w=pkt_end(id=0,off=0,imm=0) R3_w=pkt(id=0,off=14,r=14,imm=0) R10=fp0 5: (69) r3 = (u16 )(r1 +12) 6: (55) if r3 != 0x8 goto pc+9 R1_w=pkt(id=0,off=0,r=14,imm=0) R2_w=pkt_end(id=0,off=0,imm=0) R3_w=inv8 R10=fp0 7: (bf) r3 = r1 8: (07) r3 += 34 9: (2d) if r3 > r2 goto pc+6 R1=pkt(id=0,off=0,r=34,imm=0) R2=pkt_end(id=0,off=0,imm=0) R3=pkt(id=0,off=34,r=34,imm=0) R10=fp0 10: (71) r1 = (u8 )(r1 +23) 11: (55) if r1 != 0x1 goto pc+4 R1_w=inv1 R2=pkt_end(id=0,off=0,imm=0) R3=pkt(id=0,off=34,r=34,imm=0) R10=fp0 12: (18) r1 = 0xffff9abb4035e000 14: (b7) r2 = 11 15: (85) call bpf_trace_printk#6 cannot call GPL-restricted function from non-GPL compatible program processed 15 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 1

libbpf: -- END LOG -- libbpf: failed to load program 'ping' libbpf: failed to load object 'hello.bpf.o' Error: failed to load object file make: *** [Makefile:13: hello] Error 255

lizrice commented 1 year ago

I think this was fixed by #6 which added the missing license string that the verifier is complaining about. Do you have the latest code including that update?

sherwoodzern commented 1 year ago

Thank you.

That fixed the issue. I appreciate you taking the time to respond.

Sherwood Zern

From: Liz Rice @.> Date: Friday, June 2, 2023 at 5:27 PM To: lizrice/learning-ebpf @.> Cc: Sherwood Zern @.>, Author @.> Subject: [External] : Re: [lizrice/learning-ebpf] Chapter 8 Make fails (Issue #20)

I think this was fixed by #6https://urldefense.com/v3/__https:/github.com/lizrice/learning-ebpf/pull/6__;!!ACWV5N9M2RV99hQ!P2dbJii9kkQ8DDVdEc0ykfujfJsG6k7BmJ4kUMk6in4B07gZ3ozeG2ZvokM7VXPWNETcbJ9AkIP8fqNDF9jAzY5CMcDm$ which added the missing license string that the verifier is complaining about. Do you have the latest code including that update?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/lizrice/learning-ebpf/issues/20*issuecomment-1574334510__;Iw!!ACWV5N9M2RV99hQ!P2dbJii9kkQ8DDVdEc0ykfujfJsG6k7BmJ4kUMk6in4B07gZ3ozeG2ZvokM7VXPWNETcbJ9AkIP8fqNDF9jAzYhSQWm1$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIA2OM6DZWVLTC76CHK2IDTXJJLDFANCNFSM6AAAAAAYXSYVAM__;!!ACWV5N9M2RV99hQ!P2dbJii9kkQ8DDVdEc0ykfujfJsG6k7BmJ4kUMk6in4B07gZ3ozeG2ZvokM7VXPWNETcbJ9AkIP8fqNDF9jAzb81tk_5$. You are receiving this because you authored the thread.Message ID: @.***>