develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #28364] [PATCH] Perl segfaults if XS changes system environment on Win32

Thread Previous
From:
Tony Cook via RT
Date:
July 17, 2013 07:06
Subject:
[perl #28364] [PATCH] Perl segfaults if XS changes system environment on Win32
Message ID:
rt-3.6.HEAD-2552-1374044806-190.28364-15-0@perl.org
On Thu Apr 08 01:12:56 2004, aa29 wrote:
> To: perlbug@perl.org
> Subject: Perl segfaults if XS changes system environment
> Reply-To: aa29@mail.ru
> Message-Id: <5.8.4_2504_1081410935@INFORMED>
> 
> This is a bug report for perl from aa29@mail.ru,
> generated with the help of perlbug 1.35 running under perl v5.8.4.
> 
> Perl (Win32) segfaults with "free to wrong pool..." message during
> interpreter
> destruction phase IF:
> 
>  1. destruct_level > 0
>  2. XS changes system environment
> 
> I hit this problem while installing Apache::DBI, which is using DBD::mysql
> in the test suite.
> 
> Short example is:
> 
> use DBI;
> use threads; # to set destruct_level
> my $dbh = DBI->connect('dbi:mysql:test');
> 
> Code digging shows that Win32 port gets environ from stdlib. In
> construction phase PL_origenviron is set to environ. If
destruct_level's not
> 0 in destruction phase PL_origenviron is compared with environ and if it's
> not the same there's an attempt to safesysfree(environ) wich segfaults.
> 
> PL_origenviron and environ became different after putenv call in XS or
> underlying library (as mysqllib).

I haven't been able to reproduce this problem in bleadperl.

I had enough difficulties getting DBD::mysql to install that I created a
simple XS module that wraps putenv().

Does this problem still exist for you with recent perls?

Or, if you've stopped using perl, please let me know and I'll close this
ticket.

Thanks,
Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=28364

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About