RE: Don't understand proc magic check.

2006-03-17 Thread Dave Korn
On 16 March 2006 20:21, Brian Dessent wrote:

 Dave Korn wrote:
 
   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?
 
 By any chance are you trying to use the newly-built DLL with installed
 headers from 1.5.19 or some other version that is still older than the
 just-built DLL?  I make it a point to do something like make
 install-headers DESTDIR=/usr whenever installing a newly-built
 cygwin1.dll that I intend to actually use.

  Nahh, didn't help.  Bizarro.

  Oh, hang on.  DESTDIR= doesn't seem to work.  Just specifying
prefix=/usr turns out to do the trick.

  Bingo!  Thanks Brian.  That's exactly what the message was trying to tell
me.

 [*] I may be mistaken in my belief that I need them, but that's beside the
 point.
 
 I've never had any problems using the packaged version of binutils, it
 seems to work fine with the split .dbg file.  The packaged version of
 binutils is what created the .dbg file in the build in the first place,
 so I would say it's safe to assume that it has that support.

  Ah, but I'm running with a setup based off a slightly stale internal mirror,
but then there's a few bits and pieces I've built from source... I'm not quite
sure what versions of a lot of things I've got installed a lot of the time!

  Oh and anyway maybe it was gdb/insight I needed to rebuild.  I really ought
to keep notes! :)

cheers,
  DaveK
-- 
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/



Re: Don't understand proc magic check.

2006-03-17 Thread Brian Dessent
Dave Korn wrote:

   Nahh, didn't help.  Bizarro.
 
   Oh, hang on.  DESTDIR= doesn't seem to work.  Just specifying
 prefix=/usr turns out to do the trick.
 
   Bingo!  Thanks Brian.  That's exactly what the message was trying to tell
 me.

Ah, that will teach me to type commands that I haven't actually used.  I
configure with --prefix=/usr specifically so I can do these after
building the DLL and stopping all services:

make -C cygwin install-headers install-man
make -C utils install
make -C cygserver install
# run CMD.EXE and install cygwin1.dll+cygwin1.dbg

This is my equivalent of installing the full snapshot, except that I
build it myself with a handful of local patches.

Brian

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



Don't understand proc magic check.

2006-03-16 Thread Dave Korn

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
[EMAIL PROTECTED] /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.
[EMAIL PROTECTED] /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
[EMAIL PROTECTED] /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
[EMAIL PROTECTED] /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 

Re: Don't understand proc magic check.

2006-03-16 Thread Brian Dessent
Dave Korn wrote:

   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?

By any chance are you trying to use the newly-built DLL with installed
headers from 1.5.19 or some other version that is still older than the
just-built DLL?  I make it a point to do something like make
install-headers DESTDIR=/usr whenever installing a newly-built
cygwin1.dll that I intend to actually use.

 [*] I may be mistaken in my belief that I need them, but that's beside the
 point.

I've never had any problems using the packaged version of binutils, it
seems to work fine with the split .dbg file.  The packaged version of
binutils is what created the .dbg file in the build in the first place,
so I would say it's safe to assume that it has that support.

Brian

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