Cygwin and gdb - error creating process ( error 5 )
Hyena_

Yesterday I encountered a very strange problem when attempting to debug my game under Cygwin using GDB.

$ gdb arion.exe
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run 4000
Starting program: /cygdrive/d/arion/mud/src/arion.exe 4000
Error creating process /cygdrive/d/arion/mud/src/arion.exe, (error 5).
(gdb) quit

It appears that the very same error shows up whatever program I attempt to debug. I googled for hours and even downloaded gdb's src code to search for error 5 but there was no use. Neither firewall nor antivirus causes it. Can anyone give me an idea how to get it fixed? Meanwhile I try one more thing - full deletion of Cygwin and then reinstall and download all libraries again.

EDIT:

Problem solved. I deleted cygwin from drive D leaving nothing to remain. Then I installed it from scratch to the C:\cygwin directory ( no longer D:\cygwin ) and I chose only gdb and some gdbm ( devel ) libraries. After that gdb works just fine. I don't know what I did right this time but when it's not broken, don't fix it :D

BAF

Why are you using cygwin? :o

Billybob
Hyena_ said:

I don't know what I did right this time but when it's not broken, don't fix it

That seems to be what everyone said when I tried to Google the problem. They just tried random stuff until it magically worked. :P shrugs

BAF said:

Why are you using cygwin?

Why aren't you using cygwin? :o

Arthur Kalliokoski
Quote:

Why aren't you using cygwin? :o

It wasn't made by his hero, savior of the world from communist open-source software, BillG.

BAF

Cygwin is awful. I'd rather use a barbed wire fence to wipe my ass after I take a shit than use cygwin. It's the red-headed, cheap chinese knock-off of Linux.

Billybob
BAF said:

cheap chinese knock-off of Linux.

Linux is made in China.

BAF

That doesn't mean there doesn't exist a cheap chinese knock-off of it.

Billybob

I wonder if there is a cheap Chinese knockoff of Allegro?

Hyena_

Ok I got gdb working but soon after that I ran into another problem:

$ make clean
2 [main] make 2292 fork: child -1 - CreateProcessW failed for 'C:\cygwin\b
in\make.exe', errno 13
make: vfork: Permission denied

my make.exe doesn't simply work. This time reinstalling the whole Cygwin didn't give me any results.

When I gave a command "make -d" I got this:
...
...
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `Makefile.sh,v'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh,v'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `s.Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `SCCS/s.Makefile.sh'.
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `all'.
File `all' does not exist.
Finished prerequisites of target file `all'.
Must remake target `all'.
2 [main] make 5476 fork: child -1 - CreateProcessW failed for 'C:\cygwin\b
in\make.exe', errno 13
make: vfork: Permission denied
Failed to remake target file `all'.

I'm using cygwin because I can't install any linux here. The funny thing about the whole problem is that cygwin usually has worked fine under other computers but on my laptop it has problems.

Billybob

What OS are you running? Perhaps try running Cygwin as administrator (Windows Vista/7)? Check the permissions on make? (ls -la /bin/make)

BAF
Billybob said:

I wonder if there is a cheap Chinese knockoff of Allegro?

SDL? Or is that the other way around? ???

Tobias Dammers
BAF said:

Cygwin is awful. I'd rather use a barbed wire fence to wipe my ass after I take a shit than use cygwin. It's the red-headed, cheap chinese knock-off of Linux.

It tries to make Windows behave like a Unix. That's an admirable cause, and it does an amazing job, but the fact is, Windows is Windows and doesn't like being bent like that.
Also, gdb was designed with a Unix process model in mind, the mere fact that it works somewhat under Windows is amazing enough - but you shouldn't expect the true debugging experience. If you want gdb to shine, you NEED to use it on an OS that really supports it.

Hyena_

Turned out that my COMODO firewall blocked make.exe from creating a process of gcc.exe. Soon after that I got make.exe working but it didn't compile me an executable still yelling ACCESS DENIED. I used process monitor n stuff but it didn't help, finally just out of curiosity I checked the security rights of make.exe and noticed that it was not allowed to execute by any user ( even admin ). I gave the permissions and just in case gave them to gcc.exe as well..

However, now when I typed "make" I got this MS-DOS 16 bit application error and a message that cpu was given some incorrect instructions. Sooooo, after half an hour I found out that I had replaced the original make.exe with the one I found from here: http://www.equation.com/servlet/equation.cmd?fa=make

After I had restored the original make.exe I got everything perfectly working. Problems solved.

Tobias Dammers

I had to do this to make gdb work:
sudo aptitude install g++ make gdb

Thomas Fjellstrom

sudo aptitude install build-essential gdb is what I'd do.

Thread #605241. Printed from Allegro.cc