X-Spam-Check-By: sourceware.org From: "Dave Korn" To: Subject: Don't understand proc magic check. Date: Thu, 16 Mar 2006 17:51:45 -0000 Message-ID: <002b01c64922$4ab5ec30$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi all, I've just built a fresh dll from cvs and I wanted to get some fresh binutils so they'd understand the separate dll/dbg file format[*]. I built bog-standard 2.16.1 from a tarball, installed into a test --prefix, and tried running one of the tools, and I got... ------------------------- dk AT rainbow /usr/build/install/bin> ./addr2line.exe 3 [main] ? (3820) C:\cygwin\usr\build\install\bin\addr2line.exe: *** fatal error - proc magic mismatch detected - 0x88E640F7/0xC87757A7. This problem is probably due to using incompatible versions of the cygwin DLL. Search for cygwin1.dll using the Windows Start->Find/Search facility and delete all but the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution. Rebooting is also suggested if you are unable to find another cygwin DLL. dk AT rainbow /usr/build/install/bin> ------------------------- OK, I understand what that message is saying, but I'm really /very/ sure it's wrong; I absolutely do not have any other versions of the dll installed, there are absolutely no other cygwin apps running apart from the bash shell I'm executing this commandline in, I absolutely haven't forgotten and left a cygwin-based service going, and I've used process explorer's search function to make sure nothing has a handle to any object at all with 'cygwin' in the name (after exiting the bash shell), and I've even used winobj to check in /BaseNamedObjects and make sure that when I exit the bash shell the shared section has been properly deleted and not kept around by a stale handle and it has. And I've rebooted since then and it's still happening. And I've looked through the disassembly of the dll with objdump and it definitely both sets and checks for the same 0x88E640F7 value. I can't find that 0xC87757A7 constant anywhere in the hex dump of it. And why oh why does it not happen if I run it under strace? I added some debugging printf's: ------------------------- child_info::child_info (unsigned in_cb, child_info_types chtype, bool need_subproc_ready) { memset (this, 0, in_cb); cb = in_cb; intro = PROC_MAGIC_GENERIC; magic = CHILD_INFO_MAGIC; system_printf ("Magic is $%08x at $%08x in child_info* $%08x\n", magic, &magic, this); ------------------------- ------------------------- child_info * get_cygwin_startup_info () { STARTUPINFO si; char zeros[sizeof (child_proc_info->zero)] = {0}; GetStartupInfo (&si); child_info *res = (child_info *) si.lpReserved2; if (si.cbReserved2 < EXEC_MAGIC_SIZE || !res || memcmp (res->zero, zeros, sizeof (res->zero)) != 0) res = NULL; else { system_printf ("res is $%08x giving magic $%08x at $%08x\n", res, res->magic, &res->magic); if ((res->intro & OPROC_MAGIC_MASK) == OPROC_MAGIC_GENERIC) multiple_cygwin_problem ("proc intro", res->intro, 0); else if (res->intro == PROC_MAGIC_GENERIC && res->magic != CHILD_INFO_MAGIC) multiple_cygwin_problem ("proc magic", res->magic, CHILD_INFO_MAGIC); else if (res->cygheap != (void *) &_cygheap_start) multiple_cygwin_problem ("cygheap base", (DWORD) res->cygheap, (DWORD) &_cygheap_start); ------------------------- Here's what it looks like when I run the old binutils: ------------------------- dk AT rainbow /test/mutex> addr2line < /dev/null 1724203863 [main] bash 2596 child_info::child_info: Magic is $88E640F7 at $0023E950 in child_info* $0023E938 3 [main] ? (1640) get_cygwin_startup_info: res is $000207F8 giving magic $88E640F7 at $00020810 1724215768 [main] bash 1640 child_info::child_info: Magic is $88E640F7 at $0023E8E8 in child_info* $0023E8D0 3 [main] ? (1576) get_cygwin_startup_info: res is $000208F4 giving magic $88E640F7 at $0002090C addr2line: 'a.out': No such file ------------------------- and here's what it's like when I try the newly built binutils: ------------------------- dk AT rainbow /test/mutex> /usr/build/install/bin/addr2line < /dev/null 1733496955 [main] bash 2596 child_info::child_info: Magic is $88E640F7 at $0023E950 in child_info* $0023E938 2 [main] ? (2996) get_cygwin_startup_info: res is $000207F8 giving magic $88E640F7 at $00020810 1733506722 [main] bash 2996 child_info::child_info: Magic is $88E640F7 at $0023E8E8 in child_info* $0023E8D0 2 [main] ? (2436) C:\cygwin\usr\build\install\bin\addr2line.exe: *** fatal error - proc magic mismatch detected - 0x88E640F7/0xC87757A7. This problem is probably due to using incompatible versions of the cygwin DLL. ------------------------- I don't even understand how it can get to the "proc magic mismatch" error without printing out the "res is ..." debugging message, and I'm kinda stumped what to try next. Anyone got /any/ suggestions at all? cheers, DaveK [*] I may be mistaken in my belief that I need them, but that's beside the point. -- Can't think of a witty .sigline today.... -- 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/