Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"*** glibc detected *** free(): invalid pointer" from Perl_mg_free #8487

Closed
p5pRT opened this issue Jun 19, 2006 · 6 comments
Closed

"*** glibc detected *** free(): invalid pointer" from Perl_mg_free #8487

p5pRT opened this issue Jun 19, 2006 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 19, 2006

Migrated from rt.perl.org#39528 (status was 'resolved')

Searchable as RT39528$

@p5pRT
Copy link
Author

p5pRT commented Jun 19, 2006

From cmr@financial.com

This is a bug report for perl from cmr@​financial.com,
generated with the help of perlbug 1.35 running under perl v5.8.5.


While installing some mod_perl webapp (ocsinventory) i tripped about a crash reoccuring all the time. It seems that something is passed to free() from Perl_mg_free which makes it crash. I made a stacktrace and did some debugging without any sucess​:

Here is the stacktrace​:

[Thread debugging using libthread_db enabled]
[New Thread 182925685056 (LWP 18808)]
*** glibc detected *** free()​: invalid pointer​: 0x000000552b78fd50 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread 182925685056 (LWP 18808)]
0x0000002a966252ed in raise () at ../string/bits/string2.h​:1000
1000 ++__result;
(gdb) bt
#0 0x0000002a966252ed in raise () at ../string/bits/string2.h​:1000
#1 0x0000002a96626a3e in abort () at ../string/bits/string2.h​:1000
#2 0x0000002a96659d41 in __libc_message (do_abort=Variable "do_abort" is not available.
) at ../sysdeps/unix/sysv/linux/libc_fatal.c​:145
#3 0x0000002a9665f81e in _int_free (av=0x2a96827620, mem=Variable "mem" is not available.
) at malloc.c​:5525
#4 0x0000002a9665fb66 in __libc_free (mem=Variable "mem" is not available.
) at malloc.c​:3404
#5 0x0000002a9a11f883 in Perl_mg_free (my_perl=0x552b0bbac0, sv=0x552b40f230) at mg.c​:389
#6 0x0000002a9a137ff6 in Perl_sv_clear (my_perl=0x552b0bbac0, sv=0x552b40f230) at sv.c​:5160
#7 0x0000002a9a13837d in Perl_sv_free (my_perl=0x552b0bbac0, sv=0x552b40f230) at sv.c​:5371
#8 0x0000002a9a137edd in Perl_sv_clear (my_perl=0x552b0bbac0, sv=0x552b76b770) at sv.c​:5223
#9 0x0000002a9a13837d in Perl_sv_free (my_perl=0x552b0bbac0, sv=0x552b76b770) at sv.c​:5371
#10 0x0000002a9a11f8cc in Perl_mg_free (my_perl=0x552b0bbac0, sv=0x552b40f250) at mg.c​:388
#11 0x0000002a9a137ff6 in Perl_sv_clear (my_perl=0x552b0bbac0, sv=0x552b40f250) at sv.c​:5160
#12 0x0000002a9a13837d in Perl_sv_free (my_perl=0x552b0bbac0, sv=0x552b40f250) at sv.c​:5371
#13 0x0000002a9a15d43c in Perl_free_tmps (my_perl=0x552b0bbac0) at scope.c​:189
#14 0x0000002a99f76762 in modperl_callback () from /etc/httpd/modules/mod_perl.so
#15 0x0000002a99f76ca9 in modperl_callback_run_handlers () from /etc/httpd/modules/mod_perl.so
#16 0x0000002a99f76eff in modperl_callback_per_dir () from /etc/httpd/modules/mod_perl.so
#17 0x0000002a99f722f0 in modperl_response_finish () from /etc/httpd/modules/mod_perl.so
#18 0x0000002a99f72566 in modperl_response_handler_cgi () from /etc/httpd/modules/mod_perl.so
#19 0x000000552aac79f3 in ap_run_handler (r=0x552b1ed858) at /usr/src/debug/httpd-2.0.52/server/config.c​:156
#20 0x000000552aac7eb1 in ap_invoke_handler (r=0x552b1ed858) at /usr/src/debug/httpd-2.0.52/server/config.c​:368
#21 0x000000552aac4cb8 in ap_process_request (r=0x552b1ed858) at /usr/src/debug/httpd-2.0.52/modules/http/http_request.c​:246
#22 0x000000552aac0089 in ap_process_http_connection (c=0x552b1e64e8) at /usr/src/debug/httpd-2.0.52/modules/http/http_core.c​:250
#23 0x000000552aad1693 in ap_run_process_connection (c=0x552b1e64e8) at /usr/src/debug/httpd-2.0.52/server/connection.c​:42
#24 0x000000552aac5b20 in child_main (child_num_arg=Variable "child_num_arg" is not available.
) at /usr/src/debug/httpd-2.0.52/server/mpm/prefork/prefork.c​:609
#25 0x000000552aac5dbd in make_child (s=0x552ac03620, slot=0) at /usr/src/debug/httpd-2.0.52/server/mpm/prefork/prefork.c​:649
#26 0x000000552aac5ea4 in startup_children (number_to_start=8) at /usr/src/debug/httpd-2.0.52/server/mpm/prefork/prefork.c​:721
#27 0x000000552aac65db in ap_mpm_run (_pconf=0x552abfe138, plog=Variable "plog" is not available.
) at /usr/src/debug/httpd-2.0.52/server/mpm/prefork/prefork.c​:940
#28 0x000000552aacccef in main (argc=2, argv=0x7fbffff998) at /usr/src/debug/httpd-2.0.52/server/main.c​:618

I only used CentOS RPM versions of the software playing together here (apache, mod_perl, perl) so if you need sources to verify you can get it from any CentOS-mirror directory centos/4.3/os/SRPMS/.

Chris



Flegs​:
  category=core
  severity=high


This perlbug was built using Perl v5.8.5 in the Red Hat build system.
It is being executed now by Perl v5.8.5 - Tue Dec 20 19​:07​:04 CST 2005.

Site configuration information for perl v5.8.5​:

Configured by Red Hat, Inc. at Tue Dec 20 19​:07​:04 CST 2005.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration​:
  Platform​:
  osname=linux, osvers=2.6.9-22.0.1.el, archname=x86_64-linux-thread-multi
  uname='linux x8664-build.centos.org 2.6.9-22.0.1.el #1 thu oct 27 14​:29​:45 cdt 2005 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Doptimize=-O2 -g -pipe -m64 -Dversion=5.8.5 -Dmyhostname=localhost -Dperladmin=root@​localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.5 -Dsitelib=/usr/lib/perl5/site_perl/5.8.5 -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.5 -Darchlib=/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi -Dsitearch=/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi -Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=define use64bitall=define uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
  optimize='-O2 -g -pipe -m64',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
  ccversion='', gccversion='3.4.4 20050721 (Red Hat 3.4.4-2)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =''
  libpth=/usr/local/lib64 /lib64 /usr/lib64
  libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
  gnulibc_version='2.3.4'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE'
  cccdlflags='-fPIC', lddlflags='-shared'

Locally applied patches​:
 


@​INC for perl v5.8.5​:
  /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
  /usr/lib/perl5/5.8.5
  /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
  /usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi
  /usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi
  /usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi
  /usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi
  /usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi
  /usr/lib/perl5/site_perl/5.8.5
  /usr/lib/perl5/site_perl/5.8.4
  /usr/lib/perl5/site_perl/5.8.3
  /usr/lib/perl5/site_perl/5.8.2
  /usr/lib/perl5/site_perl/5.8.1
  /usr/lib/perl5/site_perl/5.8.0
  /usr/lib/perl5/site_perl
  /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi
  /usr/lib64/perl5/vendor_perl/5.8.4/x86_64-linux-thread-multi
  /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi
  /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi
  /usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi
  /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi
  /usr/lib/perl5/vendor_perl/5.8.5
  /usr/lib/perl5/vendor_perl/5.8.4
  /usr/lib/perl5/vendor_perl/5.8.3
  /usr/lib/perl5/vendor_perl/5.8.2
  /usr/lib/perl5/vendor_perl/5.8.1
  /usr/lib/perl5/vendor_perl/5.8.0
  /usr/lib/perl5/vendor_perl
  .


Environment for perl v5.8.5​:
  HOME=/root
  LANG=de_DE
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/kerberos/sbin​:/usr/kerberos/bin​:/usr/local/sbin​:/usr/local/bin​:/sbin​:/bin​:/usr/sbin​:/usr/bin​:/usr/X11R6/bin​:/usr/java/jdk1.5.0_06/bin​:/root/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jun 25, 2006

From @nwc10

On Mon, Jun 19, 2006 at 06​:40​:28AM -0700, cmr @​ financial. com wrote​:

-----------------------------------------------------------------
While installing some mod_perl webapp (ocsinventory) i tripped about a crash reoccuring all the time. It seems that something is passed to free() from Perl_mg_free which makes it crash. I made a stacktrace and did some debugging without any sucess​:

Here is the stacktrace​:

[Thread debugging using libthread_db enabled]
[New Thread 182925685056 (LWP 18808)]
*** glibc detected *** free()​: invalid pointer​: 0x000000552b78fd50 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread 182925685056 (LWP 18808)]
0x0000002a966252ed in raise () at ../string/bits/string2.h​:1000
1000 ++__result;
(gdb) bt
#0 0x0000002a966252ed in raise () at ../string/bits/string2.h​:1000
#1 0x0000002a96626a3e in abort () at ../string/bits/string2.h​:1000
#2 0x0000002a96659d41 in __libc_message (do_abort=Variable "do_abort" is not available.
) at ../sysdeps/unix/sysv/linux/libc_fatal.c​:145
#3 0x0000002a9665f81e in _int_free (av=0x2a96827620, mem=Variable "mem" is not available.
) at malloc.c​:5525

Sadly this doesn't give me any clues as to what is going on.
Are you able to get this down to a smaller test case that only uses core
modules?

I only used CentOS RPM versions of the software playing together here (apache, mod_perl, perl) so if you need sources to verify you can get it from any CentOS-mirror directory centos/4.3/os/SRPMS/.

The volunteers on perl5-porters only really deal with the official releases of
perl released to CPAN. Can you replicate the problem with perl built from
CPAN source?

Otherwise, you should consider reporting the problem to whoever supports
the CentOS Perl.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Jun 25, 2006

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 2, 2006

From cmr@financial.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash​: SHA1

Thanks for looking into it. Unluckily i have not found time for this
issue lately. I reported this problem to the CentOS bugtracking also,
without any response so far. I will try the next release candidate of
ocsinventory wich is scheduled for 7/7/2006. If the problem persists i
try to find out where it happens, maybe with some help from the
ocsinventory guys.

Chris

-----BEGIN PGP SIGNATURE-----
Version​: GnuPG v1.4.2.1 (Cygwin)
Comment​: Using GnuPG with Mozilla - http​://enigmail.mozdev.org

iD8DBQFEqAMWsLjW0HYht7URAuZfAKDcN3NMg0ONQEDB68L2B4QK+9nq6QCfcKFK
Lfb8pO54HSqAu9hgKtVD4I0=
=IGir
-----END PGP SIGNATURE-----

@p5pRT
Copy link
Author

p5pRT commented Jul 3, 2006

From cmr@financial.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash​: SHA1

I have found a solution for this issue, i installed DBD​::MySQL version 2.9008 instead of
the provided 2.9004, the error dissapeared.

Chris
-----BEGIN PGP SIGNATURE-----
Version​: GnuPG v1.4.2.1 (Cygwin)
Comment​: Using GnuPG with Mozilla - http​://enigmail.mozdev.org

iD8DBQFEqQyusLjW0HYht7URAsGkAJwN20NS0XicZD3Lisx451zPDjMJ0QCfagPS
AuOn8jpmKwsIitg2IMYWdvY=
=3K7K
-----END PGP SIGNATURE-----

@p5pRT
Copy link
Author

p5pRT commented May 12, 2008

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant