Dear all, recently my subversion build crashed on an internal repository of build scripts and patches. The operation
svn merge ^/package/pkgsrc/devel/patches-2025Q1 patches-cvs/ was suppose to merge back changes from one patches directory to another. This results in a segfault due to a NULL pointer dereference in uri_escape(). I can't/won't provide the repo for testing, but I do have a working copy that repeatedly is able to trigger the crash via svn revert -R patches-cvs/ svn merge ^/package/pkgsrc/devel/patches-2025Q1 patches-cvs/ I do not know how long that will be the case once I work on other parts of the repo. I hope the debugger output below quickly points to the core issue. Is it just a matter of catching the NULL path earlier? Or is it a bug that it occurs? I can try patches on the build, try to dig at places of the core file while I have it here. This is my build: svn, version 1.14.5 (r1922182) compiled May 9 2025, 13:04:48 on x86_64-debian-linux-gnu Copyright (C) 2024 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ The following repository access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.10 (compiled with 1.3.10) - handles 'http' scheme - handles 'https' scheme The following authentication credential caches are available: * Plaintext cache in /home/sw/.subversion * GPG-Agent It was prepared using gcc-13.3.0 (self-built) on Debian 12/x86-64. This is the console output: --- Merging r2227 through r2388 into 'patches-cvs': C patches-cvs/lang-tcl-fixup.patch C patches-cvs/x11-qt5-qtools-options.patch C patches-cvs/devel-py-pybind11-multiversion.patch C patches-cvs/wip-py-astropy-more-wip.patch C patches-cvs/x11-qt5-qtmultimedia-options.patch C patches-cvs/graphics-py-cairo-multiversion.patch C patches-cvs/mk-blas-bl3-stuff.patch C patches-cvs/math-arpack-mpi.patch C patches-cvs/math-plumed-added.patch C patches-cvs/graphics-vtk-buildlink.patch C patches-cvs/wip-armadillo-nominormess.patch C patches-cvs/graphics-opencv-blas.patch C patches-cvs/devel-hdf5-threadscxx.patch C patches-cvs/devel-py-build-multiversion.patch A patches-cvs/databases-postgresql14-server-parallel-make.patch A patches-cvs/devel-gdb-fixnewlibcbuildalreadyupstream.patch A patches-cvs/graphics-R-isoband-fixstack-hack.patch A patches-cvs/lang-perl5-ExtUils-LibList-nosuffixlibs.patch A patches-cvs/security-cyrus-sasl-digestmd5-fix.patch A patches-cvs/security-py-cryptography-opensslmurliarchlink.patch A patches-cvs/emulators-qemu-no-linux-user.patch A patches-cvs/x11-qt5-qtlocation-dropthatshit.patch A patches-cvs/devel-zlib-version-script.patch A patches-cvs/devel-py-llvmlite-buildifx.patch A patches-cvs/math-arpack-ng-pkgconfig.patch A patches-cvs/math-py-numba-update-and-openmp.patch A patches-cvs/biology-libpll-nopdf.patch C patches-cvs/lang-rust-rpathdirs.patch C patches-cvs/net-samba4-libnss-plist.patch C patches-cvs/sysutils-mc-smb.patch C patches-cvs/graphics-opencv-cpuopt.patch U patches-cvs --- Recording mergeinfo for merge of r2227 through r2388 into 'patches-cvs': G patches-cvs Summary of conflicts: Text conflicts: 1 Tree conflicts: 17 Searching tree conflict details for 'patches-cvs/devel-hdf5-threadscxx.patch' in repository: Checking r2388... Checking r2241... Checking r2239... Checking r2238... Checking r2235... Checking r2231... Checking r2229... Checking r2228... Checking r2227... Checking r2222... Checking r2388... Checking r2241... Checking r2239... Checking r2238... Checking r2235... Checking r2231... Checking r2229... Checking r2228... Checking r2227... Checking r2222... Checking r2388... Checking r2241... Checking r2239... Checking r2238... Checking r2235... Checking r2231... Checking r2229... Checking r2228... Checking r2227... Checking r2222... Checking r2221... Checking r2220... Checking r2216... Checking r1907... Checking r1902... Checking r1901... Checking r1900... Checking r1899... Checking r1898... Checking r1888... Checking r1877... Checking r1875... Checking r1874... Checking r1873... Checking r1872... Checking r1871... Checking r1870... Checking r1869... Checking r1868... Checking r1867... Checking r1866... Checking r1865... Checking r1864... Checking r1857... Checking r1856... Checking r1855... Checking r1854... Checking r1853... Checking r1852... Checking r1851... Checking r1850... Checking r1849... Checking r1848... Checking r1847... Checking r1846... Checking r1845... Checking r1844... Checking r1843... Checking r1842... Checking r1841... Checking r1840... Checking r1839... Checking r1836... Checking r1835... Checking r1834... Checking r1833... Checking r1832... Checking r1831... Checking r1826... Checking r1825... Checking r1824... Checking r1823... Checking r1697... Checking r1696... Checking r1691... Checking r1690... Checking r1689... Checking r1688... Checking r1687... Checking r1673... Checking r1671... Checking r1670... Checking r1666... Checking r1663... Checking r1658... Checking r1657... Checking r1655... Checking r1651... Checking r1627... Checking r1626... Checking r1624... Checking r1620... Checking r1611... Checking r1610... Checking r1606... Checking r1605... Checking r1602... Checking r1600... Checking r1589... Checking r1588... Checking r1587... Checking r1576... Checking r1566... Checking r1561... Checking r1560... Checking r1557... Checking r1552... Checking r1551... Checking r1530... Checking r1517... Checking r1515... Checking r1514... Checking r1513... Checking r1512... Checking r1510... Checking r1508... Checking r1339... Checking r1273... Checking r1264... Checking r1263... Checking r1261... Checking r1260... Checking r1258... Checking r1256... Checking r1253... Checking r1250... Checking r1224... Checking r1023... Checking r1008... Checking r1004... Checking r998... Checking r996... Checking r897... Checking r895... Checking r894... Checking r893... Checking r892... Checking r889... Checking r888... Checking r2388... Checking r2241... Checking r2239... Checking r2238... Checking r2235... Checking r2231... Checking r2229... Checking r2228... Checking r2227... Checking r2222... Checking r2221... Checking r2220... Checking r2216... Checking r1907... Checking r1902... Checking r1901... Checking r1900... Checking r1899... Checking r1898... Checking r1888... Checking r1877... Checking r1875... Checking r1874... Checking r1873... Checking r1872... Checking r1871... Checking r1870... Checking r1869... Checking r1868... Checking r1867... Checking r1866... Checking r1865... Checking r1864... Checking r1857... Checking r1856... Checking r1855... Checking r1854... Checking r1853... Checking r1852... Checking r1851... Checking r1850... Checking r1849... Checking r1848... Checking r1847... Checking r1846... Checking r1845... Checking r1844... Checking r1843... Checking r1842... Checking r1841... Checking r1840... Checking r1839... Checking r1836... Checking r1835... Checking r1834... Checking r1833... Checking r1832... Checking r1831... Checking r1826... Checking r1825... Checking r1824... Checking r1823... Checking r1697... Checking r1696... Checking r1691... Checking r1690... Checking r1689... Checking r1688... Checking r1687... Checking r1673... Checking r1671... Checking r1670... Checking r1666... Checking r1663... Checking r1658... Checking r1657... Checking r1655... Checking r1651... Checking r1627... Checking r1626... Checking r1624... Checking r1620... Checking r1611... Checking r1610... Checking r1606... Checking r1605... Checking r1602... Checking r1600... Checking r1589... Checking r1588... Checking r1587... Checking r1576... Checking r1566... Checking r1561... Checking r1560... Checking r1557... Checking r1552... Checking r1551... Checking r1530... Checking r1517... Checking r1515... Checking r1514... Checking r1513... Checking r1512... Checking r1510... Checking r1508... Checking r1339... Checking r1273... Checking r1264... Checking r1263... Checking r1261... Checking r1260... Checking r1258... Checking r1256... Checking r1253... Checking r1250... Checking r1224... Checking r1023... Checking r1008... Checking r1004... Checking r998... Checking r996... Checking r897... Checking r895... Checking r894... Checking r893... Checking r892... Checking r889... Checking r888... [segmentation fault] GNU gdb (Debian 13.1-3) 13.1 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /sw/env/gcc-13.3.0_openmpi-5.0.7.debugging/pkgsrc/2025Q1/bin/svn... [New LWP 1548221] warning: Section `.reg-xstate/1548221' in core file too small. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/sw/env/gcc-13.3.0_openmpi-5.0.7.debugging/pkgsrc/2025Q1/bin/svn merge ^/packag'. Program terminated with signal SIGSEGV, Segmentation fault. warning: Section `.reg-xstate/1548221' in core file too small. #0 uri_escape (pool=<optimized out>, table=<optimized out>, path=<optimized out>) at subversion/libsvn_subr/path.c:920 920 for (p = path; table[(unsigned char)*p]; ++p) (gdb) where #0 uri_escape (pool=<optimized out>, table=<optimized out>, path=<optimized out>) at subversion/libsvn_subr/path.c:920 #1 uri_escape (path=0x0, table=0x151281d4b1c0 <svn_uri.char_validity> "", pool=0x14a22d38) at subversion/libsvn_subr/path.c:908 #2 0x0000151281d1c61b in svn_path_url_add_component2 (url=0x14a23aa0 "svn://servername.some.domain.somewhere.else/sw", component=component@entry=0x0, pool=pool@entry=0x14a22d38) at subversion/libsvn_subr/path.c:1094 #3 0x0000151282079ac6 in conflict_tree_get_details_local_missing (conflict=0x14aa83d8, ctx=0x148c1ad8, scratch_pool=0x14a22d38) at subversion/libsvn_client/conflicts.c:2858 #4 0x0000151282074124 in svn_client_conflict_tree_get_details (conflict=conflict@entry=0x14aa83d8, ctx=ctx@entry=0x148c1ad8, scratch_pool=scratch_pool@entry=0x14a22d38) at subversion/libsvn_client/conflicts.c:12699 #5 0x000000000040f0a6 in handle_tree_conflict (scratch_pool=0x14a22d38, ctx=0x148c1ad8, conflict_stats=<optimized out>, pb=<optimized out>, path_prefix=<optimized out>, conflict=0x14aa83d8, printed_description=<synthetic pointer>, quit=<optimized out>, postponed=<synthetic pointer>, resolved=<synthetic pointer>) at subversion/svn/conflict-callbacks.c:1779 #6 resolve_conflict_interactively (external_failed=0x10, scratch_pool=<optimized out>, ctx=0x148c1ad8, conflict_stats=<optimized out>, pb=<optimized out>, path_prefix=<optimized out>, config=<optimized out>, editor_cmd=<optimized out>, conflict=<optimized out>, printed_description=<synthetic pointer>, printed_summary=<optimized out>, quit=<optimized out>, postponed=<synthetic pointer>, resolved=<synthetic pointer>) at subversion/svn/conflict-callbacks.c:2021 #7 svn_cl__resolve_conflict (quit=quit@entry=0x7ffc0561dcec, external_failed=external_failed@entry=0x7ffc0561dcf0, printed_summary=printed_summary@entry=0x7ffc0561dcf4, conflict=<optimized out>, accept_which=<optimized out>, editor_cmd=0x0, path_prefix=0x14a9d948 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel", pb=0x14a9d7f8, conflict_stats=0x148c06f0, ctx=0x148c1ad8, scratch_pool=0x14aa68f8) at subversion/svn/conflict-callbacks.c:2264 #8 0x0000000000421673 in conflict_walker (baton=0x7ffc0561dce0, conflict=<optimized out>, scratch_pool=<optimized out>) at subversion/svn/resolve-cmd.c:62 #9 0x00001512820843ef in conflict_status_walker (baton=0x7ffc0561dc00, local_abspath=0x14aa6b70 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel/patches-cvs/devel-hdf5-threadscxx.patch", status=<optimized out>, scratch_pool=0x14aa68f8) at subversion/libsvn_client/conflicts.c:13385 #10 0x0000151281fda17b in get_child_status (scratch_pool=0x14aa68f8, cancel_baton=0x0, cancel_func=0x151281cf8670 <check_cancel>, status_baton=0x7ffc0561dc00, status_func=0x151282084350 <conflict_status_walker>, get_all=0, ignore_patterns=0x14aa6d50, dirent=0x0, info=0x14aa70f0, local_abspath=0x14aa6b70 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel/patches-cvs/devel-hdf5-threadscxx.patch", wb=0x7ffc0561db30) at subversion/libsvn_wc/status.c:1446 #11 svn_wc__internal_walk_status (db=<optimized out>, local_abspath=local_abspath@entry=0x14aa6b70 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel/patches-cvs/devel-hdf5-threadscxx.patch", depth=depth@entry=svn_depth_infinity, get_all=get_all@entry=0, no_ignore=no_ignore@entry=0, ignore_text_mods=ignore_text_mods@entry=1, ignore_patterns=0x14aa6d50, status_func=0x151282084350 <conflict_status_walker>, status_baton=0x7ffc0561dc00, cancel_func=0x151281cf8670 <check_cancel>, cancel_baton=0x0, scratch_pool=0x14aa68f8) at subversion/libsvn_wc/status.c:2712 #12 0x0000151281fda2c8 in svn_wc_walk_status (wc_ctx=<optimized out>, local_abspath=local_abspath@entry=0x14aa6b70 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel/patches-cvs/devel-hdf5-threadscxx.patch", depth=depth@entry=svn_depth_infinity, get_all=get_all@entry=0, no_ignore=no_ignore@entry=0, ignore_text_mods=ignore_text_mods@entry=1, ignore_patterns=0x0, status_func=0x151282084350 <conflict_status_walker>, status_baton=0x7ffc0561dc00, cancel_func=0x151281cf8670 <check_cancel>, cancel_baton=0x0, scratch_pool=0x14aa68f8) at subversion/libsvn_wc/status.c:2752 #13 0x0000151282084573 in svn_client_conflict_walk (local_abspath=0x14aa6b70 "/path/to/work_copy/gcc-13.3.0_openmpi-5.0.7/pkgsrc/devel/patches-cvs/devel-hdf5-threadscxx.patch", depth=svn_depth_infinity, conflict_walk_func=conflict_walk_func@entry=0x421640 <conflict_walker>, conflict_walk_func_baton=conflict_walk_func_baton@entry=0x7ffc0561dce0, ctx=ctx@entry=0x148c1ad8, scratch_pool=scratch_pool@entry=0x14aa68f8) at subversion/libsvn_client/conflicts.c:13445 #14 0x0000000000421956 in svn_cl__walk_conflicts (targets=0x14a9d728, conflict_stats=conflict_stats@entry=0x148c06f0, opt_state=opt_state@entry=0x7ffc0561e020, ctx=ctx@entry=0x148c1ad8, scratch_pool=scratch_pool@entry=0x148c0678) at subversion/svn/resolve-cmd.c:129 #15 0x000000000041a92d in svn_cl__merge (os=<optimized out>, baton=<optimized out>, pool=0x148c0678) at subversion/svn/merge-cmd.c:555 #16 0x0000000000429cf9 in sub_main (exit_code=exit_code@entry=0x7ffc0561e284, argc=argc@entry=4, cmdline_argv=cmdline_argv@entry=0x7ffc0561e3b8, pool=pool@entry=0x148c0678) at subversion/svn/svn.c:3263 #17 0x00000000004097d3 in main (argc=4, argv=0x7ffc0561e3b8) at subversion/svn/svn.c:3348 (gdb) up #1 uri_escape (path=0x0, table=0x151281d4b1c0 <svn_uri.char_validity> "", pool=0x14a22d38) at subversion/libsvn_subr/path.c:908 908 uri_escape(const char *path, const char table[], apr_pool_t *pool) (gdb) up #2 0x0000151281d1c61b in svn_path_url_add_component2 (url=0x14a23aa0 "svn://servername.some.domain.somewhere.else/sw", component=component@entry=0x0, pool=pool@entry=0x14a22d38) at subversion/libsvn_subr/path.c:1094 1094 component = uri_escape(component, svn_uri__char_validity, pool); (gdb) up #3 0x0000151282079ac6 in conflict_tree_get_details_local_missing (conflict=0x14aa83d8, ctx=0x148c1ad8, scratch_pool=0x14a22d38) at subversion/libsvn_client/conflicts.c:2858 2858 url = svn_path_url_add_component2(repos_root_url, related_repos_relpath, (gdb) print related_repos_relpath $1 = 0x0 (gdb) up #4 0x0000151282074124 in svn_client_conflict_tree_get_details (conflict=conflict@entry=0x14aa83d8, ctx=ctx@entry=0x148c1ad8, scratch_pool=scratch_pool@entry=0x14a22d38) at subversion/libsvn_client/conflicts.c:12699 12699 SVN_ERR(ignore_authz_failures( Alrighty then, Thomas PS: This svn build was created withing the pkgsrc framework, where I do a bit of packaging (but not specifically the subversion package(s)). I just re-viewed the discussion about switching to CMake for the build system of subversion and the idea of asking distro packagers about their opinion, thread starting at https://lists.apache.org/thread/66lf0c5oyzyhfss6qzmtkb3v866y4dts . This was some time ago, but as I recently had to admit defeat trying to get a CMake-based scientific software build to accept my installed Boost, on top of various hurtful experience with rotting CMake builds (rotting in the sense of 'bit rot': code getting outdated, modern cmake and dependencies shifting, breaking stuff), I want to add a note that I really would like projects to either keep perfectly working autotools builds or switch to something else than CMake. CMake's strongest point is the huge network effect. The fact that one motivation for the CMake port was to align with the build system of subversion dependencies is a warning sign (even though I don't see cmake in the dependencies of subversion in pkgsrc at least). The build system of your dependencies should not matter. Ideally, the build system should not matter at all to the user. It should be orthogonal to the others, and not get in the way, playing with minimal interfaces. CMake is for integrating things under one rule. CMake builds have a history of collecting lots of custom hacks and each project working somewhat differently regarding things that used to have clear conventions with autotools builds, or even simpler systems. CMake's preference for handling libraries as /path/to/libfoo.so instead of -lfoo, along with idiosyncracies about rpath handling make controlling a build hard at times, especially for my use case that needs prefixes and library locations via RPATH/RUNPATH (preference for the former, a whole different discussion). When there are working pkg-config files and things like CFLAGS, LDFLAGS, CPATH, LD_RUN_PATH, LIBRARY_PATH etal. that make the compiler happy if nothing intervenes, the separate structure of .cmake config files for dependencies causes quite some headache — they make things simpler for Windows and individual (commercial, in-house) projects, probably, but are just added complexity on a Unix system/distribution context. This is gettin too long for a footnote, sorry. CMake-using projects have cost me a lot of happy neurons that shrieked and died in despair. This is not necessarily CMake itself, but the practices it bred. Please just make it behave nicely on Unix, respecting envionment variables, using pkg-config for dependencies. And try to keep any custom code really to a minimum — packagers get nightmares from expeditions into caves of custom cmake detection logic. Try not to be smart detecting stuff and always be prepared to let the user override things by setting variables. Do not use facilities of CMake to downlaod and build dependencies. Be prepared that things stop working in a few years as CMake policies come an go, things being deprecated and introduced. Shipping the build system (autotools generated scripts) with the sources has an advantage there: You don't have to work with the build system binary _I_ bring to the game, which might not like your setup anymore (like a number of projects needing new releases when CMake 4.x enters the scene). One nice example of CMake breaking your build is in json-c-0.18 (released last September). $ cd json-c-0.18 && cmake . # yes, it still supports in-tree build;-) CMake Deprecation Warning at tests/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. CMake Error at apps/CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. -- Configuring incomplete, errors occurred! You see one mine exploding and the other ticking: $ head -n 1 tests/CMakeLists.txt cmake_minimum_required(VERSION 3.9) $ head -n 2 apps/CMakeLists.txt | tail -n 1 cmake_minimum_required(VERSION 2.8) # see ../CMakeLists.txt for why 2.8 Does CMakeLists.txt say something about that? $ head -n 6 CMakeLists.txt # CMake 3.9 was released in 2017/07 # As of 2023, many versions of Linux, NetBSD and FreeBSD provide, # and many OpenWRT packages require, much newer CMake packages. # We're stopping before 3.10 because that version starts requiring # c++11, which isn't available on e.g HPUX. cmake_minimum_required(VERSION 3.9...3.12) Doesn't seem so. You as upstream have to invest continuous work to keep up with the cmake ecosystem, breaking your builds on the end-users/packagers machines, not just during release preparation. You really need to watch out for the legacy of CMake code you're collecting and ensure that you have someone ready who can fix it in 5 years. Or rather … users (packagers) will have to fix it. Even without subversion development and releases, development work is necessary on the build system, even for something innocent as requiring a minimum version that is too minimal. Also have fun with bisecting builds, where you may need older cmake versions around or older releases. PPS: Sorry again for hijacking my own thread. I could write an even longer essay about what irks me about CMake practices, and maybe of development practices of scientific sofware in particular, which often is intermittend abandonware by definition (of the employment structure of scientists). No need to lengthy replies. Just wanted to give my perspective and a little warning. -- Dr. Thomas Orgis HPC @ Universität Hamburg