Perl build error: Attempt to free unreferenced scalar

I've pulled the latest snapshot today. Compiling stopped with:

> make[2]: Entering directory '/home/user/openwrt/openwrt/feeds/packages/lang/perl'
> CFLAGS="-O2 -I/home/user/openwrt/openwrt/staging_dir/host/include -I/home/user/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/openwrt/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_glibc_eabi/host/include" CPPFLAGS="-I/home/user/openwrt/openwrt/staging_dir/host/include -I/home/user/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/openwrt/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_glibc_eabi/host/include" CXXFLAGS="" LDFLAGS="-L/home/user/openwrt/openwrt/staging_dir/host/lib -L/home/user/openwrt/openwrt/staging_dir/hostpkg/lib -L/home/user/openwrt/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_glibc_eabi/host/lib" make  -C /home/user/openwrt/openwrt/build_dir/hostpkg/perl/perl-5.28.1  
> make[3]: Entering directory '/home/user/openwrt/openwrt/build_dir/hostpkg/perl/perl-5.28.1'
> makefile:258: warning: ignoring prerequisites on suffix rule definition
> makefile:254: warning: ignoring prerequisites on suffix rule definition
> makefile:258: warning: ignoring prerequisites on suffix rule definition
> makefile:258: warning: ignoring prerequisites on suffix rule definition
> makefile:254: warning: ignoring prerequisites on suffix rule definition
> makefile:258: warning: ignoring prerequisites on suffix rule definition
> cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
>     opmini.o perlmini.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o  miniperlmain.o  -lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat 
> ./miniperl -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
> Attempt to free unreferenced scalar: SV 0x55fd849dfda8.
> /bin/sh: line 1: 1606906 Segmentation fault      (core dumped) ./miniperl -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>'
> Failed to build miniperl. Please run make minitest
> make[3]: *** [makefile:365: lib/buildcustomize.pl] Error 1
> make[3]: Leaving directory '/home/user/openwrt/openwrt/build_dir/hostpkg/perl/perl-5.28.1'
> make[2]: *** [Makefile:149: /home/user/openwrt/openwrt/build_dir/hostpkg/perl/perl-5.28.1/.built] Error 2
> make[2]: Leaving directory '/home/user/openwrt/openwrt/feeds/packages/lang/perl'
> time: package/feeds/packages/perl/host-compile#0.37#0.09#0.76

Environment: Arch Linux latest, gcc 9.x, binutils 2.34, -O2, glibc

Previous build was SNAPSHOT r13212-300b7fe85a / LuCI Master git-20.130.24305-e5fe16c compiling without any issue. Didn't change anything on .config.

So far I've found this: https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg52761.html

Maybe someone has a hint for me.

Possibly incompatibility between stack protector and gcc? You are using nonstandard tools (gcc9, glibc, binutils 234), so you may hit some incompatibility corner cases.

I thought to mention the possibility after reading
http://lists.infradead.org/pipermail/openwrt-devel/2020-May/023612.html is

You might test with more vanilla tools.

1 Like

Probably related https://github.com/openwrt/packages/issues/12262

1 Like

Thx for input hnyman and ynezz,

I don't know how I missed your link ynezz. But that exactly describes my issue. I never had choosen perl in any config. But I realized that on older builds perl is compiled also. So I thought it is needed just as a helper for other packages.

Thread starter included a workaround (which I will try and report back):

If package/feeds/packages/perl symlink is removed manually, then build succeed.

EDIT: The workaround is valid. For my build I just had to drop ipmark which requires kmod-xtables which requires perl. Other packages like samba4 are in need of perl too. Several packages are indicated by the Makefile.

EDIT 2: OK Firewall is completley fkd w/o xtables. ... So not a real workaround :smiley:

EDIT 3: Someone posted a patch:

It' working for me on master.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.