Cygwin: How to Fix a “proc magic mismatch detected” error

This post is mostly for posterity, for those combing the internet for the solution to this obscure and frustrating problem with Cygwin. I spent hours trying to track this problem down, and the solution was really easy once I knew how to implement it.

For those of you who don’t know, Cygwin is a program that lets you do all kinds of neat stuff from the command line that you can’t do on the normal windows Command Line utility. Basically, it lets me use all the stuff I found really useful in Linux without having to switch away from Windows.

One of the things you can do with Cygwin is set up what’s called an SSH host, which lets you access your computer from another computer on the network in order to move files around, run programs, whatever. SSH is like a remote control for your computer. But recently, I discovered that my SSH host was broken. I tried everything I could think of to fix it. When I checked the logs, it gave me dozens of this message:

C:\cygwin\usr\sbin\sshd.exe (5448): *** proc magic mismatch detected – 0x704D1F7E/0xD94C588A.
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.

So I searched for cygwin1.dll, looking for extra copies lying around. I couldn’t find any with the Windows search. Rebooting didn’t help either. Worse, there was nothing on Google that helped me out. I was planning to uninstall Cygwin and reinstall it, which would have been a huge pain. Just before I did, though, I did one final search on Google.

Paydirt! Here is the solution. In the command line run:

cygcheck -s -v -r > cygcheck.out
grep cygwin1.dll cygcheck.out

This will give you a list of where Cygwin is finding the extra copies of cygwin1.dll. Remove all of them except for c:\cygwin\bin\cygwin1.dll.

Hopefully, that will help someone else who may be encountering the same problem I was.

21 thoughts on “Cygwin: How to Fix a “proc magic mismatch detected” error

  1. Good solution. I only found the cygwin1.dll at directory at which cygwin was installed. But the list show another cygwin1.dll at c:/windows/system.

  2. When I grep cygcheck.out it says that I have a cygwin1.dll in my WINDOWS/system32 folder, but when I go there to delete the file I cannot find it. Any suggestions?

  3. It may be a hidden file. In windows explorer, go to Tools – Folder Options. Click on the View tab and check “show hidden files and folders.”

    Then check the windows/system32 folder to see if it has reappeared.

  4. thank you, thank you, thank you! this solved my problem, thankfully before I resorted to reinstalling cygwin. this is a perfect example of why I love the internet… :)

  5. Hmm… Maybe if you go into Cygwin and type:

    cd c:
    cd WINDOWS/system32
    rm cygwin1.dll

    and then restart Cygwin, it might work.

  6. Thanks, J.D.
    A regular windows search did not turn up the extra cygwin1.dll, so I was very frustrated. My extra cygwin1.dll was in my WINDOWS/system32 folder but it was not visible though I have view hidden files enabled. Weird. All I did was use ‘rm’ from the command line and it worked just fine, and I am up and running again.

  7. Thanks! I hate when Windows hides things even if you have chosen the “show me everything” option. Sometimes Bill doesn’t know what is best for me….

  8. You can’t get rid of the cygwin1.dll in the system32 folder from the command line using erase, I guess erase doesn’t see files marked as system.

  9. Good work! I have ARM compiler, which wouldn’t start. Finally it began work after remove original c:\cygwin\bin\cygwin1.dll and move to this place cygwin1.dll from enviroment of ARM compiler (c:\gnuarm\bin). It was made for compiler need extra entry points into cygwin1.dll which original system DLL hasn’t.
    It was very easy follow your information. Thanks!


  10. WinXP – Can’t delete it? Here’s how.

    – Reboot in Safe Mode
    – Start > Run… > cmd (hit enter). Then in the command line, type:
    – cd c:\windows\system32
    – attrib cyg*.dll -s -h
    – del cyg*.dll

    That worked for me at least

  11. Like everyone else has said: Thank you! I just came across this problem myself, and even after deleting a bunch of erroneous cygwin1.dll files (lots of random programs seem to have their own version), I was still hitting this error. I found the cygwin1.dll file in system32, but even after making sure that I hadn’t accidently switched to Idiot Mode, the file was still hidden – good call, Microsoft, users really don’t need to see their files! Maybe Vista can come with an automatic rootkit and save all the hacker/crackers the trouble?

    Anyway, thanks Melissa A, your message solved my problem.

  12. Hey everyone,

    The above all was good. One extra step was required after issuing the commands thomas suggested. Go to C: -> WINDOWS -> system3 and you can now see the cyg files. Right click -> Properties -> uncheck read-only. Now re-issue the commands given by thomas:

    – Start > Run… > cmd (hit enter). Then in the command line, type:
    – cd c:\windows\system32
    – attrib cyg*.dll -s -h
    – del cyg*.dll

  13. Ty , i had c:\documents and settings\user\WINDOWS\system folder ,after deleting it got the cygwin working =)

  14. Pingback: Car Control Remote Toy