atomvm_lib icon indicating copy to clipboard operation
atomvm_lib copied to clipboard

priv.avm file cannot be read by packbeam 0.7.5

Open dougw-bc opened this issue 1 month ago • 1 comments

In trying to follow the instructions here: https://github.com/atomvm/atomvm_lib/blob/master/markdown/httpd.md#the-http-file-handler

i am unable to run packbeam list priv.avm on the generated priv.avm file, it results in an error like this:

packbeam: caught exception: {badmatch,
                             {error,beam_lib,
                              {not_a_beam_file, << binarydata... >>}}

The contents of the priv directory is an index.html file that i intend to serve up with the httpd file handler - which is also not really working, unsure if they are related issue.

When inspecting the contents of the priv.avm file with hexdump, it does look to contain the expected content - but maybe not in the right format? could be an issue with packbeam, but these are not packed beam files - as it correctly identified...

Thanks for any help!

dougw-bc avatar Nov 22 '25 18:11 dougw-bc

I have looked into this. It’s actually due to a bug in AtomVM/ExAtomVM. The Elixir version of packbeam is corrupting some of the chunks in a way that won’t allow them to be recognized by beam_lib in OTP-28. You should open an issue in atomvm/ExAtomVM repo.

UncleGrumpy avatar Nov 23 '25 00:11 UncleGrumpy