develooper Front page | perl.perl5.porters | Postings from September 2008

Re: [perl #58468] crash on exit with fork done in do FILE on Win32

Thread Previous
From:
alex.davies
Date:
September 1, 2008 06:57
Subject:
Re: [perl #58468] crash on exit with fork done in do FILE on Win32
Message ID:
F8B848ADE2FB4840863BD795C4581431@Amelie

> On windows XP with 5.10 running:
>
>  perl.exe -e "do 'test.pl'
>
> triggers an exception (5.8.7 works ok). "test.pl" is:
>
>  print "parent $$\n";
>  if (fork() == 0) {
>    print "child $$\n";
>    exit;
>  }
>
> Simply running the test file as "perl test.pl" does not
> trigger an exception.
>
> Running it under VS6, it bombs out in PERL_WAIT_FOR_CHILDREN
> in perl_destruct(). By inlining the actual macro code and
> recompiling, it appears the exception occurs in the
> WaitForMultipleObjects() call. (fwiw - the function args look
> reasonable).
>

ok - ignore that analysis... wrong thread :-\

It's crashing in a call to Perl_gv_fetchpvn_flags() done
from the  do_close(..."STDOUT"...)  in win32_start_child()

The problem is at the  isIDFIRST_lazy(name).

Tracing the macros:

/* (1) utf8.h 167 */
#define isIDFIRST_lazy(p) isIDFIRST_lazy_if(p,1)

/* (2) utf8.h 155 */
#define isIDFIRST_lazy_if(p,c) ((IN_BYTES || (!c || (*((const U8*)p) < 0xc0))) \
   ? isIDFIRST(*(p)) \
   : isIDFIRST_utf8((const U8*)p))

/* (3) utf8.h 191 */
#define IN_BYTES (CopHINTS_get(PL_curcop) & HINT_BYTES)

/* (4) cop.h 270 */
#define CopHINTS_get(c)  ((c)->cop_hints + 0)


...and my_perl->Icurcop is NULL. Hence the exception.

It gets set to NULL when pp_exit() ends up calling Perl_parser_free() which:

  // toke.c ~737
  PL_curcop = parser->saved_curcop;

...and that is NULL.

HTH

Thanks,
alex.

 



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