Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <30BDEE18E474D511BB0A00D0B7BB87AF092953@camel.mha.ca> From: Kris Erickson To: "'cygwin AT cygwin DOT com'" Subject: RE: Perl 5.7.2 (GDB breaks in 1.3.3-2 on certain Win2000 machines ) Date: Wed, 10 Oct 2001 13:17:00 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Ok, compiled it from the complete 1.3.4 version in CVS... It is on the second call to NetUserGetInfo that the signal fails... (gdb) break uinfo.cc:85 Breakpoint 1 at 0x61067786: file ../../../../src/winsup/cygwin/uinfo.cc, line 85. (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /mnt/c/cygdeb/test.exe Breakpoint 1, internal_getlogin (user=@0x61510094) at ../../../../src/winsup/cygwin/uinfo.cc:85 85 sys_mbstowcs (wuser, user.name (), UNLEN + 1); Current language: auto; currently c++ (gdb) n 114 const char *name () const { return pname; } (gdb) 85 sys_mbstowcs (wuser, user.name (), UNLEN + 1); (gdb) 86 if (NetUserGetInfo (NULL, wuser, 3, (LPBYTE *) &ui) && user.logsrv ()) (gdb) 117 const char *logsrv () const { return plogsrv; } (gdb) 86 if (NetUserGetInfo (NULL, wuser, 3, (LPBYTE *) &ui) && user.logsrv ()) (gdb) 88 strcat (strcpy (buf, "\\\\"), user.logsrv ()); (gdb) 89 sys_mbstowcs (wlogsrv, buf, INTERNET_MAX_HOST_NAME_LENGTH + 3); (gdb) 88 strcat (strcpy (buf, "\\\\"), user.logsrv ()); (gdb) 89 sys_mbstowcs (wlogsrv, buf, INTERNET_MAX_HOST_NAME_LENGTH + 3); (gdb) 90 ui = NULL; (gdb) 91 if (NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *) &ui)) (gdb) gdb: unknown target exception 0x000006d1 at 0x77e87e08 Program received signal ?, Unknown signal. 0x77e87e08 in _system_dlls__ () (gdb) bt #0 0x77e87e08 in _system_dlls__ () #1 0x0022f3e8 in ?? () #2 0x77d5895a in _system_dlls__ () #3 0x751511cb in _system_dlls__ () #4 0x751aa114 in _system_dlls__ () #5 0x751a8755 in _system_dlls__ () #6 0x6106785e in internal_getlogin (user=@0x61510094) at ../../../../src/winsup/cygwin/uinfo.cc:91 #7 0x61067dc6 in uinfo_init () at ../../../../src/winsup/cygwin/uinfo.cc:224 #8 0x61003c73 in dll_crt0_1 () at ../../../../src/winsup/cygwin/dcrt0.cc:682 #9 0x61004159 in _dll_crt0 () at ../../../../src/winsup/cygwin/dcrt0.cc:849 #10 0x61004198 in dll_crt0 (uptr=0x0) at ../../../../src/winsup/cygwin/dcrt0.cc:861 #11 0x004010bf in cygwin_crt0 () at /cygnus/netrel/src/cygwin-1.3.3-2/winsup/cygwin/lib/cygwin_crt0.c:33 (gdb) Going to do some more poking around after lunch... Sorry about the previous post/confusion... Kris -----Original Message----- From: Christopher Faylor [mailto:cgf AT redhat DOT com] Sent: Wednesday, October 10, 2001 12:33 PM To: cygwin AT cygwin DOT com Cc: kris AT mha DOT ca Subject: Re: Perl 5.7.2 (GDB breaks in 1.3.3-2 on certain Win2000 machines ) On Wed, Oct 10, 2001 at 12:05:11PM -0700, Kris Erickson wrote: >More weirdness... The latest CVS version version of uinfo.cc does not >seem to break, although the compiler seems to have optimized out the >second call to NetUserGetInfo()... However, the first call to >NetUserGetInfo >seems to succeed... Here is a debugging session... Finally! Feedback! FWIW, the CVS version is the same as the snapshot. There have been no winsup/cygwin CVS updates since the snapshot. I indicated that there was an outside chance that I'd fixed the problem so it is not unbelievably surprising that things would be working now. It is very surprising that a CVS-built version would differ from the snapshot, though. If you think that the compiler has optimized out the second call to NetUserGetInfo (which would be very strange) then build uinfo.o with optimization turned off. rm uinfo.o make CFLAGS='-gstabs+ -MD' There is no guarantee that optimized code will be easy to debug so it is often necessary to turn off optimization when you want to do serious debugging. For the curious, the difference in this code that I thought might solve the problem was setting the ui variable to NULL prior to the second invocation of NetUserGetInfo. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/