ptesarik / libkdumpfile

Kernel coredump file access
Other
23 stars 22 forks source link

0.5.4: FTBFS on 32-bit armel on Debian #80

Closed michel-slm closed 4 months ago

michel-slm commented 5 months ago

Forwarding here for visibility and in case someone has an idea how to fix (I'll take a look too as the package maintainer but a bit swamped with other things right now)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069557

> FAIL: test-fcache
> =================
> 
> length at 0:0: 4096 != 16384
> length at 1:0: 4096 != 16384
> length at 0:1: 4095 != 16383
> length at 1:1: 4095 != 16383
> FAIL test-fcache (exit status: 1)

The package is slated for removal from Debian testing on 2024-06-03 if this is unfixed.

ptesarik commented 5 months ago

This looks like page size mismatch. It might be a faulty test suite. Let me install a 32-bit armel Debian VM and have a look…

michel-slm commented 4 months ago

@ptesarik any update? I can try taking a look if you're busy

ptesarik commented 4 months ago

Hi @michel-slm! At first, I wasn't able to squeeze it into my schedule, but now I don't know how to install Debian armel. It seems that there are only armhf images for all devices I have at hand. Is it possible to install Debian armel under QEMU?

ptesarik commented 4 months ago

Hi @michel-slm! At first, I wasn't able to squeeze it into my schedule, but now I don't know how to install Debian armel. It seems that there are only armhf images for all devices I have at hand. Is it possible to install Debian armel under QEMU?

Never mind. I installed 32-bit armhf Debian and I can reproduce the issuse there as well.

ptesarik commented 4 months ago

There seems to be some confusion between mmap() and mmap64(). The test hijacks the mmap() library call to inject failures and verify that the file cache falls back to pread() in that case. Debian seems to do some nasty linker magic to remap the mmap symbol to mmap64, but this magic does not work for dlsym(), of course, and then the parameter types no longer match.

As a workaround, you can pass CFLAGS=-D_FILE_OFFSET_BITS=64 to ./configure. In fact, it is also a good idea in the long term, because kernel dump files tend to be larger than 2 GiB…

ptesarik commented 4 months ago

I had another look into this issue, and it's weird. Debian's gcc apparently defines _FILE_OFFSET_BITS=64 by default, so adding it to the command-line should be a no-op. I'm not sure why it made a difference for me. It might have been pure luck.

michel-slm commented 4 months ago

Thank you! I was a bit out of touch since I'm in the middle of traveling with spotty connections, but I'll try building with the fix backported next week