Cygwin Wiki
Register
Advertisement

Sometimes, after updating or installing packages, you'll start to get strange errors related to "fork()" or .dll loading. These errors are usually solved by rebasing your packages.

Rebasing[]

Requiring full rebase[]

To rebase, you need to trigger the autorebase package:

$ /usr/bin/rebase-trigger full

The output will be

"Note: _autorebase will do a full rebase the next time setup is run."

For more info on autorebase, read "/usr/share/doc/Cygwin/_autorebase.README"

Stop Running Services[]

Before running setup, x86 or x86_64 depending on your installation, you'll need to make sure no cygwin-based services or programs are running (including X11, SSH, etc). To see all running programs:

$ ps -a

To see the list of all installed services

$ cygrunsrv -L 

 To query the status and stop the cygwin services

$ cygrunsrv -Q <servicename>
$ cygrunsrv -E <servicename>

as last close your terminal.

Rebase Everything[]

Now that no Cygwin services are running, you can rebase your packages. Run setup-x86.exe or setup-x86_64.exe depending on your system, like a normal updated. Also if no package are updated the post install phase will include a full rebase.

Notes[]

  • Note that the need to rebase is in many cases due to incompatible software that messes with Cygwin: see http://cygwin.com/faq/faq.html#faq.using.bloda So, unless you disable/uninstall such software, the fork issues may continue to reoccur after you rebaseall.
  • If you run into "rebaseall failed with last error 13", look at the permissions of the file where the error occured. There are two common causes for this error - one is that something is holding an open file handle for the problematic file, and the other is the filesystem has the file marked as "read-only". Unfortunately, the error handling code in rebaseimage (the program that's called by rebaseall to do the dirty work) can't distinguish between these two cases. Worse, rebaseimage works at a very low level in the filesystem interface code, and correctly and transparently recovering from the read-only file case is almost unbelievably complicated.
    • In other words, you should fix the file's permissions (turn off "read-only" to allow writing) and run the rebase again.

Is there any way of indicating how important this tip is, as it cures what appears to be a total cygwin crash?

rebase exist to work around limitations in DLL memory management in Windows. The 64 bit port of Cygwin is less prone to address collision issue due to the larger address space. If you have a 64bit system, cygwin x86_64 architecture is the recommend version for you (Really!!)

Advertisement