e2fsprogs icon indicating copy to clipboard operation
e2fsprogs copied to clipboard

LXCFS bug possibly causing SIGFPE in fsck

Open jaskij opened this issue 3 years ago • 0 comments

I am not entirely sure if this is the right place for filing bugs, but here goes.

Due to a bug in lxcfs sysconf(_SC_NPROCESSORS_CONF) can return 0.

This seems to cause a division by zero in rw_bitmaps.c. Which in turn breaks builds when using OpenEmbedded under LXC.

A quick and dirty fix would be to simply change < to <= here.

A better way would probably involve using sched_getaffinity() together with the CPU_COUNT macro as an alternative source.

https://github.com/tytso/e2fsprogs/blob/96185e9bef1dca5a3b7d93f244d65107aad5f37f/lib/ext2fs/rw_bitmaps.c#L546-L568

jaskij avatar May 31 '22 10:05 jaskij