Subject: Re: Perl instabilities
From: [email-masked] (Michael Lemke)
To: "cygwin" <[email-masked]>, "Gerrit P. Haase" <[email-masked]>
Cc: Greg Matheson <[email-masked]>, [email-masked] (Michael Lemke)
Date: Mon, 12 May 2003 21:40:55 +0200

5/12/03 16:00:24, "Gerrit P. Haase" <[email-masked]> wrote:

>Gerrit schrieb:
>
>> Hallo Greg,
>
>>> Breakpoint 2, 0x0040375c in ?? ()
>>> (gdb) bt
>>> #0  0x0040375c in ?? ()
>>> #1  0x0040103c in ?? ()
>>> #2  0xbff8b6be in KERNEL32!EnumTimeFormatsA () from
>>> /cy/c/WINDOWS/SYSTEM/KERNEL32.DLL
>>> #3  0xbff8b570 in KERNEL32!FT_Thunk () from
>>> /cy/c/WINDOWS/SYSTEM/KERNEL32.DLL
>>> #4  0xbff89f33 in KERNEL32!BeginUpdateResourceA () from
>>> /cy/c/WINDOWS/SYSTEM/KERNEL32.DLL
>>> Cannot access memory at address 0x856dbfec
>>> (gdb) nexti
>
>> Hmmm, I'll build a version with Cygwin malloc instead of Perl malloc,
>> maybe a bug in malloc()?
>
>Finally it happens perl using system malloc() instead perl malloc():
>http://anfaenger.de/cygwin/perl/perl-5.8.0-umymalloc.tar.bz2
>
>This version is compiled with -Uusemymalloc which means that the system
>malloc is used instead of the perl malloc, it is also compiled with debug
>infos, so if you also want to debug perl then the sourcetre is also
>needed (it is the same source as always):
>http://anfaenger.de/cygwin/perl/perl-5.8.0-umymalloc-srctree.tar.bz2
>this package unpacks in /src/cygwinperl/perl-5.8.0 if unpacked from the
>Cygwin root where it should be for the debugger to find it.
>
>So could you and everyone else with Win98 please try if it makes a
>difference if we use the Cygwin malloc() instead of Perl's own malloc()?
>

Thanks a lot, Gerrit, for your efforts.  But sorry to disappoint you--it still doesn't
work.  Same crashes but this time without bringing the whole Windows down.
All perl processes disappear when I CTRL/C it.

Unfortunately, I don't have space to install the sources so I did an 
strace experiment instead.

 micha> strace -n -o ~/perl.strace perl Makefile.PL
Warning: prerequisite HTML::Parser 3 not found.
182416994 [main] perl 950227 sync_with_child: child -92279287(0xF8) died before initialization with status code 0x18B00
182421441 [main] perl 950227 sync_with_child: *** child state child loading dlls
200886204 [main] perl 950227 sync_with_child: child -92281035(0x104) died before initialization with status code 0x18B00
200888303 [main] perl 950227 sync_with_child: *** child state child loading dlls
219234100 [main] perl 950227 sync_with_child: child -92336167(0x110) died before initialization with status code 0x18B00
on so on ad infinitum...

I can send the whole perl.strace if it is useful (135kb compressed).
Below are the lines around the fork crash as I could recognize it.

Thanks,
Michael

 micha> gawk 'NR>=8552&&NR<=8652' ~/perl.strace
 1147 167314936 [main] perl 950227 fhandler_base::set_flags: filemode set to binary
 1017 167315953 [main] perl 950227 fhandler_base::init: created new fhandler_base for handle 0xD4, bin 1
 1150 167317103 [main] perl 950227 make_pipe: 0 = make_pipe ([5, 6], 16384, 0x10000)
 1039 167318142 [main] perl 950227 fork: entering
 3700 167321842 [main] perl 950227 subproc_init: started wait_subproc thread
 1250 167323092 [main] perl 950227 stack_base: bottom 0x750000, top 0x540000, stack 0x74F360, size 3232, reserve 2162688
 1078 167324170 [main] perl 950227 fork_parent: CreateProcess (D:\CYGNUS\CYGWIN\BIN\PERL.EXE, D:\CYGNUS\CYGWIN\BIN
\PERL.EXE, 0, 0, 1, 20, 0, 0, 0x74F7F0, 0x74F840)
45937 167370107 [proc] perl 950227 wait_subproc: starting
51364 167421471 [main] perl 950227 proc_subproc: args: 1, 7664608
 1398 167422869 [main] perl 950227 proc_subproc: added pid 92279287 to wait list, slot 0, winpid 0xFA7FEE09, handle 0xF8
 1216 167424085 [main] perl 950227 proc_subproc: returning 1
 4454 167428539 [main] perl 950227 sync_with_child: waiting for child.  reason: waiting for longjmp, hang_child 1
-3123 167425416 [proc] perl 950227 wait_subproc: looping
**********************************************
Program name: D:\CYGNUS\CYGWIN\BIN\PERL.EXE (92279287)
App version:  1003.22, api: 0.78
DLL version:  1003.22, api: 0.78
DLL build:    2003-03-18 09:20
OS version:   Windows 98-4.10
Heap size:    402653184
Date/Time:    2003-05-12 21:06:00
**********************************************
 1287    9450 [main] PERL 92279287 events_init: windows_system_directory 'C:\WINDOWS\SYSTEM\', windows_system_directory_length 
18
 1141   10591 [main] PERL 92279287 events_init: cygwin_hmodule 0x61000000
 2635   13226 [main] PERL 92279287 fork_child: child is running.  pid 92279287, ppid 950227, stack here 0x74F868
 1008   14234 [main] PERL 92279287 sync_with_parent: signalling parent: after longjmp.
87976 167513392 [main] perl 950227 sync_with_child: child signalled me
 1066 167514458 [main] perl 950227 fork_parent: child is alive (but stopped)
 1508 167515966 [main] perl 950227 fork_copy: child handle 0xF8, low 0x405000, high 0x405040, res 1
 1338 167517304 [main] perl 950227 fork_copy: child handle 0xF8, low 0x407000, high 0x407070, res 1
13176778 180694082 [main] perl 950227 fork_copy: child handle 0xF8, low 0x10250000, high 0x1056C000, res 1
10047 180704129 [main] perl 950227 fork_copy: child handle 0xF8, low 0x74F870, high 0x750000, res 1
26007 180730136 [main] perl 950227 fork_copy: child handle 0xF8, low 0x610CB000, high 0x610D1B28, res 1
34068 180764204 [main] perl 950227 fork_copy: child handle 0xF8, low 0x610EF000, high 0x611263E0, res 1
 1309 180765513 [main] perl 950227 fork_copy: done
 1023 180766536 [main] perl 950227 fork_parent: copying data/bss of a linked dll
 7146 180773682 [main] perl 950227 fork_copy: child handle 0xF8, low 0x100F3000, high 0x100FC400, res 1
 3029 180776711 [main] perl 950227 fork_copy: child handle 0xF8, low 0x100FE000, high 0x101004A0, res 1
 1054 180777765 [main] perl 950227 fork_copy: done
 1065 180778830 [main] perl 950227 resume_child: signalled child
 1152 180779982 [main] perl 950227 sync_with_child: waiting for child.  reason: child loading dlls, hang_child 1
180784037 180798271 [main] perl 92279287 sync_with_parent: awake
 1184 180799455 [main] perl 92279287 sync_with_parent: no problems
  961 180800416 [main] perl 92279287 fork_child: hParent 0xE8, child 1 first_dll 0x10240000, load_dlls 1
  991 180801407 [main] perl 92279287 set_file_api_mode: File APIs set to ANSI
 1089 180802496 [main] perl 92279287 fixup_mmaps_after_fork: recreate_mmaps_after_fork, mmapped_areas 0x0
311773 181114269 [main] perl 92279287 handle_exceptions: In cygwin_except_handler exc 0xC0000005 at 0xBA2268 sp 0x74F408
 2270 181116539 [main] perl 92279287 handle_exceptions: In cygwin_except_handler sig = 11 at 0xBA2268
 2768 181119307 [main] perl 92279287 handle_exceptions: In cygwin_except_handler calling 0x0
 1513 181120820 [main] perl 92279287 try_to_debug: debugger_command 'd:/cygnus/cygwin/bin/dumper.exe 
D:/CYGNUS/CYGWIN/BIN/PERL.EXE'
 1827 181122647 [main] perl 92279287 open_stackdumpfile: Dumping stack trace to PERL.EXE.stackdump
930688 182053335 [main] perl 92279287 handle_exceptions: In cygwin_except_handler exc 0xC0000005 at 0x61011D27 sp 0x74F1DC
 1089 182054424 [main] perl 92279287 handle_exceptions: In cygwin_except_handler sig = 11 at 0x61011D27
  997 182055421 [main] perl 92279287 handle_exceptions: In cygwin_except_handler calling 0x0
  991 182056412 [main] perl 92279287 handle_exceptions: Error while dumping state (probably corrupted stack)
215207 182271619 [main] perl 92279287 signal_exit: about to call do_exit (18B00)
 1552 182273171 [main] perl 92279287 do_exit: do_exit (101120)
 1184 182274355 [main] perl 92279287 void: 0x0 = signal (20, 0x1)
 1158 182275513 [main] perl 92279287 void: 0x0 = signal (1, 0x1)
 1180 182276693 [main] perl 92279287 void: 0x0 = signal (2, 0x1)
 1177 182277870 [main] perl 92279287 void: 0x0 = signal (3, 0x1)
 1327 182279197 [main] perl 92279287 fhandler_base::close: closing '/dev/piper' handle 0x12C
 1421 182280618 [main] perl 92279287 fhandler_base::close: closing '/dev/pipew' handle 0x124
 1412 182282030 [main] perl 92279287 fhandler_base::close: closing '/dev/pipew' handle 0x13C
 1557 182283587 [main] perl 92279287 fhandler_base::close: closing '/dev/piper' handle 0xB8
 1423 182285010 [main] perl 92279287 fhandler_base::close: closing '/dev/pipew' handle 0xC0
 1417 182286427 [main] perl 92279287 fhandler_base::close: closing '/dev/piper' handle 0xD0
 1848 182288275 [main] perl 92279287 fhandler_base::close: closing '/dev/pipew' handle 0xD4
 1431 182289706 [main] perl 92279287 sigproc_terminate: entering

--
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/