ktock / container2wasm

Container to WASM converter
https://ktock.github.io/container2wasm-demo/
Apache License 2.0
1.97k stars 72 forks source link

Error on building wasm from ubutnu 18.04 docker container #250

Closed HankQuiter closed 5 months ago

HankQuiter commented 5 months ago

I got the following error when attempting to build an ubuntu 18.04 wasm from a docker container image. I tried under normal user I tried under sudo I tried under root user I tried to set the RUST_BACKTRACE to 1 but it didn't seem to alter the output so I have no further info. I tried setting it in the container and in the host.

First build

#116 [bochs-dev-packed 1/2] RUN /tools/wasi-vfs/wasi-vfs pack /Bochs/bochs/bochs --mapdir /pack::/minpack -o packed && mkdir /out
#116 66.52 panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:517:5
#116 66.66 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: the `wasi_vfs_pack_fs` function trapped
#116 66.66 
#116 66.66 Caused by:
#116 66.66     wasm trap: wasm `unreachable` instruction executed
#116 66.66     wasm backtrace:
#116 66.66         0: 0x579ce - <unknown>!<wasm function 543>
#116 66.66         1: 0x5af4f - <unknown>!<wasm function 570>
#116 66.66         2: 0x58cc4 - <unknown>!<wasm function 552>
#116 66.66         3: 0x2e623 - <unknown>!<wasm function 230>
#116 66.66         4: 0x36d30 - <unknown>!<wasm function 294>
#116 66.66         5: 0x3d2bd - <unknown>!<wasm function 331>
#116 66.66         6: 0x51863 - <unknown>!<wasm function 500>
#116 66.66     ', crates/wasi-vfs-cli/src/bin/wasi-vfs.rs:5:32
#116 66.66 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#116 ERROR: process "/bin/sh -c /tools/wasi-vfs/wasi-vfs pack /Bochs/bochs/bochs --mapdir /pack::/minpack -o packed && mkdir /out" did not complete successfully: exit code: 101
------
 > [bochs-dev-packed 1/2] RUN /tools/wasi-vfs/wasi-vfs pack /Bochs/bochs/bochs --mapdir /pack::/minpack -o packed && mkdir /out:
66.66     wasm backtrace:
66.66         0: 0x579ce - <unknown>!<wasm function 543>
66.66         1: 0x5af4f - <unknown>!<wasm function 570>
66.66         2: 0x58cc4 - <unknown>!<wasm function 552>
66.66         3: 0x2e623 - <unknown>!<wasm function 230>
66.66         4: 0x36d30 - <unknown>!<wasm function 294>
66.66         5: 0x3d2bd - <unknown>!<wasm function 331>
66.66         6: 0x51863 - <unknown>!<wasm function 500>
66.66     ', crates/wasi-vfs-cli/src/bin/wasi-vfs.rs:5:32
66.66 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------
container2wasm229370506:488
--------------------
 486 |     
 487 |     FROM bochs-dev-${OPTIMIZATION_MODE} AS bochs-dev-packed
 488 | >>> RUN /tools/wasi-vfs/wasi-vfs pack /Bochs/bochs/bochs --mapdir /pack::/minpack -o packed && mkdir /out
 489 |     ARG OUTPUT_NAME
 490 |     RUN mv packed /out/$OUTPUT_NAME
--------------------
ERROR: failed to solve: process "/bin/sh -c /tools/wasi-vfs/wasi-vfs pack /Bochs/bochs/bochs --mapdir /pack::/minpack -o packed && mkdir /out" did not complete successfully: exit code: 101
exit status 1
ktock commented 5 months ago

Maybe related to #230 . How large is your source image?

HankQuiter commented 5 months ago

Sorry, after sleeping on it and realizing what happened. This was being executed and filled my root drive. this is solved. Sorry for the premature issue.

ktock commented 5 months ago

Closing as it's solved.