delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <405716AE.90506@conexant.com> |
Date: | Tue, 16 Mar 2004 15:01:02 +0000 |
From: | Luke Diamand <luke DOT diamand AT conexant DOT com> |
User-Agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5; MultiZilla v1.5.0.3f) Gecko/20031007 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: perl_construct segfaults under cygwin |
References: | <40559840 DOT 1010403 AT conexant DOT com> |
In-Reply-To: | <40559840.1010403@conexant.com> |
X-Enigmail-Version: | 0.82.5.0 |
X-Enigmail-Supports: | pgp-inline, pgp-mime |
In case anyone else is ever stuck trying to figure this out, the answer is to RTFM. It turns out that in perl5.8.? you need to add a call to: PERL_SYS_INIT3(&argc,&argv,&env) before you do anything else with perl. This is documented in the Perl embed man page. Luke Diamand wrote: > > I'm seeing the call to perl_construct() segfault under cygwin. The same > code works fine on linux. > > Here's the code: > > #include <EXTERN.h> > #include <perl.h> > static PerlInterpreter *my_perl; > > int main() { > my_perl = perl_alloc(); > perl_construct(my_perl); > printf("Hooray\n"); > } > > The last 10 lines of the backtrace give: > #0 0x10072547 in cygperl5_8_2!Perl_sv_add_arena () > from /usr/bin/cygperl5_8_2.dll > #1 0x1007dc8b in cygperl5_8_2!Perl_newSVpvn () from > /usr/bin/cygperl5_8_2.dll > #2 0x10058488 in cygperl5_8_2!Perl_savesharedpv () > from /usr/bin/cygperl5_8_2.dll > #3 0x100586b7 in cygperl5_8_2!Perl_vmess () from /usr/bin/cygperl5_8_2.dll > #4 0x10059171 in cygperl5_8_2!Perl_vcroak () from > /usr/bin/cygperl5_8_2.dll > #5 0x1005963f in cygperl5_8_2!Perl_croak_nocontext () > from /usr/bin/cygperl5_8_2.dll > #6 0x1000ae1b in cygperl5_8_2!Perl_malloc () from > /usr/bin/cygperl5_8_2.dll > #7 0x1007254c in cygperl5_8_2!Perl_sv_add_arena () > from /usr/bin/cygperl5_8_2.dll > #8 0x1007dc8b in cygperl5_8_2!Perl_newSVpvn () from > /usr/bin/cygperl5_8_2.dll > #9 0x10058488 in cygperl5_8_2!Perl_savesharedpv () > from /usr/bin/cygperl5_8_2.dll > (More stack frames follow...) > > > The last few lines of the backtrace appear to be: > > #35002 0x10058488 in cygperl5_8_2!Perl_savesharedpv () > from /usr/bin/cygperl5_8_2.dll > #35003 0x100586b7 in cygperl5_8_2!Perl_vmess () from /usr/bin/cygperl5_8 > #35004 0x10059171 in cygperl5_8_2!Perl_vcroak () > from /usr/bin/cygperl5_8_2.dll > #35005 0x1005963f in cygperl5_8_2!Perl_croak_nocontext () > from /usr/bin/cygperl5_8_2.dll > #35006 0x1000ae1b in cygperl5_8_2!Perl_malloc () > from /usr/bin/cygperl5_8_2.dll > #35007 0x1007254c in cygperl5_8_2!Perl_sv_add_arena () > from /usr/bin/cygperl5_8_2.dll > #35008 0x10079a0e in cygperl5_8_2!Perl_newSV () from /usr/bin/cygperl5_8 > #35009 0x100014ac in perl_construct () from /usr/bin/cygperl5_8_2.dll > #35010 0x0040108d in cygcrypt-0!crypt () > #35011 0x6101c868 in dlerror () from /usr/bin/cygwin1.dll > > I've seen a suggestion elsewhere that this is new in 5.8.2, although I > can't verify this myself, since I haven't worked out how to downgrade to > anything newer than cygwin perl 5.6. > > Thanks in advance > Luke Diamand > ******************Legal Disclaimer************************** "This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email help AT conexant DOT com, and delete the message. Thank you." ************************************************************ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |