Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924153 - sys-devel/gcc-14: miscompiles dev-libs/icu-74.2 on x86 (testfw:$LD_LIBRARY_PATH icupkg -d icudt74l --list -x icudt74l.dat -o icudata.lst: Segmentation fault)
Summary: sys-devel/gcc-14: miscompiles dev-libs/icu-74.2 on x86 (testfw:$LD_LIBRARY_PA...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-14 925226
  Show dependency tree
 
Reported: 2024-02-09 11:38 UTC by Agostino Sarubbo
Modified: 2024-03-18 08:56 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,460.21 KB, text/plain)
2024-02-09 11:38 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-02-09 11:38:48 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-libs/icu-74.2 fails to compile.
Discovered on: x86 (internal ref: tinderbox_x86)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0014
Comment 1 Agostino Sarubbo gentoo-dev 2024-02-09 11:38:51 UTC
Created attachment 884602 [details]
build.log

build log and emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-11 13:05:40 UTC
a291237b628f419d7f7ac264dd7b42947b565222 is the first bad commit
commit a291237b628f419d7f7ac264dd7b42947b565222
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Oct 31 11:51:34 2023 -0400

    Remove simple ranges from trailing zero bitmasks.

    During the intersection operation, it can be helpful to remove any
    low-end ranges when the bitmask has trailing zeros.  This prevents
    obviously incorrect ranges from appearing without requiring a bitmask
    check.

            * value-range.cc (irange_bitmask::adjust_range): New.
            (irange::intersect_bitmask): Call adjust_range.
            * value-range.h (irange_bitmask::adjust_range): New prototype.

 gcc/value-range.cc | 30 ++++++++++++++++++++++++++++++
 gcc/value-range.h  |  2 ++
 2 files changed, 32 insertions(+)
bisect found first bad commit

$ contrib/git-descr.sh a291237b628f419d7f7ac264dd7b42947b565222
r14-5109-ga291237b628f41
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-11 13:18:44 UTC
==26485== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==26485== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==26485== Command: ../bin/icupkg -d ./out/build/icudt74l --list -x * /var/tmp/portage/dev-libs/icu-74.1/work/icu/source/data/in/icudt74l.dat -o out/tmp/icudata.lst
==26485==
==26485== Invalid write of size 1
==26485==    at 0x52A0110: memcpy (string_fortified.h:29)
==26485==    by 0x52A0110: uprv_copyArray64 (udataswp.cpp:172)
==26485==    by 0x52A0110: uprv_copyArray16(UDataSwapper const*, void const*, int, void*, UErrorCode*) (udataswp.cpp:160)
==26485==    by 0x52A0630: udata_swapDataHeader (udataswp.cpp:342)
==26485==    by 0x48694F1: icu::Package::readPackage(char const*) (package.cpp:483)
==26485==    by 0x10987F: main (icupkg.cpp:335)
==26485==  Address 0x54f2458 is 0 bytes after a block of size 201,216 alloc'd
==26485==    at 0x4842E4D: operator new(unsigned int) (vg_replace_malloc.c:476)
==26485==    by 0x10936B: main (icupkg.cpp:285)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-11 13:18:58 UTC
there's a lot of suspicious code wrt aliasing but -fno-strict-aliasing doesn't help
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-18 08:56:21 UTC
The upstream bug is complicated as it ended up having other reproducers which happen outside of ICU.

But ICU should be fixed now.

commit da6dcbbd28d6482e45d726d2ade0a5c301c1e500
Author: Sam James <sam@gentoo.org>
Date:   Mon Mar 18 04:44:19 2024 +0000

    sys-devel/gcc: add 14.0.1_pre20240317

    Closes: https://bugs.gentoo.org/920233
    Closes: https://bugs.gentoo.org/925873
    Closes: https://bugs.gentoo.org/927013
    Signed-off-by: Sam James <sam@gentoo.org>