Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686620 - sci-libs/hdf5-1.10.5: "unaligned VL strings in compound" fails with SIGBUS on sparc
Summary: sci-libs/hdf5-1.10.5: "unaligned VL strings in compound" fails with SIGBUS on...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PullRequest, TESTFAILURE
Depends on:
Blocks: unaligned-access 733578
  Show dependency tree
 
Reported: 2019-05-23 19:07 UTC by Rolf Eike Beer
Modified: 2022-05-06 01:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (sci-libs_hdf5-1.10.5_use_iLRlG.xz,113.46 KB, application/x-xz)
2019-05-23 19:07 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer archtester 2019-05-23 19:07:45 UTC
Created attachment 577660 [details]
build.log

/bin/sh: line 64:   816 Bus error               srcdir="." ./${tname} >> ${log} 2>&1
============================
 dtypes  Test Log
============================
Testing non-aligned conversions (ALIGNMENT=1)....
Testing H5Tget_class()                                                 PASSED
Testing H5Tcopy()                                                      PASSED
Testing H5Tdetect_class()                                              PASSED
Testing compound datatypes                                             PASSED
Testing query functions of compound and enumeration types              PASSED
Testing transient datatypes                                            PASSED
Testing named datatypes                                                PASSED
Testing functions of encoding and decoding datatypes                   PASSED
Testing encoding datatypes with the 'use the latest format' flag       PASSED
Testing exceptions for int <-> float conversions                       PASSED
Testing indirectly reopening committed datatypes                       PASSED
Testing deleting objects that use named datatypes                      PASSED
Testing deleting objects that use named datatypes                      PASSED
Testing H5Tset/get_order for compound type                             PASSED
Testing string type creation using H5Tcreate                           PASSED
Testing deprected API routines for datatypes                           PASSED
Testing string conversions                                             PASSED
Testing random string conversion speed                                 PASSED
Testing some type functions for string                                 PASSED
Testing compound element reordering                                    PASSED
Testing compound subset conversions                                    PASSED
Testing compound element shrinking & reordering                        PASSED
Testing optimized struct converter                                     PASSED
Testing compound element growing                                       PASSED
Testing compound element insertion                                     PASSED
Testing packing compound datatypes                                     PASSED
Testing compound datatype with VL string                               PASSED
Testing array datatype of compound type with VL string                 PASSED
Testing registering type conversion routine with compound conversions  PASSED
Testing adjust size of compound datatypes                              PASSED
Testing compound datatypes of boundary size with latest format         PASSED
Testing unaligned VL strings in compound                              make[4]: *** [Makefile:3525: dtypes.chkexe_] Error 1
Comment 1 matoro archtester 2022-05-02 22:24:01 UTC
This still applies on sci-libs/hdf5-1.12.1-r1, but applying -fno-tree-ccp fixes it.
Comment 2 Larry the Git Cow gentoo-dev 2022-05-03 02:28:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a3fe05ed8aba8c04914b8dedd831ab1856a6e7f

commit 4a3fe05ed8aba8c04914b8dedd831ab1856a6e7f
Author:     matoro <matoro@users.noreply.github.com>
AuthorDate: 2022-05-03 01:33:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-03 02:05:52 +0000

    sci-libs/hdf5: Stabilize 1.10.5-r1 sparc, #733578
    
    Closes: https://bugs.gentoo.org/686620
    Signed-off-by: matoro <matoro@users.noreply.github.com>
    Closes: https://github.com/gentoo/gentoo/pull/25291
    Signed-off-by: Sam James <sam@gentoo.org>

 sci-libs/hdf5/hdf5-1.10.5-r1.ebuild | 7 ++++---
 sci-libs/hdf5/hdf5-1.10.5.ebuild    | 5 +++--
 sci-libs/hdf5/hdf5-1.12.1-r1.ebuild | 3 ++-
 sci-libs/hdf5/hdf5-1.12.1.ebuild    | 5 +++--
 4 files changed, 12 insertions(+), 8 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9acdbbd4c8debd771ac4a6e39c1073551f7ce43f

commit 9acdbbd4c8debd771ac4a6e39c1073551f7ce43f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-03 02:27:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-03 02:27:28 +0000

    sci-libs/hdf5: add 1.12.2
    
    Lots of correctness and sanitizer fixes in .2 so possibly helps
    with the sparc bug (although we've applied a workaround now anyway).
    
    Bug: https://bugs.gentoo.org/686620
    Signed-off-by: Sam James <sam@gentoo.org>

 sci-libs/hdf5/Manifest                             |   1 +
 .../hdf5/files/hdf5-1.12.2-cmake_installdirs.patch | 163 +++++++++++++++++++++
 sci-libs/hdf5/hdf5-1.12.2.ebuild                   | 119 +++++++++++++++
 3 files changed, 283 insertions(+)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-03 02:42:30 UTC
Discussed a bit in #gentoo-sparc but I'm optimistic about the situation improving here as upstream seem very interested in correctness fixes and are looking at sanitizers, etc.

Bit concerned about the option we're having to pass to avoid the SIGBUS as it's likely just avoiding UB but that's not an us problem, just that it's unlikely to be a compiler bug -- just avoiding an issue with upstream code. But it may well be fixed in later versions. Possibly in master if not in .2 which I just pushed.
Comment 4 matoro archtester 2022-05-03 03:57:35 UTC
Issue is NOT fixed in ~sci-libs/hdf5-1.12.2.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-03 04:04:22 UTC
(In reply to matoro from comment #4)
> Issue is NOT fixed in ~sci-libs/hdf5-1.12.2.

Thanks! Could you report upstream?

Did UBSAN catch it btw?
Comment 6 matoro archtester 2022-05-03 13:52:22 UTC
Does not get that far, dies during the build when it invokes one of its own binaries.

[1579/2275] cd /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src && /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/H5detect H5Tinit.c && /usr/bin/cmake -E touch gen_SRCS.stamp1
FAILED: src/gen_SRCS.stamp1 src/H5Tinit.c /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src/gen_SRCS.stamp1 /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src/H5Tinit.c 
cd /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src && /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/H5detect H5Tinit.c && /usr/bin/cmake -E touch gen_SRCS.stamp1
/var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2/src/H5detect.c:1275:5: runtime error: store to misaligned address 0x0100001c5001 for type 'short int', which requires 2 byte alignment
0x0100001c5001: note: pointer points here
 00 00 21  00 00 00 00 10 00 01 c5  00 00 00 00 00 00 00 00  ff 00 ff ff c7 c0 01 04  00 00 00 00 00
              ^ 
    #0 0x10000044b04 in detect_C89_integers (/var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/H5detect+0x44b04)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-04 04:41:37 UTC
(In reply to matoro from comment #6)
> Does not get that far, dies during the build when it invokes one of its own
> binaries.
> 
> [1579/2275] cd
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src &&
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/H5detect
> H5Tinit.c && /usr/bin/cmake -E touch gen_SRCS.stamp1
> FAILED: src/gen_SRCS.stamp1 src/H5Tinit.c
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src/gen_SRCS.
> stamp1
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src/H5Tinit.
> c 
> cd /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/src &&
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/H5detect
> H5Tinit.c && /usr/bin/cmake -E touch gen_SRCS.stamp1
> /var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2/src/H5detect.c:
> 1275:5: runtime error: store to misaligned address 0x0100001c5001 for type
> 'short int', which requires 2 byte alignment
> 0x0100001c5001: note: pointer points here
>  00 00 21  00 00 00 00 10 00 01 c5  00 00 00 00 00 00 00 00  ff 00 ff ff c7
> c0 01 04  00 00 00 00 00
>               ^ 
>     #0 0x10000044b04 in detect_C89_integers
> (/var/tmp/portage/sci-libs/hdf5-1.12.2-r1/work/hdf5-1.12.2_build/bin/
> H5detect+0x44b04)

OK, please file a bug.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-04 04:41:42 UTC
(upstream)
Comment 9 matoro archtester 2022-05-06 01:43:51 UTC
The entire offending code was ripped out in https://github.com/HDFGroup/hdf5/pull/1400 two weeks ago, but it doesn't cleanly apply backwards.  I'll keep an eye out for the next release keyword and check what state it's in then.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-06 01:58:42 UTC
(In reply to matoro from comment #9)
> The entire offending code was ripped out in
> https://github.com/HDFGroup/hdf5/pull/1400 two weeks ago, but it doesn't
> cleanly apply backwards.  I'll keep an eye out for the next release keyword
> and check what state it's in then.

Thanks. Trying master would be useful too if you get time but not critical.