I recently reinstalled Cygwin 1.7.9-1 on a Windows7 Ultimate edition (64bits), and like many many people, I ran into the problems of randomly thrown exceptions by xterm and alike processes.
For example when starting xterm:
4 [main] xterm 7156 exception::handle: Exception: STATUS_ACCESS_VIOLATION 1449 [main] xterm 7156 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 4 [main] xterm 7996 exception::handle: Exception: STATUS_ACCESS_VIOLATION 1356 [main] xterm 7996 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 4 [main] xterm 5268 exception::handle: Exception: STATUS_ACCESS_VIOLATION 647 [main] xterm 5268 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 5 [main] xterm 4316 exception::handle: Exception: STATUS_ACCESS_VIOLATION 739 [main] xterm 4316 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 2 [main] xterm 2752 exception::handle: Exception: STATUS_ACCESS_VIOLATION 1123 [main] xterm 2752 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 5 [main] xterm 3220 exception::handle: Exception: STATUS_ACCESS_VIOLATION 1260 [main] xterm 3220 open_stackdumpfile: Dumping stack trace to xterm.exe.stackdump 6 [main] xterm 6752 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x600, errno 11 xterm: Error 29, errno 11: Resource temporarily unavailable Reason: spawn: fork() failed
When googling, some people seem to solve it just by disabling Windows DEP. Well for me it did not work (errors were exactly the same with DEP exceptions for Cygwin processes, and even with DEP completely disabled).
I solved it by executing some Cygwin maintenance that should definitely be integrated in Cygwin’s setup, but is not as of today.
This maintenance task is named rebaseall: you have to first install it as a Cygwin package, and you can find a very useful readme in /usr/share/doc/Cygwin/rebase-X.Y.Z.README
file, explaining the ins and outs of this process.
-
Modify /bin/rebaseall script: This script needs a minor modification to not fail on 64bits MingW DLLs. Change its line 110 from
sed -e '/cygwin1\.dll$/d' -e '/cyglsa.*\.dll$/d' -e 's/^/\//' >"$TmpFile"
to
sed -e '/cygwin1\.dll$/d' -e '/mingw\/bin.*\.dll$/d' -e '/cyglsa.*\.dll$/d' -e 's/^/\//' >"$TmpFile"
-
Copy
/bin/ash.exe
to/usr/bin/ash.exe
(eventually create the directory if it does not exist). -
Kill all Cygwin related processes. This also includes any
xterm
,bash
, and evenXWin.exe
server. -
Execute
/bin/ash.exe
-
In the ash terminal, execute
/bin/rebaseall
. It should (and has to) execute without any errors, otherwise it will leave your Cygwin install in a very unstable state. Warnings are acceptable though.
If it fails because of a used DLL, an executing Cygwin process, or anything, don’t panic: correct the problem (kill running Cygwin processes if any), and try again. -
Still in the ash terminal, execute
/bin/peflagsall
. This should also run without errors, just warnings.
Then you’re goot to go. No need to restart, you should have your Cygwin processes running without exceptions.
Cheers
Muriel
Pingback: URL