Bug 220447 - print/texinfo: crash with lang/perl5.26 + PERL_MALLOC
Summary: print/texinfo: crash with lang/perl5.26 + PERL_MALLOC
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-03 08:48 UTC by Ivan Rozhuk
Modified: 2017-07-04 18:38 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
Fix bad Perl frees in print/texinfo (1.37 KB, patch)
2017-07-04 11:50 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2017-07-03 08:48:00 UTC
Fail to build print/texinfo 6.4 with perl5.26 on 11.1 beta3
without PERL_MALLOC builds ok

...
gmake[6]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4/doc/tp_api'
gmake[5]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4/doc/tp_api'
gmake[5]: Entering directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4/doc'
restore=: && backupdir=".am$$" && \
rm -rf $backupdir && mkdir $backupdir && \
if (TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; top_srcdir=".." ; export top_srcdir ; top_builddir=".." ; export top_builddir ; /usr/local/bin/perl ../tp/texi2any --version) >/dev/null 2>&1; then \
  for f in texinfo.info texinfo.info-[0-9] texinfo.info-[0-9][0-9] texinfo.i[0-9] texinfo.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
if TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; top_srcdir=".." ; export top_srcdir ; top_builddir=".." ; export top_builddir ; /usr/local/bin/perl ../tp/texi2any   -I . \
 -o texinfo.info `test -f 'texinfo.texi' || echo './'`texinfo.texi; \
then \
  rc=0; \
else \
  rc=$?; \
  $restore $backupdir/* `echo "./texinfo.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
restore=: && backupdir=".am$$" && \
rm -rf $backupdir && mkdir $backupdir && \
if (TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; top_srcdir=".." ; export top_srcdir ; top_builddir=".." ; export top_builddir ; /usr/local/bin/perl ../tp/texi2any --version) >/dev/null 2>&1; then \
  for f in info-stnd.info info-stnd.info-[0-9] info-stnd.info-[0-9][0-9] info-stnd.i[0-9] info-stnd.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
if TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; top_srcdir=".." ; export top_srcdir ; top_builddir=".." ; export top_builddir ; /usr/local/bin/perl ../tp/texi2any   -I . \
 -o info-stnd.info `test -f 'info-stnd.texi' || echo './'`info-stnd.texi; \
then \
  rc=0; \
else \
  rc=$?; \
  $restore $backupdir/* `echo "./info-stnd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
Segmentation fault (core dumped)
gmake[5]: *** [Makefile:1297: info-stnd.info] Error 139
gmake[5]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
gmake[5]: *** [Makefile:1237: texinfo.info] Error 139
gmake[5]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4/doc'
gmake[4]: *** [Makefile:1440: all-recursive] Error 1
gmake[4]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4/doc'
gmake[3]: *** [Makefile:1196: all-recursive] Error 1
gmake[3]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4'
gmake[2]: *** [Makefile:1135: all] Error 2
gmake[2]: Leaving directory '/tmp/ports/usr/ports/print/texinfo/work/texinfo-6.4'
===> Compilation failed unexpectedly.
...

...
Loaded symbols for /usr/local/lib/perl5/5.26/mach/auto/Unicode/Normalize/Normalize.so
Error while reading shared library symbols:
../tp/Texinfo/MiscXS/.libs/MiscXS.so: No such file or directory.
Reading symbols from /usr/local/lib/perl5/5.26/mach/auto/re/re.so...done.
Loaded symbols for /usr/local/lib/perl5/5.26/mach/auto/re/re.so
Error while reading shared library symbols:
../tp/Texinfo/Convert/XSParagraph/.libs/XSParagraph.so: No such file or directory.
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000801acd044 in realloc () from /lib/libc.so.7
[New Thread 802016000 (LWP 101857/<unknown>)]
(gdb) bt
#0  0x0000000801acd044 in realloc () from /lib/libc.so.7
#1  0x0000000801acd5e1 in free () from /lib/libc.so.7
#2  0x0000000803ae3f76 in ?? ()
#3  0x0000000000f70650 in ?? ()
#4  0x0000000000f70638 in ?? ()
#5  0x00007fffffffce40 in ?? ()
#6  0x000000080119a78d in pthread_mutex_destroy () from /lib/libthr.so.3
#7  0x0000000803ae6942 in ?? ()
#8  0x0000000000000000 in ?? ()
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2017-07-04 11:50:36 UTC
Created attachment 184054 [details]
Fix bad Perl frees in print/texinfo

Here is a patch that fixes the issue for me.  Apparently texinfo calls the wrong free function for the result of bytes_to_utf8().  It should call Perl's own Safefree() instead of the system free().
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2017-07-04 12:23:27 UTC
assign to the right maintainer
Comment 4 Larry Rosenman freebsd_committer freebsd_triage 2017-07-04 13:18:39 UTC
Dimitry's patch fixes my print/texinfo build problem.  Can we get it committed?
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-07-04 15:28:29 UTC
A commit references this bug:

Author: sunpoet
Date: Tue Jul  4 15:28:07 UTC 2017
New revision: 445018
URL: https://svnweb.freebsd.org/changeset/ports/445018

Log:
  Fix incorrect frees

  PR:		220447
  Reported by:	Rozhuk Ivan <rozhuk.im@gmail.com>
  Submitted by:	dim

Changes:
  head/print/texinfo/files/
  head/print/texinfo/files/patch-tp-Texinfo-MiscXS-misc.c
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-07-04 15:28:46 UTC
Committed. Thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-07-04 18:38:08 UTC
A commit references this bug:

Author: sunpoet
Date: Tue Jul  4 18:37:28 UTC 2017
New revision: 445030
URL: https://svnweb.freebsd.org/changeset/ports/445030

Log:
  Bump PORTREVISION for package change [1]

  - Use REINPLACE_CMD instead of patch file

  PR:		220447 [1]

Changes:
  head/print/texinfo/Makefile
  head/print/texinfo/files/