(CURR_CHILD_INFO_MAGIC): Update.
(child_info::magic): Make 'long'.
* cygheap.h: Export _cygheap_start.
* cygheap.cc: Don't declare _cygheap_start.
* cygmagic: Use cksum to produce checksums. Append 'U' to end of checksum.
* dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
(_dll_crt0): Detect cygheap mismatch as indicative of different cygwin version.
Set child_proc_info to NULL when _PROC_WHOOPS.
(multiple_cygwin_problem): If child_info specific problem, then set
child_proc_info type to _PROC_WHOOPS.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(CURR_SHARED_MAGIC): Ditto.
+2002-08-27 Christopher Faylor <cgf@redhat.com>
+
+ * child_info.h: Add _PROC_WHOOPS enum value.
+ (CURR_CHILD_INFO_MAGIC): Update.
+ (child_info::magic): Make 'long'.
+ * cygheap.h: Export _cygheap_start.
+ * cygheap.cc: Don't declare _cygheap_start.
+ * cygmagic: Use cksum to produce checksums. Append 'U' to end of
+ checksum.
+ * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
+ (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
+ version. Set child_proc_info to NULL when _PROC_WHOOPS.
+ (multiple_cygwin_problem): If child_info specific problem, then set
+ child_proc_info type to _PROC_WHOOPS.
+ * shared_info.h (CURR_MOUNT_MAGIC): Update.
+ (CURR_SHARED_MAGIC): Ditto.
+
2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
* fhandler.h (fhandler_socket::recvfrom): Fix prototype.
-/* childinfo.h: shared child info for cygwin
+/* child_info.h: shared child info for cygwin
- Copyright 2000, 2002 Red Hat, Inc.
+ Copyright 2000, 2001, 2002 Red Hat, Inc.
This file is part of Cygwin.
{
_PROC_EXEC,
_PROC_SPAWN,
- _PROC_FORK
+ _PROC_FORK,
+ _PROC_WHOOPS
};
#define OPROC_MAGIC_MASK 0xff00ff00
#define EXEC_MAGIC_SIZE sizeof(child_info)
-#define CURR_CHILD_INFO_MAGIC 0x8b3c
+#define CURR_CHILD_INFO_MAGIC 0xb3836013U
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between
DWORD zero[4]; // must be zeroed
DWORD cb; // size of this record
DWORD intro; // improbable string
- unsigned short magic; // magic number unique to child_info
+ unsigned long magic; // magic number unique to child_info
unsigned short type; // type of record, exec, spawn, fork
int cygpid; // cygwin pid of child process
HANDLE subproc_ready; // used for synchronization with parent
extern "C" {
static void __stdcall _cfree (void *ptr) __attribute__((regparm(1)));
-extern void *_cygheap_start;
}
inline static void
char *__stdcall cstrdup1 (const char *) __attribute__ ((regparm(1)));
void __stdcall cfree_and_set (char *&, char * = NULL) __attribute__ ((regparm(2)));
void __stdcall cygheap_init ();
+extern DWORD _cygheap_start;
}
/* autogenerated - do not edit */
#include "$file"
EOF
-if sum -r /dev/null >/dev/null 2>&1; then
- sumit(){ sum -r $*; }
-else
- sumit(){ sum $*; }
-fi
+sumit() {
+ cksum $*
+}
while [ -n "$1" ]; do
define=$1; shift
struct=$1; shift
- sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%x", $1}'`
+ sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
echo "#define $define $sum"
curr=`sed -n "s/^#[ ]*define CURR_$define[ ][ ]*\([^ ][^ ]*\)/\1/p" $file`
[ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
#ifdef DEBUGGING
if (GetEnvironmentVariable ("CYGWIN_SLEEP", buf, sizeof (buf) - 1))
{
+ DWORD ms = atoi (buf);
buf[0] = '\0';
len = GetModuleFileName (NULL, buf, MAX_PATH);
- console_printf ("Sleeping %d, pid %u %s\n", atoi (buf), GetCurrentProcessId (), buf);
- Sleep (atoi (buf));
+ console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf);
+ Sleep (ms);
}
if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1))
{
multiple_cygwin_problem ("proc", child_proc_info->intro, 0);
else if (child_proc_info->intro == PROC_MAGIC_GENERIC
&& child_proc_info->magic != CHILD_INFO_MAGIC)
- multiple_cygwin_problem ("proc", child_proc_info->magic, CHILD_INFO_MAGIC);
+ multiple_cygwin_problem ("proc", child_proc_info->magic,
+ CHILD_INFO_MAGIC);
+ else if (child_proc_info->cygheap != (void *) &_cygheap_start)
+ multiple_cygwin_problem ("cygheap", (DWORD) child_proc_info->cygheap,
+ (DWORD) &_cygheap_start);
unsigned should_be_cb = 0;
switch (child_proc_info->type)
{
}
default:
system_printf ("unknown exec type %d", child_proc_info->type);
+ /* intentionally fall through */
+ case _PROC_WHOOPS:
child_proc_info = NULL;
break;
}
void
multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned version)
{
- if (_cygwin_testing && strstr (what, "proc"))
+ if (_cygwin_testing && (strstr (what, "proc") || strstr (what, "cygheap")))
{
- fork_info = NULL;
+ child_proc_info->type = _PROC_WHOOPS;
return;
}
#define MOUNT_VERSION 27 // increment when mount table changes and
#define MOUNT_VERSION_MAGIC CYGWIN_VERSION_MAGIC (MOUNT_MAGIC, MOUNT_VERSION)
-#define CURR_MOUNT_MAGIC 0xf4e5
+#define CURR_MOUNT_MAGIC 0x4fe431cdU
#define MOUNT_INFO_CB 16488
class reg_key;
#define SHARED_INFO_CB 47112
-#define CURR_SHARED_MAGIC 0x88e
+#define CURR_SHARED_MAGIC 0x29eb8ccdU
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between