Skip to content

No more STATUS_ACCESS_VIOLATION on Cygwin under Windows7

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.

  1. 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"
    
  2. Copy /bin/ash.exe to /usr/bin/ash.exe (eventually create the directory if it does not exist).
  3. Kill all Cygwin related processes. This also includes any xterm, bash, and even XWin.exe server.
  4. Execute /bin/ash.exe
  5. 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.
  6. 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

12 thoughts on “No more STATUS_ACCESS_VIOLATION on Cygwin under Windows7”

  1. Thanks for the guidelines. Unfortunately they didn’t help in my case.
    I’ve encountered problems with running git because of the issues with forking (Windows 7, 32-bit), and the rebasing is expected to help in such cases…
    Here is my error log:
    # git pull
    C:\PROGRA~1\Git\bin\sh.exe: *** 1. unable to allocate heap 0x10050000, heap_chunk_size 268435456, pid 4080, Win32 error 0
    0 [main] sh 3964 sync_with_child: child 4080(0x174) died before initialization with status code 0x1
    1064 [main] sh 3964 sync_with_child: *** child state waiting for longjmp
    /libexec/git-core/git-sh-setup: fork: Resource temporarily unavailable

    1. As far as I understood, rebaseall and peflagsall scripts are meant to be run each time you install new packages/libraries in your Cygwin setup. Maybe try it again if you modified your setup ?

      I have seen also the same problem appear when my computer gets back from hibernation :-/ The solution for this is to reboot.

      If nothing helps, you can try the other advices I found on Google about the problem, especially the DEP disabling.

  2. Hi,

    I have followed all your steps. but when i run /bin/rebaseall i get the following statements
    not foundall : 2 :/bin/rebaseall
    not foundall :25 : /bin/rebaseall
    /bin/rebaseall : 29 : cant cd to bin
    not found : 30 :/bin/rebaseall
    not found : 39 : /bin/rebaseall
    not found : 42 :/bin/rebaseall : {
    [-b baseoffset] [-o offset][-s dllsuffix] [-t filelist |-]

    can you please suggest me what to do

    1. Hi

      I never ran into this kind of error while executing rebaseall. Looking at your errors, I would think that your Cygwin Shell environment is kind of incorrectly setup. Maybe reinstall Cygwin ?

      Sorry I can’t be more helpful. Maybe somebody else will have a better clue.

  3. Pingback: URL

  4. Hooray! This totally worked for me. I installed Cygwin/X on Cygwin64 on Windows 8, and my xterm window would crash every time I tried to use the toolbar menu (I was trying to add the scrollbar, but it turns out everything would crash it!). The specified change wasn’t on line 110 in the rebaseall file for me, but I searched for “cygwin1\.dll” and found the spot,
    sed -e ‘/\/cygwin1\.dll$/d’ -e ‘/\/cyglsa.*\$
    -e ‘/sys-root\/mingw/d’ -e ‘s/^/\//’ \

    and changed it to:
    sed -e ‘/\/cygwin1\.dll$/d’ -e ‘/\/mingw\/bin.*\.dll$/d’ -e ‘/\/cyglsa.*\$
    -e ‘/sys-root\/mingw/d’ -e ‘s/^/\//’ \

    rebaseall ran without error, and peflagsall just skipped a couple of shell executables.

Leave a Reply to Alexandra Cancel reply

Your email address will not be published. Required fields are marked *