libyal / libpff

Library and tools to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format
GNU Lesser General Public License v3.0
289 stars 74 forks source link

[PATCH] Memory tests fails on the riscv64 arch #94

Closed rhash closed 3 years ago

rhash commented 3 years ago

@joachimmetz, First, thanks for the continuous work on the project!

The test_library.sh fails on the riscv64 architecture with the message:

pff_test_record_entry.c:524 result (1) != -1 Unable to run test: libpff_record_entry_clone Testing: record_entry (FAIL)

Here is the description from the original Debian Bug #978485:

libpff fails to build on riscv64: https://buildd.debian.org/status/fetch.php?pkg=libpff&arch=riscv64&ver=20180714-2&stamp=1580068149&raw=0

This is due to fundamentally broken tests assuming that memcpy and memset can fail returning NULL, and interposing these libc functions in the tests with functions that sometimes return NULL. This tests should be simply removed as they do not make sense. See bug #978433 for more details as the same code is basically replicated in dozen of packages.

A simpler way to fix the issue for riscv64 is to disable all memory tests on this architecture, as it is already done for a long list of cases.

The patch with the fix: 04-disable-memory-tests-on-riscv64.patch.gz.

joachimmetz commented 3 years ago

Thx for the report, though these test will remain. The explanation of #978485 lacks nuance, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978433 has a better explanation. Yes memcpy and memset can be optimized out. Disabling the memory test for riscv64 should be fine. These tests are mainly intended as functional tests for CI not as build/deployment tests how Debian seems to be using them.

joachimmetz commented 3 years ago

https://github.com/libyal/libpff/commit/153af3824bfa8d4b23d40831b49e2fcc155e0d15