Subject: | Publishing large message results to segmentation fault (core dump) |
Hey guys,
I came across an issue, where publishing large message results to segmentation fault.
Coro version 999 required--this is only version 6.55.
AnyEvent::RabbitMQ version 999 required--this is only version 1.22.
Here is a simple snippet of my code:
#!/usr/bin/env perl
use strict;
use warnings;
use Net::RabbitFoot;
my $rf = Net::RabbitFoot->new()->load_xml_spec()->connect(
host => 'localhost',
port => 5672,
user => 'guest',
pass => 'guest',
vhost => '/',
);
my $ch = $rf->open_channel();
$ch->declare_exchange(exchange => 'test_x');
$ch->publish(
exchange => 'test_x',
routing_key => 'test_r',
body => 'x' x 140_000,
);
The result:
$ perl rabbit.pl
Segmentation fault (core dumped)
$ gdb /usr/bin/perl perl.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `perl rabbit.pl'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libcrypt.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.5
Reading symbols from /lib/libutil.so.9...(no debugging symbols found)...done.
Loaded symbols for /lib/libutil.so.9
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/List/Util/Util.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/List/Util/Util.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/List/MoreUtils/XS/XS.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/List/MoreUtils/XS/XS.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Cwd/Cwd.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Cwd/Cwd.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Params/Util/Util.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Params/Util/Util.so
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/Socket/Socket.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/Socket/Socket.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Guard/Guard.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Guard/Guard.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Sub/Name/Name.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Sub/Name/Name.so
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/B/B.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/B/B.so
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/Data/Dumper/Dumper.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/Data/Dumper/Dumper.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Encode/Encode.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Encode/Encode.so
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/Fcntl/Fcntl.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/Fcntl/Fcntl.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Storable/Storable.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Storable/Storable.so
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/IO/IO.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/IO/IO.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/XML/LibXML/LibXML.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/XML/LibXML/LibXML.so
Reading symbols from /usr/local/lib/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libxml2.so.2
Reading symbols from /usr/lib/liblzma.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/liblzma.so.5
Reading symbols from /lib/libz.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /usr/local/lib/perl5/5.30/mach/auto/POSIX/POSIX.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/5.30/mach/auto/POSIX/POSIX.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Variable/Magic/Magic.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Variable/Magic/Magic.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Package/Stash/XS/XS.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Package/Stash/XS/XS.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Coro/State/State.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Coro/State/State.so
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/EV/EV.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/EV/EV.so
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/local/lib/perl5/site_perl/mach/5.30/auto/Coro/EV/EV.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/mach/5.30/auto/Coro/EV/EV.so
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x0000000806a06b91 in boot_EV () from /usr/local/lib/perl5/site_perl/mach/5.30/auto/EV/EV.so
(gdb) bt
#0 0x0000000806a06b91 in boot_EV () from /usr/local/lib/perl5/site_perl/mach/5.30/auto/EV/EV.so
#1 0x0000000800b1a850 in Perl_pp_entersub () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#2 0x0000000800b102ba in Perl_runops_standard () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#3 0x0000000800a7bdb3 in Perl_call_sv () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#4 0x0000000800b27800 in Perl_sv_clear () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#5 0x0000000800b26c90 in Perl_sv_clear () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#6 0x0000000800b27a59 in Perl_sv_free2 () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#7 0x0000000800b1be44 in Perl_sv_clean_objs () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#8 0x0000000800a77586 in perl_destruct () from /usr/local/lib/perl5/5.30/mach/CORE/libperl.so.5.30
#9 0x0000000000400f7c in main ()
$ perl -V
Summary of my perl5 (revision 5 version 30 subversion 0) configuration:
Platform:
osname=freebsd
osvers=11.3-release-p5
archname=amd64-freebsd-thread-multi
uname='freebsd repo.irisns.com 11.3-release-p5 freebsd 11.3-release-p5 amd64 '
config_args='-sde -Dprefix=/usr/local -Dlibperl=libperl.so.5.30.0 -Darchlib=/usr/local/lib/perl5/5.30/mach -Dprivlib=/usr/local/lib/perl5/5.30 -Dman3dir=/usr/local/lib/perl5/5.30/perl/man/man3 -Dman1dir=/usr/local/lib/perl5/5.30/perl/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/mach/5.30 -Dsitelib=/usr/local/lib/perl5/site_perl -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/site_perl/man/man3 -Dsiteman1dir=/usr/local/lib/perl5/site_perl/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dusenm=n -Dcc=cc -Duseshrplib -Dinc_version_list=none -Dcf_by=mat -Dcf_email=mat@FreeBSD.org -Dcf_time=Wed May 22 09:36:05 UTC 2019 -Alddlflags=-L/wrkdirs/usr/ports/lang/perl5.30/work/perl-5.30.0 -L/usr/local/lib/perl5/5.30/mach/CORE -lperl -Dshrpldflags=$(LDDLFLAGS:N-L/wrkdirs/usr/ports/lang/perl5.30/work/perl-5.30.0:N-L/usr/local/lib/perl5/5.30/mach/CORE:N-lperl) -Wl,-soname,$(LIBPERL:R) -Doptimize=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Dusedtrace -Ui_gdbm -Dusemultiplicity=y -Duse64bitint -Dusemymalloc=n -Dusethreads=y'
hint=recommended
useposix=true
d_sigaction=define
useithreads=define
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2'
optimize='-O2 -pipe -fstack-protector-strong -fno-strict-aliasing '
cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='4.2.1 Compatible FreeBSD Clang 8.0.0 (tags/RELEASE_800/final 356365)'
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='cc'
ldflags ='-pthread -Wl,-E -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib /usr/lib/clang/8.0.0/lib /usr/lib
libs=-lpthread -lm -lcrypt -lutil
perllibs=-lpthread -lm -lcrypt -lutil
libc=
so=so
useshrplib=true
libperl=libperl.so.5.30.0
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.30/mach/CORE'
cccdlflags='-DPIC -fPIC'
lddlflags='-shared -L/usr/local/lib/perl5/5.30/mach/CORE -lperl -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
MULTIPLICITY
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_ITHREADS
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
USE_REENTRANT_API
Built under freebsd
@INC:
/usr/local/lib/perl5/site_perl/mach/5.30
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.30/mach
/usr/local/lib/perl5/5.30
Does anyone have a clue, what might be causing that? Reducing the message to 70k chars does publish without issue.
Thank you.
Kind regards,