Issue99

Title PamWriter test segfaults on alpine linux with gcc 6.4.0
Priority bug Status resolved
Superseder Nosy List admin
Assigned To
Keywords Orthanc Core

Created on 2018-08-08.23:57:14 by admin, last changed by admin.

Messages
msg455 (view) Author: admin Date: 2018-08-08.23:57:14
[BitBucket user: Miklós Espák]
[BitBucket date: 2018-08-08.21:57:14]

I built Orthanc 1.4.1 in an alpine:3.8 docker container.

The PamWriter.EndToEnd test crashes (segfault, core dumped).

The crash is at the first iteration of this loop:

https://hg.orthanc-server.com/orthanc/file/218854b02a71c1ba79b446bf4273179b0098ae48/Core/Images/PamReader.cpp#L214

Strangely, if I print out the loop variables (h and w) before the assignment in the inner loop, the crash does not happen and the test passes.

The issue may be related to that alpine uses musl libc, not glibc. The byte order is little endian.

I found that if I redefine the `__orthanc_bswap16` function just like here:

https://hg.orthanc-server.com/orthanc/file/218854b02a71c1ba79b446bf4273179b0098ae48/Core/Endianness.h#L146

then the crash goes away and the test passes.
msg456 (view) Author: admin Date: 2018-09-04.15:58:33
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-09-04.13:58:33]

Fix issue #99 (PamWriter test segfaults on alpine linux with gcc 6.4.0)

→ https://hg.orthanc-server.com/orthanc/changeset/6356e2ceb493
History
Date User Action Args
2026-07-29 15:51:22admincreate