node-packer icon indicating copy to clipboard operation
node-packer copied to clipboard

Assertion `backup_off == lseek_off' failed.

Open cheongpeibin opened this issue 3 years ago • 2 comments

Hi guys, I am facing a crash when the binary is run as a binary in Ubuntu.

My workflow is the binary will be placed in a ubuntu:20.10 docker image, and then a supervisord process will run the compiled node-packer binary.

The issue is when there is a lot of usage, the binary will crash with the message: ../deps/libsquash/sample/enclose_io_unix.c:459: enclose_io_pread: Assertion `backup_off == lseek_off' failed.

I have researched the line causing the crash is: https://github.com/pmq20/node-packer/blob/03fb71b5d124af5e0f07f9e2fe1ca31bb35b11de/current/deps/libsquash/sample/enclose_io_unix.c#L580

But I don't understand this part of the code and thus unable to perform debugging.

I am using Nodec: 1.5.0 binary (the one pre-built by pmq20)

cheongpeibin avatar Sep 13 '20 02:09 cheongpeibin

@cheongpeibin Hi Pei Bin, thank you for reporting the issue. I briefly looked at the line. It appeared that the code there was trying to read the current offset value, record it in "backup_off", and then perform the pread. After the pread is performed, the code appears to be resuming the current offset from "backup_off". Apparently a lock / mutex is missing if this code was to run concurrently. This matches your description of "when there is a lot of usage". I'll open an issue in libsquash and find time to fix it. Meanwhile PR are greatly welcome!

pmq20 avatar Sep 20 '20 01:09 pmq20

@pmq20 Hi Minqi, thank you for your response. Appreciate your time looking at this! I'll keep an eye on the update. =D

cheongpeibin avatar Sep 20 '20 02:09 cheongpeibin