On Tue Nov 20 14:56:51 2012, sprout wrote:
>
> Thank you for your help in debugging this.
>
> Those look like PL_sv_undef to me.
You guessed right, but the problem is, the undefs (or what I called
garbage SV *s earlier, i didn't realize it was an immortal because of
the refcount not being a perfect 0x80000000 or 0x7FFFFFFF), the undefs
are from the other thread/interp, at the crash in pad_push
______________________________________________________________
- names,10 0x009d1c3c sv * * const
+ [0] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [1] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [2] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [3] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [4] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [5] 0x009e420c {sv_any=0x009b46a4 sv_refcnt=1 sv_flags=17414 ...} sv *
+ [6] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [7] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [8] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
+ [9] 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482388
sv_flags=134217728 ...} sv *
__________________________________________________________________
> perl517.dll!Perl_pad_push(interpreter * my_perl=0x00bc060c, padlist *
padlist=0x00995bc4, int depth=3) Line 2277 + 0xc C
perl517.dll!Perl_pp_entersub(interpreter * my_perl=0x00bc060c) Line
2750 + 0x1c C
perl517.dll!Perl_call_sv(interpreter * my_perl=0x00bc060c, sv *
sv=0x009e416c, volatile long flags=45) Line 2730 + 0x17 C
perl517.dll!S_curse(interpreter * my_perl=0x00bc060c, sv * const
sv=0x00ce4794, const char check_refcnt=' ') Line 6373 + 0xf C
perl517.dll!Perl_sv_clear(interpreter * my_perl=0x00bc060c, sv * const
orig_sv=0x00ce4794) Line 6024 + 0xf C
perl517.dll!Perl_sv_free2(interpreter * my_perl=0x00bc060c, sv * const
sv=0x00ce4794) Line 6505 + 0xd C
perl517.dll!S_SvREFCNT_dec(interpreter * my_perl=0x00bc060c, sv *
sv=0x00ce4794) Line 60 + 0xd C
perl517.dll!Perl_sv_unref_flags(interpreter * my_perl=0x00bc060c, sv *
const ref=0x00bac154, const unsigned long flags=5) Line 9603 + 0xd C
perl517.dll!Perl_sv_force_normal_flags(interpreter *
my_perl=0x00bc060c, sv * const sv=0x00bac154, const unsigned long
flags=5) Line 4808 + 0x11 C
perl517.dll!Perl_leave_scope(interpreter * my_perl=0x00bc060c, long
base=24) Line 930 + 0xf C
perl517.dll!Perl_pop_scope(interpreter * my_perl=0x00bc060c) Line
110 + 0x18 C
perl517.dll!Perl_pp_leavesub(interpreter * my_perl=0x00bc060c) Line
2603 + 0x9 C
perl517.dll!Perl_runops_standard(interpreter * my_perl=0x00bc060c)
Line 42 + 0xa C
perl517.dll!win32_start_child(void * arg=0x00bc060c) Line 1740 + 0xd C
kernel32.dll!_BaseThreadStart@8() + 0x37
____________________________________________________________
SV * 0x00346628 is the undef immortal from this thread
_____________________________________________________________
- &my_perl->Isv_undef 0x00346628 {sv_any=0x00000000 sv_refcnt=
2147482387
sv_flags=134217728 ...} sv *
sv_any 0x00000000 void *
sv_refcnt
2147482387 unsigned long
sv_flags 134217728 unsigned long
+ sv_u {svu_pv=0x00000000 <Bad Ptr> svu_iv=0 svu_uv=0 ...} sv::__unnamed
_____________________________________________________________
____________________________________________________________
ntdll.dll!_KiFastSystemCallRet@0()
ntdll.dll!_ZwRequestWaitReplyPort@12() + 0xc
ntdll.dll!_CsrClientCallServer@16() + 0x57
kernel32.dll!_WriteConsoleInternal@20() + 0x94
kernel32.dll!_WriteConsoleA@20() + 0x18
kernel32.dll!_WriteFile@20() + 0xbe62
> msvcr71.dll!_write_lk(int fh=671500209, const void * buf=0x00d2caca,
unsigned int cnt=672681368) Line 198 + 0x14 C
msvcr71.dll!_write(int fh=2, const void * buf=0x00ae3fec, unsigned int
cnt=26) Line 79 + 0xc C
perl517.dll!win32_write(int fd=2, const void * buf=0x00ae3fec,
unsigned int cnt=26) Line 3303 + 0x12 C
perl517.dll!PerlLIOWrite(IPerlLIO * piPerl=0x0034436c, int handle=2,
const void * buffer=0x00ae3fec, unsigned int count=26) Line 1080 + 0x11 C
perl517.dll!PerlIOUnix_write(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f4a44, const void * vbuf=0x00ae3fec, unsigned int count=26)
Line 2817 + 0x22 C
perl517.dll!Perl_PerlIO_write(interpreter * my_perl=0x00345eb4,
_PerlIO * * f=0x008f4a44, const void * vbuf=0x00ae3fec, unsigned int
count=26) Line 1694 + 0x3e C
perl517.dll!PerlIOBuf_flush(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f4474) Line 3928 + 0x1b C
perl517.dll!PerlIOCrlf_flush(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f4474) Line 4764 + 0xd C
perl517.dll!Perl_PerlIO_flush(interpreter * my_perl=0x00345eb4,
_PerlIO * * f=0x008f4474) Line 1718 + 0xe C
perl517.dll!PerlIOCrlf_write(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f4474, const void * vbuf=0x00d2ca8c, unsigned int count=63)
Line 4736 + 0xd C
perl517.dll!Perl_PerlIO_write(interpreter * my_perl=0x00345eb4,
_PerlIO * * f=0x008f4474, const void * vbuf=0x00d2ca8c, unsigned int
count=63) Line 1694 + 0x3e C
perl517.dll!PerlIO_vprintf(_PerlIO * * f=0x008f4474, const char *
fmt=0x28184d94, char * ap=0x0012f25c) Line 4970 + 0x15 C
perl517.dll!PerlIO_printf(_PerlIO * * f=0x008f4474, const char *
fmt=0x28184d94, ...) Line 4982 + 0x11 C
perl517.dll!Perl_do_sv_dump(interpreter * my_perl=0x00345eb4, long
level=0, _PerlIO * * file=0x008f4474, sv * sv=0x00958c94, long nest=0,
long maxnest=4, char dumpops=0, unsigned int pvlim=0) Line 1587 + 0x1d C
Peek.dll!XS_Devel__Peek_Dump(interpreter * my_perl=0x00000000, cv *
cv=0x009e42dc) Line 607 C
perl517.dll!Perl_pp_entersub(interpreter * my_perl=0x00345eb4) Line
2833 + 0x10 C
perl517.dll!Perl_runops_standard(interpreter * my_perl=0x00345eb4)
Line 42 + 0xa C
perl517.dll!Perl_call_sv(interpreter * my_perl=0x00345eb4, sv *
sv=0x009e416c, volatile long flags=45) Line 2730 + 0x36 C
perl517.dll!S_curse(interpreter * my_perl=0x00345eb4, sv * const
sv=0x00b59f0c, const char check_refcnt=' ') Line 6373 + 0xf C
perl517.dll!Perl_sv_clear(interpreter * my_perl=0x00345eb4, sv * const
orig_sv=0x00b59f0c) Line 6024 + 0xf C
perl517.dll!Perl_sv_free2(interpreter * my_perl=0x00345eb4, sv * const
sv=0x00b59f0c) Line 6505 + 0xd C
perl517.dll!S_SvREFCNT_dec(interpreter * my_perl=0x00345eb4, sv *
sv=0x00b59f0c) Line 60 + 0xd C
perl517.dll!Perl_sv_unref_flags(interpreter * my_perl=0x00345eb4, sv *
const ref=0x009f4774, const unsigned long flags=5) Line 9603 + 0xd C
perl517.dll!Perl_sv_force_normal_flags(interpreter *
my_perl=0x00345eb4, sv * const sv=0x009f4774, const unsigned long
flags=5) Line 4808 + 0x11 C
perl517.dll!Perl_leave_scope(interpreter * my_perl=0x00345eb4, long
base=37) Line 930 + 0xf C
perl517.dll!Perl_pop_scope(interpreter * my_perl=0x00345eb4) Line
110 + 0x18 C
perl517.dll!Perl_pp_leavesub(interpreter * my_perl=0x00345eb4) Line
2603 + 0x9 C
perl517.dll!Perl_runops_standard(interpreter * my_perl=0x00345eb4)
Line 42 + 0xa C
perl517.dll!S_run_body(interpreter * my_perl=0x00345eb4, long
oldscope=1) Line 2431 + 0xd C
perl517.dll!perl_run(interpreter * my_perl=0x00345eb4) Line 2350 C
perl517.dll!RunPerl(int argc=4, char * * argv=0x00342478, char * *
env=0x003451f8) Line 270 + 0x9 C
perl.exe!mainCRTStartup() Line 398 + 0xe C
kernel32.dll!_BaseProcessStart@4() + 0x23
__________________________________________________________________
AKA the root interp, note how close the my_perl * and immortal undef *
are. Same struct.
>
> The line in question in 2277 in pad.c:
>
> 2276 if (names_fill >= ix && names[ix] != &PL_sv_undef) {
> 2277 const char sigil = SvPVX_const(names[ix])[0];
> 2278 if ((SvFLAGS(names[ix]) & SVf_FAKE)
>
> That can only be reached if the SV is *not* PL_sv_undef. Judging by the
> memory addresses in the backtrace, I suspect this is the PL_sv_undef
> field of the parent thread.
Egh, your right. Ignore last paragraph.
>
> So I suspect the child thread is trying to use a CV belonging to the
parent.
>
> What happens if you apply the attached patch? Bear in mind that I have
> reverted 7cc6787e9d in blead. Please try this against 7cc6787e9d or any
> commit before the revert.
>
> (I suspect 8c34e50dc is actually the cause of this. 7cc6787e9d probably
> just changed the order of things enough to trigger the crash.)
>
Your patch worked, io_multihomed.t and io_sock.t passed.
Another problem, IDK if it is related since I didn't run this before the
crashing commit, this might be totally benign and irrelevant. Its more
for anyone else reading the thread than you. Previously I ran the
process without a debugger, waited for it to crash, then attached
debugger. Now I started the process from the debugger, this turns on
special developer features on in the kernel/os runtime layer like
Window's malloc poisoning and other kernel tweaks.
child thread, cop_line 384 unsigned long
+ cop_file 0x009ee1e4 "../../lib/IO/Handle.pm" char *
Kernel handle 0xf18 was passed to NtClose, (msvcr71.dll translates C
handles to kernel/OS handles).
__________________________________________________________________
ntdll.dll!_KiRaiseUserExceptionDispatcher@0() + 0x37
ntdll.dll!_KiFastSystemCall@0() + 0x3
ntdll.dll!_NtClose@4() + 0xc
kernel32.dll!_CloseHandle@4() + 0x44
msvcr71.dll!_close_lk(int fh=5) Line 115 + 0x3f C
msvcr71.dll!_close(int fh=5) Line 60 + 0x6 C
perl517.dll!my_close(int fd=5) Line 436 + 0xa C
perl517.dll!win32_close(int fd=5) Line 3251 + 0x9 C
perl517.dll!PerlLIOClose(IPerlLIO * piPerl=0x00ad97dc, int handle=5)
Line 947 + 0x9 C
perl517.dll!PerlIOUnix_close(interpreter * my_perl=0x00906fbc, _PerlIO
* * f=0x00bb2634) Line 2858 + 0x1a C
perl517.dll!PerlIOBase_close(interpreter * my_perl=0x00906fbc, _PerlIO
* * f=0x00af09ec) Line 2207 + 0xe C
perl517.dll!PerlIOBuf_close(interpreter * my_perl=0x00906fbc, _PerlIO
* * f=0x00af09ec) Line 4223 + 0xd C
perl517.dll!PerlIO__close(interpreter * my_perl=0x00906fbc, _PerlIO *
* f=0x00af09ec) Line 1465 + 0xe C
perl517.dll!Perl_PerlIO_close(interpreter * my_perl=0x00906fbc,
_PerlIO * * f=0x00af09ec) Line 1478 + 0xd C
perl517.dll!Perl_io_close(interpreter * my_perl=0x00906fbc, io *
io=0x00cfba24, char not_implicit=' ') Line 977 + 0x10 C
perl517.dll!Perl_do_close(interpreter * my_perl=0x00906fbc, gv *
gv=0x00cfb9d4, char not_implicit=' ') Line 942 + 0x11 C
> perl517.dll!Perl_pp_close(interpreter * my_perl=0x00906fbc) Line
663 + 0xf C
perl517.dll!Perl_runops_standard(interpreter * my_perl=0x00906fbc)
Line 42 + 0xa C
perl517.dll!win32_start_child(void * arg=0x00906fbc) Line 1740 + 0xd C
kernel32.dll!_BaseThreadStart@8() + 0x37
_______________________________________________________________________
parent thread,
+ cop_file 0x009ee1e4 "../../lib/IO/Handle.pm" char *
cop_line 384 unsigned long
kernel handle to CloseHandle was 0xf30
_______________________________________________________________________
ntdll.dll!_KiFastSystemCallRet@0()
ntdll.dll!_NtQueryVirtualMemory@24() + 0xc
kernel32.dll!__ValidateEH3RN() + 0xb6
kernel32.dll!__except_handler3() + 0x39
ntdll.dll!ExecuteHandler2@20() + 0x26
ntdll.dll!ExecuteHandler@20() + 0x24
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xe
ntdll.dll!_KiRaiseUserExceptionDispatcher@0() + 0x37
ntdll.dll!_KiFastSystemCall@0() + 0x3
ntdll.dll!_NtClose@4() + 0xc
kernel32.dll!_CloseHandle@4() + 0x44
> msvcr71.dll!_close_lk(int fh=4) Line 115 + 0x3f C
msvcr71.dll!_close(int fh=4) Line 60 + 0x6 C
perl517.dll!my_close(int fd=4) Line 436 + 0xa C
perl517.dll!win32_close(int fd=4) Line 3251 + 0x9 C
perl517.dll!PerlLIOClose(IPerlLIO * piPerl=0x0034436c, int handle=4)
Line 947 + 0x9 C
perl517.dll!PerlIOUnix_close(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x00aeb624) Line 2858 + 0x1a C
perl517.dll!PerlIOBase_close(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f44a4) Line 2207 + 0xe C
perl517.dll!PerlIOBuf_close(interpreter * my_perl=0x00345eb4, _PerlIO
* * f=0x008f44a4) Line 4223 + 0xd C
perl517.dll!PerlIO__close(interpreter * my_perl=0x00345eb4, _PerlIO *
* f=0x008f44a4) Line 1465 + 0xe C
perl517.dll!Perl_PerlIO_close(interpreter * my_perl=0x00345eb4,
_PerlIO * * f=0x008f44a4) Line 1478 + 0xd C
perl517.dll!Perl_io_close(interpreter * my_perl=0x00345eb4, io *
io=0x00ae2b8c, char not_implicit=' ') Line 977 + 0x10 C
perl517.dll!Perl_do_close(interpreter * my_perl=0x00345eb4, gv *
gv=0x00ae2b3c, char not_implicit=' ') Line 942 + 0x11 C
perl517.dll!Perl_pp_close(interpreter * my_perl=0x00345eb4) Line
663 + 0xf C
perl517.dll!Perl_runops_standard(interpreter * my_perl=0x00345eb4)
Line 42 + 0xa C
perl517.dll!S_run_body(interpreter * my_perl=0x00345eb4, long
oldscope=1) Line 2431 + 0xd C
perl517.dll!perl_run(interpreter * my_perl=0x00345eb4) Line 2350 C
perl517.dll!RunPerl(int argc=4, char * * argv=0x00342478, char * *
env=0x003451f8) Line 270 + 0x9 C
perl.exe!mainCRTStartup() Line 398 + 0xe C
kernel32.dll!_BaseProcessStart@4() + 0x23
______________________________________________________________________
exception was "Unhandled exception at 0x7c90e4ff (ntdll.dll) in
perl.exe: 0xC0000008: An invalid HANDLE was specified."