Mail Archives: cygwin/2006/03/16/12:52:16
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...
-------------------------<snip>
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>
-------------------------<snip>
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:
-------------------------<snip>
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);
-------------------------<snip>
-------------------------<snip>
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);
-------------------------<snip>
Here's what it looks like when I run the old binutils:
-------------------------<snip>
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
-------------------------<snip>
and here's what it's like when I try the newly built binutils:
-------------------------<snip>
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.
-------------------------<snip>
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/
- Raw text -