Skip to content

Perl_hv_store is not defined on unthreaded perls #24535

Description

@mauke

Description

Perl_hv_store is documented as API, but the only definition in core is in long_names.c, which is only available with threads. (All of long_names.c is under #ifdef USE_THREADS.) So if you try to use Perl_hv_store from XS/C and your perl was built without thread support, it breaks.

See e.g. the net-dialup/freeradius package in Gentoo, which is affected: https://bugs.gentoo.org/978687

Steps to Reproduce

I don't know how portable this is, but after make on Linux, libperl.a should exist and provide a Perl_hv_store symbol:

$ nm libperl.a | grep Perl_hv_store
$

Expected behavior

$ nm libperl.a | grep Perl_hv_store
0000000000000800 T Perl_hv_store

Perl_hv_store should be a real symbol on all configurations. (I don't understand why it is conditional on USE_THREADS.)

Perl configuration

Summary of my perl5 (revision 5 version 44 subversion 0) configuration:
  Derived from: 57f455aec1f783039270f4058af5c93ca22c431e
  Platform:
    osname=linux
    osvers=6.17.0-122035-tuxedo
    archname=x86_64-linux
    uname='linux luum 6.17.0-122035-tuxedo #35~24.04.1tux1 smp preempt_dynamic mon jun 15 14:27:53 utc 2026 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dcc=c-gcc -Dman1dir=none -Dman3dir=none -Duseshrplib -des -Dusedevel'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='c-gcc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='13.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='c-gcc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib /usr/lib64
    libs=-lpthread -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc
    libc=/lib/x86_64-linux-gnu/libc.so.6
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version='2.39'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/lib/perl5/5.44.0/x86_64-linux/CORE'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_STRTOLD
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_HASH_FUNC_SIPHASH13
    PERL_HASH_USE_SBOX32
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_DEVEL
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    RC1
    uncommitted-changes
  Built under linux
  Compiled at Jul  5 2026 13:13:48
  %ENV:
    PERLBREW_BASHRC_VERSION="0.74"
    PERLBREW_HOME="/home/mauke/.perlbrew"
    PERLBREW_MANPATH="/home/mauke/perl5/perlbrew/perls/perl-5.42.2/man"
    PERLBREW_PATH="/home/mauke/perl5/perlbrew/bin:/home/mauke/perl5/perlbrew/perls/perl-5.42.2/bin"
    PERLBREW_PERL="perl-5.42.2"
    PERLBREW_ROOT="/home/mauke/perl5/perlbrew"
    PERLBREW_VERSION="0.98"
    PERLDOC="-oman"
    PERL_UNICODE="SAL"
  @INC:
    lib
    /usr/local/lib/perl5/site_perl/5.44.0/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.44.0
    /usr/local/lib/perl5/5.44.0/x86_64-linux
    /usr/local/lib/perl5/5.44.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions