free from wrong pool during global destruction

Hi Mattia, hi all,

I'm trying to debug occosional crashes (seg. faults) from Wx+threads, 
but I haven't even gotten close to tracking down the problem yet. My 
clueless idea was to build a debugging perl, debugging Alien::wxWidgets, 
debugging Wx.pm, and then have fun (or not) with gdb.

I get as far as compiling Wx. Here's what I do:

- Check out the current 5.10 maint branch of perl.
--> ./Configure -DDEBUGGING -Dusethreads -Duse64bitall -Dusedevel 
-DDEBUG_LEAKING_SCALARS -DPERL_USE_SAFE_PUTENV -de

The leaking scalars thing is to get more information about a memory leak 
from threads+Wx. The PERL_USE_SAFE_PUTENV is because an old thread 
suggested that the free-from-wrong-pool crashes are because of direct 
ENV manipulation from perl. Search this group for the subject of this 
mail for details.

Then, I run a look Alien::wxWidgets in the cpan shell and build it with:

perl Build.PL --debug --unicode

I need the --unicode. wxWidgets compiles, tests and installs okay. Next 
up, I build Wx.pm with:

perl Makefile.PL --wx-debug --wx-unicode

make goes well, but whenever I use this Wx, I get

perl -Iblib/lib -Iblib/arch -MWx -e1
panic: free from wrong pool during global destruction.

The same happens for make test, of course.

Now, I'm entirely stuck here. I have no idea how to debug this issue, my 
C debugging skills are sub-par. I'd love to hear how to get around this 
initial obstacle, but I'd even prefer to learn how to debug these issues 
myself. Any ideas how?

Best regards,
Steffen
0
nj88udd02
4/15/2009 9:00:47 AM
perl.wxperl.users 3070 articles. 0 followers. Follow

7 Replies
1870 Views

Similar Articles

[PageSpeed] 2
Get it on Google Play
Get it on Apple App Store

Hi all,

Steffen Mueller wrote:
> perl -Iblib/lib -Iblib/arch -MWx -e1
> panic: free from wrong pool during global destruction.
> 
> The same happens for make test, of course.
> 
> Now, I'm entirely stuck here. I have no idea how to debug this issue, my 
> C debugging skills are sub-par. I'd love to hear how to get around this 
> initial obstacle, but I'd even prefer to learn how to debug these issues 
> myself. Any ideas how?

I have some more data:

perl -MWx -e '$ENV{foo}="bar";'

crashes with:
panic: realloc from wrong pool at -e line 1.
panic: free from wrong pool during global destruction.

The former (realloc) error is coming from that ENV assignment for sure. 
If I run it in a larger app, a line with an ENV assignment is reported 
to be the culprit of the first panic.

So the issue seems to be related to what Mattia mentioned in the old 
thread I mentioned in my previous mail. Maybe the Configure flag that is 
supposed to disable direct ENV manipulation doesn't work correctly? This 
is what I get from perl -V:

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
   Commit id: 40edd7616a55c8335ed4178a5c0ad56ea437030f
   Platform:
     osname=linux, osvers=2.6.27-11-generic, 
archname=x86_64-linux-thread-multi
     uname='linux l3tsee 2.6.27-11-generic #1 smp wed apr 1 20:53:41 utc 
2009 x86_64 gnulinux '
     config_args='-Dprefix=/home/tsee/bleadperl/install_maint_5.10 
-DDEBUGGING -Dusethreads -Duse64bitall -Dusedevel 
-DDEBUG_LEAKING_SCALARS -DPERL_USE_SAFE_PUTENV -de'
     hint=recommended, useposix=true, d_sigaction=define 
 

     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='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING 
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2 -g',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING 
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
     ccversion='', gccversion='4.3.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='cc', ldflags =' -fstack-protector -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
     libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.8.90.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.8.90'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib 
-fstack-protector'


Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV
                         PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                         PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL
                         USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                         USE_PERLIO USE_REENTRANT_API
   Built under linux
   Compiled at Apr 15 2009 09:38:37
   %ENV:
     PERL5LIB="/home/tsee/src/Steffen/perl5lib"
   @INC:
     /home/tsee/src/Steffen/perl5lib
 
/home/tsee/bleadperl/install_maint_5.10/lib/5.10.0/x86_64-linux-thread-multi
     /home/tsee/bleadperl/install_maint_5.10/lib/5.10.0
 
/home/tsee/bleadperl/install_maint_5.10/lib/site_perl/5.10.0/x86_64-linux-thread-multi
     /home/tsee/bleadperl/install_maint_5.10/lib/site_perl/5.10.0
     .


Best regards,
Steffen
0
nj88udd02
4/15/2009 2:26:31 PM
Steffen Mueller <nj88udd02@sneakemail.com> writes:

> perl -MWx -e '$ENV{foo}="bar";'
> 
> crashes with:
> panic: realloc from wrong pool at -e line 1.
> panic: free from wrong pool during global destruction.

Wasn't this fixed some time ago?

In any case, I cannot reproduce it.

Fedora 10
perl 5.10.0
Wx 0.89

-- Johan
0
jvromans
4/15/2009 7:56:04 PM
Hi Johan,

Johan Vromans wrote:
> Steffen Mueller <nj88udd02@sneakemail.com> writes:
> 
>> perl -MWx -e '$ENV{foo}="bar";'
>>
>> crashes with:
>> panic: realloc from wrong pool at -e line 1.
>> panic: free from wrong pool during global destruction.
> 
> Wasn't this fixed some time ago?
> 
> In any case, I cannot reproduce it.
> 
> Fedora 10
> perl 5.10.0
> Wx 0.89

yes, but is yours a debugging perl? I found a thread where you and 
Mattia discuss this problem specifically with debugging perls. The 
workaround back then seemed to be to add the -DPERL_USE_SAFE_PUTENV, but 
that doesn't work for me with 5.10.x trunk (any more?).

(./Configure -DDEBUGGING -Dusethreads -Duse64bitall -Dusedevel 
-DDEBUG_LEAKING_SCALARS -DPERL_USE_SAFE_PUTENV -de and also debugging Wx 
and wxWidgets)

Best regards,
Steffen
0
nj88udd02
4/16/2009 8:30:59 AM
Steffen Mueller <nj88udd02@sneakemail.com> writes:

> yes, but is yours a debugging perl?

I'm using the Fedora production version:

  Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_TRACK_MEMPOOL PERL_USE_SAFE_PUTENV USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API

-- Johan
0
jvromans
4/16/2009 8:57:15 AM
Hi,

We are using perl (Latest Activestate on Windows + Unix) linked to a C++ pr=
ogram. Along with this C++ program we link the C++ Wx libs.

We also experiment such crashes in Perl. Despite this crash is said to be c=
orrected it still happens. As far as we could read some race conditions in =
internal threads of perl would be the cause ...

Kind regards,

Jean-Philippe


-----Original Message-----
From: Steffen Mueller [mailto:nj88udd02@sneakemail.com]=20
Sent: Thursday, April 16, 2009 10:31 AM
To: Johan Vromans
Cc: wxperl-users@perl.org
Subject: Re: free from wrong pool during global destruction

Hi Johan,

Johan Vromans wrote:
> Steffen Mueller <nj88udd02@sneakemail.com> writes:
>=20
>> perl -MWx -e '$ENV{foo}=3D"bar";'
>>
>> crashes with:
>> panic: realloc from wrong pool at -e line 1.
>> panic: free from wrong pool during global destruction.
>=20
> Wasn't this fixed some time ago?
>=20
> In any case, I cannot reproduce it.
>=20
> Fedora 10
> perl 5.10.0
> Wx 0.89

yes, but is yours a debugging perl? I found a thread where you and Mattia d=
iscuss this problem specifically with debugging perls. The workaround back =
then seemed to be to add the -DPERL_USE_SAFE_PUTENV, but that doesn't work =
for me with 5.10.x trunk (any more?).

(./Configure -DDEBUGGING -Dusethreads -Duse64bitall -Dusedevel -DDEBUG_LEAK=
ING_SCALARS -DPERL_USE_SAFE_PUTENV -de and also debugging Wx and wxWidgets)

Best regards,
Steffen
0
Jean
4/20/2009 8:19:48 AM
Steffen Mueller wrote:
> Hi all,
> 
> Steffen Mueller wrote:
>> perl -Iblib/lib -Iblib/arch -MWx -e1
>> panic: free from wrong pool during global destruction.
>>
>> The same happens for make test, of course.
>>
>> Now, I'm entirely stuck here. I have no idea how to debug this issue, 
>> my C debugging skills are sub-par. I'd love to hear how to get around 
>> this initial obstacle, but I'd even prefer to learn how to debug these 
>> issues myself. Any ideas how?

   I'm sorry I do not have some advice... in this case it was a build
problem, and it took me a while to discover the symptom (-DDEBUGGING
not being defined when building Wx).

> I have some more data:
> 
> perl -MWx -e '$ENV{foo}="bar";'
> 
> crashes with:
> panic: realloc from wrong pool at -e line 1.
> panic: free from wrong pool during global destruction.
> 
> The former (realloc) error is coming from that ENV assignment for sure. 
> If I run it in a larger app, a line with an ENV assignment is reported 
> to be the culprit of the first panic.
> 
> So the issue seems to be related to what Mattia mentioned in the old 
> thread I mentioned in my previous mail. Maybe the Configure flag that is 
> supposed to disable direct ENV manipulation doesn't work correctly? This 
> is what I get from perl -V:

   I an not sure if -DPERL_USE_SAFE_PUTENV is working or not, but I found
why the workaround was not working.  Could you try again with a fresh
SVN checkout?  If you are interested, -DDEBUGGING is defined in CCFLAGS,
but Wx overrode CCFLAGS so -DDEBUGGING was not set when building Wx.

Regards,
Mattia


0
mattia
4/20/2009 9:11:30 PM
Hi Mattia, hi all,

Mattia Barbon wrote:
>> So the issue seems to be related to what Mattia mentioned in the old 
>> thread I mentioned in my previous mail. Maybe the Configure flag that 
>> is supposed to disable direct ENV manipulation doesn't work correctly? 
>> This is what I get from perl -V:
> 
>   I an not sure if -DPERL_USE_SAFE_PUTENV is working or not, but I found
> why the workaround was not working.  Could you try again with a fresh
> SVN checkout?  If you are interested, -DDEBUGGING is defined in CCFLAGS,
> but Wx overrode CCFLAGS so -DDEBUGGING was not set when building Wx.

Sorry for not answering in a couple of days. I was away on a business trip.

Since then, I've been able compile a debugging perl with the PUTENV 
workaround (-DPERL_USE_SAFE_PUTENV isn't propagated from the Configure 
command line and needs to be set interactively, it seems) and a 
debugging wxWidgets and Wx.pm using the current SVN trunk.

I haven't had time to try to debug my original problem much. I still 
expect it to be way beyond the scope of my debugging skills, but given 
that I already learned a lot by simply persisting in my attempts, 
hopefully I'll be surprised once more ;)

In the end, if I fail to solve this, it means I'll have to rewrite a 
large threaded application to not use threads but some sort of 
external-process-communicate-by-socket scheme (or so). But that would be 
an extremely annoying thing and I'd lose ability of using the Wx thread 
events which can be quite handy. Let's not even mention I don't have the 
time to reinvent that wheel.

Cheers,
Steffen
0
nj88udd02
5/1/2009 3:48:19 PM
Reply:

Similar Artilces:

Re: free from wrong pool during global destruction
> Since then, I've been able compile a debugging perl with the PUTENV > workaround (-DPERL_USE_SAFE_PUTENV isn't propagated from the Configure > command line and needs to be set interactively, it seems) and a > debugging wxWidgets and Wx.pm using the current SVN trunk. I'm working on something completely different (perl bindings for Qt4) but was having the same problem with "free from wrong pool". I tried explicitly adding the use safe putenv to perl's ccflags by configuring with "-DPERL_USE_SAFE_PUTENV -A append:ccflags="-DPERL_USE_SA...

[wxperl-users] [ wxperl-Bugs-1723667 ] DirDialog under GTK produces wrong dialog
Bugs item #1723667, was opened at 2007-05-22 10:40 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115655&aid=1723667&group_id=15655 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summa...

Free to wrong pool..
Hello beginners, Free to wrong pool 2245a0 not aa8fea8 at D:/Perl/lib/XSLoader.pm line -1. I guess it's because of use threads; I thought that copy-pasting the "use" statements here would help somebody help me.. any suggestions would be appreciated. Thanks in Advance. (sorry for bad English) use 5.008; use threads; use threads::shared; use strict; use warnings; use diagnostics; use Getopt::Long; use Fatal qw/:void open close opendir/; use Digest::MD5 qw/md5_hex/; use File::Find; use Getopt::Long; use LWP; -- Best regards, Alexan...

[wxperl-users] [ wxperl-Bugs-1062899 ] Wx::TreeCtrl::GetFirstChild returns wrong value
Bugs item #1062899, was opened at 2004-11-08 22:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115655&aid=1062899&group_id=15655 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Wx::TreeCtrl::GetFirstChild returns wrong value Initial Comment: Wx::TreeCtrl::GetFirstChild and GetNextChild are supposed to return a wxTreeItemId. They return a scala...

Free to wrong pool error
------_=_NextPart_001_01C38796.771C35CC Content-Type: text/plain I am in process of migrating my job workstation from a windows 2000 machine to a windows XP machine. I have gone from a Perl 5.6.1 installation to a Perl 5.8 installation. I downloaded the newest version of OpenSSL, and built it using MS VC++ 6.0 without problems. I then downloaded Crypt::SSLeay version 0.51 from CPAN, and built and installed it without problems. However, now, when I try to run my scripts that log into a remote internet portal to download data, I am getting an error saying: Free to wrong pool 22277...

[wxperl-users] wxPerl Wiki => wxPerl Kwiki
Hello all, Once upon a time I installed a Wiki, called it the wxPerl Wiki and didn't look at it anymore. I noticed that only a few people use it, it's been hacked a few times, and to make it work, at least yours truly should put more time and effort in it. This morning I started installing Kwiki, which is a far better Wiki platform than the Wiki that was installed. Apart from the UserPreferences page (working on it), everything works as it should. However, the data people entered in the old Wiki can't be converted to Kwiki automatically. Therefore I need your ...

[wxperl-users] wrong charset probem
Got this Error: Failed to display HTML document in ISO-8859-1 encoding in wxperl_demo.pl when looking at the wxHtmlListBox demo This was true for the stable Wx and for the new release candidate. I checked - both times the unicode release is being used. Also the problem occurs with Wx demos. I will cross post there too. But I wondered if anyone here has come across the problem, or how to solve it. I used ubuntu edgy. Richard On Sun, 03 Dec 2006 13:03:20 +0300 Richard Hainsworth <richard@rusrating.ru> wrote: > Got this > Error: Failed to display HTML docume...

Fwd: wxPerl on the Mac; was: [wxperl-users] Re: problems with wxPerl
>To: Jouke Visser <jouke@pvoice.org>, wxperl-users@lists.sourceforge.net >From: Christian Jaeger <christian.jaeger@sl.ethz.ch> >Subject: wxPerl on the Mac; was: [wxperl-users] Re: problems with wxPerl >Date: Sun, 30 Sep 2001 23:08:19 +0100 > >Hello, > >I'm crossposting this reply to the macosx-perl mailing list because >there is some interest, too. Actually I forgot to put the macosx-perl adress on it. >At 14:02 Uhr +0200 24.9.2001, Jouke Visser wrote: >>I wondered if anyone yet tried to compile wxPerl on a Mac. If not, I'...

[wxperl-users] [ wxperl-Bugs-1237847 ] wxPerl does not build with wxUniversal
Bugs item #1237847, was opened at 2005-07-13 23:24 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115655&aid=1237847&group_id=15655 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mattia Barbon (mbarbon) Assigned to: Nobody/Anonymous (nobody) Summary: wxPerl does...

[wxperl-users] [ wxperl-Bugs-588884 ] wxperl will not compile
Bugs item #588884, was opened at 2002-07-30 17:13 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115655&aid=588884&group_id=15655 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dan Stahlke (danstahlke) Assigned to: Nobody/Anonymous (nobody) Summary: wxperl will not compile Initial Comment: I cannot get the wxPerl module to compile. It breaks with this message: c++ -c -I/usr/local/lib/wx/include/gtk-2.3 -I/usr/local/include -I. -fno-rtti -fno-exceptions -O2 -DVERSION=\0.10\ -DXS_VERSION=\...

[wxperl-users] Activestate and WxPerl
Hi, <I've read through the archives first, before posting> I just installed Activestate (v5.6.1, below is the output of perl -V). Then following the readme (I untarred/unzipped to d:\data\download\wxperl). I tried to install and I'm getting: D:\Data\Download\WXPerl>ppm install --location=. Wx Installing package 'Wx'... Error installing package 'Wx': Read a PPD for 'Wx', but it is not intended for this build of Perl (MSWin32-x86-multi-thread) 2 questions: 1) suggestion on fixing the above? 2) Do I need to install WxWindows in addition...

[wxperl-users] wxperl on solaris ?
I desperately need a perl GUI that runs on solaris/linux/windows. So I found wxperl that seems very nice, and runs pretty well on windows and linux. But I can't manage to make it works under solaris2.6, with gtk1.2.10, wxGtk-2.4, perl 5.6.1 and gcc2.95.2. the compilation process seems successful, but when I try to run any wxperl script, I get the following message : ClassInfo initialization failed 'wxSashWindow' at /nfs/aletheia/packages/all/perl/lib/5.6.1/sun4-solaris2.6/DynaLoader.pm line 206. Compilation failed in require at -e line 1. BEGIN failed--compila...

Free to wrong pool using DBD-mysql
Not sure if this is a DBI fault or a DBD-mysql fault (or even a Perl fault, but I doubt it): Running this program: use strict; use warnings; use DBI; use threads; my $dsn = 'dbi:mysql:test'; my $usr = 'root'; my $pwd = undef; my $t = threads->new(\&dbsub); $t->join(); sub dbsub { my $dbh = DBI->connect($dsn, $usr, $pwd); $dbh->disconnect(); } crashes with this error: Free to wrong pool 232770 not c0102 during global destruction. on Windows. I'm running perl-5.8.5, DBI-1.45, DBD-mysql-2.9004, mysql-4.1.3. I've had th...

[wxperl-users] wxperl on MacOSX
Hello I'm happy to find today the announcement of a wxwindows-perl interface in www.perl.com's newsletter. It could just be what I'm looking for: some perl gui for MacOS (9/)X. Tough I'm a bit in doubt whether wxperl will work on the mac (primarily MacOSX, MacOS9 would be cool too)? I want to create a rather simple gui: create popup dialogs on top of the desktop (maybe floating windows). It's for a networked message application. It should pop up a window if it receives a message. I've been thinking about porting the perl Mac::* toolbox modules to ...

Web resources about - free from wrong pool during global destruction - perl.wxperl.users

North Korea and weapons of mass destruction - Wikipedia, the free encyclopedia
Since 2003, North Korea is no longer a party to the Nuclear Non-Proliferation Treaty . On October 9, 2006, North Korea announced it had successfully ...

Arrium board under fire over value destruction, executive pay
Struggling mining and steel group Arrium&nbsp;received a first strike against its remuneration report as shareholders attacked the company for ...

Death Star's Destruction Would Have Collapsed Galactic Economy, Required $900 Quintillion Bailout: Study ...
“I am your father, and you owe me $193 quintillion.” That’s what Darth Vader might have said to Luke Skywalker in their epic confrontation in ...

Ravens lose to Dolphins, 15-13, following self destruction at end of half
By now, the Ravens' grit should be unquestioned. Their ability to play hard and battle through injuries, blown calls and mistakes cannot be doubted. ...

A CRY FROM GERMANY: The Unfolding Destruction of Europe
Spotted in the comments section at Moonbattery (" Congressman Acknowledges Unfolding Destruction of Western Civilization "): A Female Physician ...

‘Dangerous Token Negro': DC Media’s Destruction of Carson Is Just Getting Started
Let me be very, very clear about one thing: The DC Media cannot allow Dr. Ben Carson to become President of the United States. And if the DC ...

"Eve of Destruction" songwriter P.F. Sloan, RIP
P.F Sloan, who wrote hits for Barry McGuire ("Eve of Destruction"), Johnny Rivers ("Secret Agent Man") and others, died Sunday (11/15), after ...

Mega-cap value destruction
Wal-Mart, Exxon Mobil, and Qualcomm have seen billions and billions of dollars evaporate. Chad Morganlander of Stifel Nicolaus and Craig Johnson ...

Elizabeth Warren Warns CFBP Attacks Just Cover For Wall Street Destruction Of Dodd-Frank
If you watched the Republican debate Tuesday night, you got treated to this horrible ad, courtesy of American Action Network, the Iowa-based ...

Donald Trump claims 'thousands' in New Jersey cheered destruction of World Trade Center
... Expect it now to become common knowledge among Trump supporters that crowds of thousands of New Jersey residents were cheering the destruction ...

Resources last updated: 12/9/2015 8:48:26 AM