Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 950271

Summary: dev-vcs/subversion-1.14.5 segfault when checking out a project
Product: Gentoo Linux Reporter: Kostadin Shishmanov <kostadinshishmanov>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: dilfridge, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119016
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 932474    

Description Kostadin Shishmanov 2025-02-25 10:19:03 UTC
dev-vcs/subversion-1.14.5 segfaults when checking out a project, building with `-mavx -O3 -pipe` seems to be enough to make it crash. Tested using `svn checkout https://svn.code.sf.net/p/sdcc/code/trunk/sdcc`

```
Thread 1 (Thread 0x7fb5f533d7c0 (LWP 418455)):
#0  0x00007fb5f5be084d in svn_eol__find_eol_start (buf=<optimized out>, buf@entry=0x564804d4a48b "   bug3379723.c\n*/\n\n#include <testfwk.h>\n\n#if !defined(PORT_HOST) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined(__SDCC_sm83) && "..., len=<optimized out>, len@entry=838) at subversion/libsvn_subr/eol.c:43
#1  0x00007fb5f5c0d2ca in translate_chunk (dst=dst@entry=0x564804d56840, b=0x56480490dec0, buf=<optimized out>, buflen=<optimized out>, pool=<optimized out>) at subversion/libsvn_subr/subst.c:1152
#2  0x00007fb5f5c0e91d in translated_stream_read (baton=0x56480490de20, buffer=0x564804d4f498 "/*\n   bug2686159.c\n */\n\n#include <testfwk.h>\n\n#ifdef __SDCC_pic16\n# define ADDRESS(x) (0x02 ## x)\n#elif defined(__SDCC_pic14)\n# define ADDRESS(x) (0x01A0 + 0x ## x)\n#elif defined(__SDCC_stm8)\n# define"..., len=0x7ffe9abfae10) at subversion/libsvn_subr/subst.c:1297
#3  0x00007fb5f5c08647 in svn_stream_copy3 (from=0x56480490de60, to=0x564804d49548, cancel_func=cancel_func@entry=0x7fb5f5bcffb0 <check_cancel>, cancel_baton=cancel_baton@entry=0x0, scratch_pool=scratch_pool@entry=0x56480490c6f8) at subversion/libsvn_subr/stream.c:423
#4  0x00007fb5f5d01d45 in run_file_install (wqb=0x7ffe9abfaf90, db=0x56480464e268, work_item=<optimized out>, wri_abspath=0x5648049de410 "/home/kostadin/sdcc/support/regression/tests", cancel_func=0x7fb5f5bcffb0 <check_cancel>, cancel_baton=0x0, scratch_pool=0x56480490c6f8) at subversion/libsvn_wc/workqueue.c:580
#5  0x00007fb5f5d02fdd in dispatch_work_item (wqb=<optimized out>, db=<optimized out>, wri_abspath=<optimized out>, work_item=<optimized out>, cancel_func=<optimized out>, cancel_baton=<optimized out>, scratch_pool=<optimized out>) at subversion/libsvn_wc/workqueue.c:1441
#6  svn_wc__wq_run (db=0x56480464e268, wri_abspath=0x5648049de410 "/home/kostadin/sdcc/support/regression/tests", cancel_func=0x7fb5f5bcffb0 <check_cancel>, cancel_baton=0x0, scratch_pool=scratch_pool@entry=0x5648049de2a8) at subversion/libsvn_wc/workqueue.c:1546
#7  0x00007fb5f5cc4f0c in close_directory (dir_baton=0x5648049de320, pool=<optimized out>) at subversion/libsvn_wc/update_editor.c:2819
#8  0x00007fb5f55c89b3 in maybe_close_dir (dir=<optimized out>) at subversion/libsvn_ra_serf/update.c:738
#9  0x00007fb5f55ce0fc in handle_response_cb (request=0x5648048aee18, response=<optimized out>, baton=0x5648048a0ff0, response_pool=0x564804d46468) at subversion/libsvn_ra_serf/util.c:1540
#10 0x00007fb5f5393f8e in serf.process_connection () from /usr/lib64/libserf-1.so.1
#11 0x00007fb5f5394815 in serf_event_trigger () from /usr/lib64/libserf-1.so.1
#12 0x00007fb5f5394989 in serf_context_run () from /usr/lib64/libserf-1.so.1
#13 0x00007fb5f55cd7b1 in svn_ra_serf__context_run (sess=0x564804679c60, waittime_left=0x7ffe9abfb3a0, scratch_pool=0x5648047128b8) at subversion/libsvn_ra_serf/util.c:913
#14 svn_ra_serf__context_run (sess=0x564804679c60, waittime_left=0x7ffe9abfb3a0, scratch_pool=0x5648047128b8) at subversion/libsvn_ra_serf/util.c:902
#15 0x00007fb5f55c998d in process_editor_report (ctx=0x564804661b28, handler=0x564804690a08, scratch_pool=0x564804690878) at subversion/libsvn_ra_serf/update.c:2429
#16 finish_report (report_baton=0x564804661b28, pool=<optimized out>) at subversion/libsvn_ra_serf/update.c:2504
#17 0x00007fb5f5c868d0 in svn_wc_crawl_revisions5 (wc_ctx=<optimized out>, local_abspath=local_abspath@entry=0x56480465f8a0 "/home/kostadin/sdcc", reporter=0x7fb5f55df960 <ra_serf_reporter>, report_baton=0x564804661b28, restore_files=restore_files@entry=1, depth=depth@entry=svn_depth_unknown, honor_depth_exclude=1, depth_compatibility_trick=0, use_commit_times=0, cancel_func=0x7fb5f5bcffb0 <check_cancel>, cancel_baton=0x0, notify_func=0x5647fc07f070 <svn_cl__check_externals_failed_notify_wrapper>, notify_baton=0x7ffe9abfb9e0, scratch_pool=0x56480465f788) at subversion/libsvn_wc/adm_crawler.c:859
#18 0x00007fb5f5dbb741 in update_internal (result_rev=result_rev@entry=0x0, timestamp_sleep=timestamp_sleep@entry=0x7ffe9abfb91c, conflicted_paths=conflicted_paths@entry=0x0, ra_session_p=<optimized out>, local_abspath=local_abspath@entry=0x56480465f8a0 "/home/kostadin/sdcc", anchor_abspath=anchor_abspath@entry=0x564804661350 "/home/kostadin/sdcc", revision=0x7ffe9abfb790, depth=svn_depth_unknown, depth_is_sticky=0, ignore_externals=0, allow_unver_obstructions=0, adds_as_modification=1, notify_summary=1, ctx=0x56480464e180, result_pool=0x56480465f788, scratch_pool=0x56480465f788) at subversion/libsvn_client/update.c:560
#19 0x00007fb5f5dbbc8c in svn_client__update_internal (result_rev=result_rev@entry=0x0, timestamp_sleep=timestamp_sleep@entry=0x7ffe9abfb91c, local_abspath=local_abspath@entry=0x56480465f8a0 "/home/kostadin/sdcc", revision=revision@entry=0x7ffe9abfb870, depth=depth@entry=svn_depth_unknown, depth_is_sticky=depth_is_sticky@entry=1, ignore_externals=0, allow_unver_obstructions=0, adds_as_modification=1, make_parents=0, innerupdate=0, ra_session=<optimized out>, ctx=0x56480464e180, pool=0x56480465f788) at subversion/libsvn_client/update.c:696
#20 0x00007fb5f5d5336d in svn_client__checkout_internal (result_rev=result_rev@entry=0x0, timestamp_sleep=timestamp_sleep@entry=0x7ffe9abfb91c, url=url@entry=0x56480465e1f8 "https://svn.code.sf.net/p/sdcc/code/trunk/sdcc", local_abspath=0x56480465f8a0 "/home/kostadin/sdcc", peg_revision=peg_revision@entry=0x7ffe9abfb9d0, revision=revision@entry=0x7ffe9abfb9c0, depth=svn_depth_unknown, ignore_externals=0, allow_unver_obstructions=0, ra_session=<optimized out>, ctx=0x56480464e180, scratch_pool=0x56480465f788) at subversion/libsvn_client/checkout.c:189
#21 0x00007fb5f5d53594 in svn_client_checkout3 (result_rev=result_rev@entry=0x0, URL=0x56480465e1f8 "https://svn.code.sf.net/p/sdcc/code/trunk/sdcc", path=<optimized out>, peg_revision=peg_revision@entry=0x7ffe9abfb9d0, revision=revision@entry=0x7ffe9abfb9c0, depth=svn_depth_unknown, ignore_externals=0, allow_unver_obstructions=0, ctx=0x56480464e180, pool=0x56480465f788) at subversion/libsvn_client/checkout.c:218
#22 0x00005647fc06bef2 in svn_cl__checkout (os=<optimized out>, baton=<optimized out>, pool=<optimized out>) at subversion/svn/checkout-cmd.c:168
#23 0x00005647fc08b7eb in sub_main (exit_code=exit_code@entry=0x7ffe9abfbe34, argc=argc@entry=3, cmdline_argv=cmdline_argv@entry=0x7ffe9abfbf68, pool=pool@entry=0x56480464c638) at subversion/svn/svn.c:3263
#24 0x00005647fc06983f in main (argc=3, argv=0x7ffe9abfbf68) at subversion/svn/svn.c:3348
```

```
subversion/libsvn_subr/eol.c:43:21: runtime error: load of misaligned address 0x56302447f98b for type 'const apr_uintptr_t', which requires 8 byte alignment
0x56302447f98b: note: pointer points here
 00  2f 2a 0a 20 20 20 62 75  67 33 33 37 39 37 32 33  2e 63 0a 2a 2f 0a 0a 23  69 6e 63 6c 75 64 65
              ^ 
```
Comment 1 Kostadin Shishmanov 2025-02-25 10:19:49 UTC
Portage 3.0.67 (python 3.12.9-final-0, default/linux/amd64/23.0/desktop/plasma/systemd, gcc-15, glibc-2.41, 6.13.1-gentoo x86_64)
=================================================================
System uname: Linux-6.13.1-gentoo-x86_64-AMD_Ryzen_7_7800X3D_8-Core_Processor-with-glibc2.41
KiB Mem:    32435412 total,   2340696 free
KiB Swap:   32435196 total,  28577632 free
Timestamp of repository gentoo: Tue, 25 Feb 2025 06:48:39 +0000
Head commit of repository gentoo: dc54907eafac1609cc2ad3fb4d113fafda734af4

Timestamp of repository gentoo-unity7: Mon, 24 Feb 2025 23:18:34 +0000
Head commit of repository gentoo-unity7: 7fab738cce932e6697133183af55d2364217bd3f

Timestamp of repository guru: Mon, 24 Feb 2025 10:48:33 +0000
Head commit of repository guru: 4c2b1970af2ce39c6c34bd268e82924e2ad5c877

Timestamp of repository kde: Mon, 24 Feb 2025 21:03:33 +0000
Head commit of repository kde: 149585097b0e3d7679401086f3d8e1c6085b03a9

Timestamp of repository steam-overlay: Sat, 22 Feb 2025 22:18:37 +0000
Head commit of repository steam-overlay: 8e37c209480fdfa381e678eb68bce3f0bd586272

sh bash 5.2_p37
ld GNU ld (Gentoo 2.44 p1) 2.44.0
ccache version 4.10.2 [disabled]
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.31.5::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.6.1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0-r1::gentoo
dev-lang/python:           3.12.9::gentoo, 3.13.2::gentoo
dev-lang/rust-bin:         1.83.0-r1::gentoo, 1.84.1-r2::gentoo
dev-util/ccache:           4.10.2-r1::gentoo
llvm-core/clang:           19.1.7::gentoo
llvm-core/lld:             19.1.7::gentoo
llvm-core/llvm:            19.1.7::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          256.10::gentoo
sys-devel/binutils:        2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241221::gentoo, 15.0.1_pre20250216::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.13::gentoo (virtual/os-headers)
sys-libs/glibc:            2.41::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    eclass-overrides: local
    volatile: False

gentoo-unity7
    location: /var/db/repos/gentoo-unity7
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo-unity7.git
    masters: gentoo
    eclass-overrides: local
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    eclass-overrides: local
    volatile: False

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/kde.git
    masters: gentoo
    eclass-overrides: local
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    eclass-overrides: local
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    eclass-overrides: local
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -flto=auto -mtls-dialect=gnu2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=native -O3 -pipe -flto=auto -mtls-dialect=gnu2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O3 -pipe -flto=auto -mtls-dialect=gnu2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O3 -pipe -flto=auto -mtls-dialect=gnu2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="https://mirror.telepoint.bg/gentoo     http://mirror.telepoint.bg/gentoo     ftp://mirror.telepoint.bg/gentoo     rsync://mirror.telepoint.bg/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j12 VERBOSE=0 V=0"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="zstd"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C opt-level=3 -C codegen-units=1"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities amd64 branding bzip2 cairo cdda cdr crypt dbus declarative dri dts dvd dvdr encode exif flac gdbm gif gpm gtk gui iconv icu jpeg kde kf6compat kwallet lcms libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 qt6 readline screencast sdl seccomp semantic-desktop sound spell ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vaapi vorbis vulkan wayland widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib zstd" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 avx512_bf16 avx512_bitalg avx512_vbmi2 avx512_vnni avx512_vpopcntdq avx512bw avx512cd avx512dq avx512f avx512ifma avx512vbmi avx512vl f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby32" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-25 18:07:33 UTC
Do any svn tests fail?
Comment 3 Kostadin Shishmanov 2025-02-25 18:26:52 UTC
(In reply to Sam James from comment #2)
> Do any svn tests fail?

Only io-test fails, but that fails with just CFLAGS="-O2 -pipe" too, and there is already a bug for it - 938103, where gcc 14 is used, so it's entirely unrelated.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-25 19:22:21 UTC
ACK, thanks.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-25 19:23:07 UTC
```
~/bugs/subversion/subversion-1.14.5 $ ./configure CFLAGS="-O3 -mavx -ggdb3"
~/bugs/subversion/subversion-1.14.5 $ make
~/bugs/subversion/subversion-1.14.5 $ ./subversion/svn/svn checkout https://svn.code.sf.net/p/sdcc/code/trunk/sdcc
~/bugs/subversion/subversion-1.14.5 $ libtool --mode=execute valgrind --track-origins=yes ./subversion/svn/svn cleanup sdcc
==845064== Memcheck, a memory error detector
==845064== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==845064== Using Valgrind-3.25.0.GIT and LibVEX; rerun with -h for copyright info
==845064== Command: /home/sam/bugs/subversion/subversion-1.14.5/subversion/svn/.libs/svn cleanup sdcc
==845064==
==845064==
==845064== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==845064==  General Protection Fault
==845064==    at 0x4C4728D: svn_eol__find_eol_start (eol.c:43)
==845064==    by 0x4C73AC9: translate_chunk.isra.0 (subst.c:1152)
==845064==    by 0x4C7512C: translated_stream_read (subst.c:1297)
==845064==    by 0x4C6ED66: svn_stream_copy3 (stream.c:423)
==845064==    by 0x4993D04: run_file_install (workqueue.c:580)
==845064==    by 0x4994F9C: dispatch_work_item (workqueue.c:1441)
==845064==    by 0x4994F9C: svn_wc__wq_run (workqueue.c:1546)
==845064==    by 0x491D119: cleanup_internal (cleanup.c:109)
==845064==    by 0x491D119: svn_wc_cleanup4 (cleanup.c:189)
==845064==    by 0x4877BD7: do_cleanup (cleanup.c:78)
==845064==    by 0x4877BD7: svn_client_cleanup2 (cleanup.c:229)
==845064==    by 0x10DC29: svn_cl__cleanup (cleanup-cmd.c:104)
==845064==    by 0x12BADA: sub_main.constprop.0 (svn.c:3263)
==845064==    by 0x109AFE: main (svn.c:3348)
==845064==
==845064== HEAP SUMMARY:
==845064==     in use at exit: 591,430 bytes in 1,036 blocks
==845064==   total heap usage: 1,898 allocs, 431 frees, 751,938 bytes allocated
==845064==
==845064== LEAK SUMMARY:
==845064==    definitely lost: 13,905 bytes in 117 blocks
==845064==    indirectly lost: 6,341 bytes in 46 blocks
==845064==      possibly lost: 60,704 bytes in 16 blocks
==845064==    still reachable: 425,890 bytes in 1,239 blocks
==845064==         suppressed: 0 bytes in 0 blocks
==845064== Rerun with --leak-check=full to see details of leaked memory
==845064==
==845064== For lists of detected and suppressed errors, rerun with: -s
==845064== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Segmentation fault         (core dumped) libtool --mode=execute valgrind --track-origins=yes ./subversion/svn/svn cleanup sdcc
```
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-25 20:46:29 UTC
```
char *
svn_eol__find_eol_start(char *buf, apr_size_t len)
{
#if SVN_UNALIGNED_ACCESS_IS_OK

  /* Scan the input one machine word at a time. */
  for (; len > sizeof(apr_uintptr_t)
       ; buf += sizeof(apr_uintptr_t), len -= sizeof(apr_uintptr_t))
    {
      /* This is a variant of the well-known strlen test: */
      apr_uintptr_t chunk = *(const apr_uintptr_t *)buf;

      /* A byte in SVN__R_TEST is \0, iff it was \r in *BUF.
       * Similarly, SVN__N_TEST is an indicator for \n. */
      apr_uintptr_t r_test = chunk ^ SVN__R_MASK;
      apr_uintptr_t n_test = chunk ^ SVN__N_MASK;

      /* A byte in SVN__R_TEST can only be < 0x80, iff it has been \0 before
       * (i.e. \r in *BUF). Ditto for SVN__N_TEST. */
      r_test |= (r_test & SVN__LOWER_7BITS_SET) + SVN__LOWER_7BITS_SET;
      n_test |= (n_test & SVN__LOWER_7BITS_SET) + SVN__LOWER_7BITS_SET;

      /* Check whether at least one of the words contains a byte <0x80
       * (if one is detected, there was a \r or \n in CHUNK). */
      if ((r_test & n_test & SVN__BIT_7_SET) != SVN__BIT_7_SET)
        break;
    }

#endif

  /* The remaining odd bytes will be examined the naive way: */
  for (; len > 0; ++buf, --len)
    {
      if (*buf == '\n' || *buf == '\r')
        return buf;
    }

  return NULL;
}
```
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-26 11:42:04 UTC
Filed https://marc.info/?l=subversion-dev&m=174056933428992&w=2.
Comment 8 Larry the Git Cow gentoo-dev 2025-02-27 10:48:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f42125db69824af118a399c9cbb84080066ed84

commit 7f42125db69824af118a399c9cbb84080066ed84
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-02-27 10:47:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-27 10:47:53 +0000

    dev-vcs/subversion: fix unaligned access
    
    Fixes crash w/ GCC 15. It looks like this is what upstream are going to
    do as well.
    
    Bug: https://gcc.gnu.org/PR119016
    Closes: https://bugs.gentoo.org/950271
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/subversion-1.14.5-no-unaligned.patch     |  23 ++
 dev-vcs/subversion/subversion-1.14.5-r1.ebuild     | 447 +++++++++++++++++++++
 2 files changed, 470 insertions(+)