intel / ACON

Apache License 2.0
57 stars 18 forks source link

The kernel panic occurs when adding blobs using image layer with size 0 #101

Closed yanxue-intel closed 4 months ago

yanxue-intel commented 7 months ago

The panic seems to be triggered by acond code (src/server.rs) at line 237, where it attempts to unwrap a ‘None‘’ value.

blobs details: [tdx@localhost .acon]$ ll blobs/sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b.tar -rw------- 1 tdx tdx 0 Apr 1 14:39 blobs/sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b.tar

painc details: 2024/04/01 15:28:03 Missing layers: 2024/04/01 15:28:03 [0]: "sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b" 2024/04/01 15:28:03 [1]: "sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b" 2024/04/01 15:28:03 [2]: "sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b" 2024/04/01 15:28:03 [3]: "sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b" 2024/04/01 15:28:03 AddBlob, URL: https://:10020/api/v1/blob/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b.tar?alg=2 2024/04/01 15:28:03 build multiform for data using 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b.tar ... thread 'main' panicked at src/server.rs:237:44: called Option::unwrap() on a None value note: run with RUST_BACKTRACE=1 environment variable to display a backtrace traps: acond[1] general protection fault ip:7fd99a396719 sp:7ffebe75cb60 error:0 in acond[7fd99a1b8000+4e1000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b CPU: 0 PID: 1 Comm: acond Not tainted 6.3.0-rc6-tde-20230418-00119-gdb5e84a614bb #3 Call Trace:

0xffffffffaed059c7 0xffffffffae8a5a03 0xffffffffae8aa290 0xffffffffae8aa5fc 0xffffffffae8b5552 0xffffffffae816679 ? 0xffffffffae8b2bd6 0xffffffffae908bea 0xffffffffaed2f719 0xffffffffaed2bcd5 0xffffffffaee011c6 RIP: 0033:0x00007fd99a396719 Code: 00 00 4c 89 c6 48 63 78 30 b8 c8 00 00 00 0f 05 b8 0e 00 00 00 48 8d 74 24 08 bf 01 00 00 00 48 c7 44 24 08 20 00 00 00 0f 05 bf 09 00 00 00 e8 c2 49 00 00 bf 7f 00 00 00 e8 a9 7d 00 00 53 RSP: 002b:00007ffebe75cb60 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00007fd99a396719 RDX: 0000000000000000 RSI: 00007ffebe75cb68 RDI: 0000000000000001 RBP: 00007ffebe75e068 R08: 0000000000000006 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fd99a749048 R14: 00007fd99a0fd230 R15: 0000000000000000

Kernel Offset: 0x2d800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--- 2024/04/01 15:28:13 Failed, AddBlob sha384/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b: AddBlob: error send request: Put " https://:10020/api/v1/blob/38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b.tar?alg=2": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

xiangquanliu commented 6 months ago

Acond fix - https://github.com/intel/ACON/commit/1c41335790e91087427afa27fbb62c080754babc