Solved

Problem Compiling MySQL Client under Cygwin

Posted on 2010-08-23
17
1,457 Views
Last Modified: 2013-11-15
Hi,
I have done this successfully in the past, so I don't know what I'm doing wrong, or if there are some issues with the newer versions, but I used to be able to install the MySQL client libraries under Cygwin, using ./configure --prefix=/usr/local/mysql --without-server. Now however, this doesn't work. Over the last week that I've been messing around with this, I have gotten closer, but still not close enough, and I need some help.

I'm not very practiced at deciphering the errors that are output during the configure process. It almost looks like it could be a permissions issue, but I've confirmed them in the Explorer Property window, and ran CACLS "C:\\cygwin" /T /E /G "BUILTIN\Administrators:F" when I was done. So while some of the errors do point to permissions, I don't know how it could be unless something is changing them during the process.

I would greatly appreciate it if anyone could give me a hand with this. I'm trying to run this from my /home/build/mysql-5.1.50 directory. I will paste the errors I am getting in the code section. They seem to be generated (my guess) from one of the Win32 dll's, as it's usually one of their function calls that makes this groan a little.

Any and all help is really appreciated.

Thanks,
Jeff
checking for mmap... yes

checking for mmap64... no

checking for getpagesize... yes

checking for pthread_attr_getstacksize... yes

checking for pthread_attr_setprio... no

checking for pthread_attr_setschedparam... yes

checking for pthread_attr_setstacksize... yes

checking for pthread_condattr_create... no

checking for pthread_getsequence_np... yes

checking for pthread_key_delete... yes

checking for pthread_rwlock_rdlock... yes

checking for pthread_setprio... no

checking for pthread_setprio_np... no

checking for pthread_setschedparam... yes

checking for pthread_sigmask... yes

checking for readlink... yes

checking for realpath... yes

checking for rename... yes

checking for rint... yes

checking for rwlock_init... no

checking for setupterm... no

      2 [main] sh 65096 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

      2 [main] sh 65096 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

./configure: fork: Permission denied

checking for shmget... ./configure: line 38019: ${+set}: bad substitution

./configure: line 38026: /usr/bin/cat: Permission denied

./configure: line 38067: /usr/bin/rm: Permission denied

      3 [sig] sh 67436 C:\cygwin\bin\sh.exe: *** fatal error - couldn't create signal pipe, Win32 error 1816

      3 [sig] sh 67436 C:\cygwin\bin\sh.exe: *** fatal error - couldn't create signal pipe, Win32 error 1816

Stack trace:

Frame     Function  Args

006CB538  610274AB  (006CB538, 00000000, 00000000, 00000000)

006CB828  610274AB  (61177840, 00008000      3 [main] sh (65688) C:\cygwin\bin\sh.exe: *** fatal error - CreateFileMapping cygpid.65688, Win32 error 1816.  Terminati

ng.

      3 [main] sh (65688) C:\cygwin\bin\sh.exe: *** fatal error - CreateFileMapping cygpid.65688, Win32 error 1816.  Terminating.

Stack trace:

Frame     Function  Args

0022DEB0  610274AB  (0022DEB0, 00000000, 00000000, 00000000)

0022E1A0  610274AB  (61177840, 00000000, 61178977)

0022F1D0  61004ADB  (611BBD18, 0022F20C, 00000004, 00000000)

      2 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

      2 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

./configure: fork: Permission denied

   1433 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

   5411 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

   1433 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

./configure: fork: Permission denied

   5411 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

./configure: fork: Permission denied

  12193 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

  12193 [main] sh 14240 fork: child -1 - CreateProcessW failed for 'C:\cygwin\bin\sh.exe', errno 13

./configure: fork: Permission denied

Open in new window

0
Comment
Question by:jpetter
  • 8
  • 4
  • 4
  • +1
17 Comments
 
LVL 24

Expert Comment

by:fridom
ID: 33508712
Could it be that yo have run this from the cmd.exe?

Have you tried to start the same from the bash command line?

Regards
Friedrich
0
 

Author Comment

by:jpetter
ID: 33509333
I ran this from the Cygwin bash command line.

Thanks,
Jeff
0
 
LVL 24

Expert Comment

by:fridom
ID: 33510038
Ok what are the permissions of sh.exe then?
0
 

Author Comment

by:jpetter
ID: 33510219
From the bash shell, the permissions are:
$ ls -l `which sh`
-rwxrwxr-x+ 1 V269239 root 470542 2010-08-13 12:58 /usr/bin/sh

However, on the disk, there is no /usr/bin folder. There is a sh.exe in /bin, which I have full control of in Windows.

Thanks,
Jeff
0
 
LVL 24

Expert Comment

by:fridom
ID: 33510736
Not fully correct the c:\cygwin directory is the "root" below you should find e.g the usr
There is some strange name mangling which makes c:\cygwin\usr\bin /usr/bin in the bash.
So what happens if you copy /usr/bin/sh.exe to /bin/sh.exe?

errno 13 means "permission denied. It could be if you see the permissions which just have 775 which means "other" has no write permission.

You can try
chmod 777 /usr/bin/sh.exe

and see what happens then.

Regards
Friedrich
0
 

Author Comment

by:jpetter
ID: 33511907
It wouldn't let me perform the copy as it claimed to be the same file - possibly a soft link?
$ cp `which sh` /bin
cp: `/usr/bin/sh' and `/bin/sh.exe' are the same file

I did replace the group root with the group I am in, and executed the chgrp recursively under the c:\cygwin. I also changed the group of /bin to that of my group thinking that might be an issue.

I tried it, and while configure did get further, it bombed out. I could even paste the screen into an editor, as nothing would open...I had to reboot the computer. I didn't try changing sh.exe to 777, as some of the errors that I didn't copy had permission denied on sed.exe, and numerous other files from the /bin folder.

It definitely does appear to be permissions related, and it really must have stepped all over Windows during the configure process, as I couldn't launch any program after configure stopped, and before I rebooted.

Thanks,
Jeff
0
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 33512146
What version of Cygwin and what version of Windows are you using?  I just read that Cygwin 1.7 dropped support for anything before Windows 2000.
0
 

Author Comment

by:jpetter
ID: 33512644
I'm running Cygwin 1.7, and Windows XP SP3.

Thanks,
Jeff
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 24

Expert Comment

by:fridom
ID: 33518254
Hm there is one question left than. Where does CreateProcessW try to write to?

But then I'd think the problem is with the installation which may have not set access permissions right.

Sorry, but without checking it out here (and I avoid cygwin like a plague) because it messes around too much with Windows, I can not be of any more help. Sorry that I could not help.
0
 

Author Comment

by:jpetter
ID: 33519787
It's a little cryptic, and I can't really tell where CreateProcessW is trying to write to, or more appropriate for this API call is I can't tell what process it is trying to run.

I agree with you in that the permissions are at the root of the problem, and most of the searching I've done on the web does indicate permission issues.

I'm not too fond of Cygwin either, but I need to *nix" tool set available there.

Thanks for trying to help out, I really appreciate that. If I don't hear anything else in another day, I'll give you the points anyhow.

Thanks,
Jeff
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 33832877
/usr/bin is an alias to /bin if i remember properly (didnt use cygwin for years now)
/usr/bin/cat: Permission denied : this suggest you do not have privilege to use these commands
if you cannot use them from the command line, here is your problem

i believe the real problem is the following :
your windows user is mapped to nothing on cygwin
"mkpasswd" should help you correct that
if you performed an upgrade, your passwd file probably got overwritten

possibly as well, the script performs some kind of "su"
and i guess root is not admin of your windows box so it actually drops privilege trying to escalate
if root is not mapped at all, it probably has no privilege at all, or possibly nobody's

---

few hints go get good integration
- alias root and your administrator user (uid 500 on windows) or your current user
- tail the cygwin path after yours under windows
- tail the windows path after cygwins in your .bashrc (be carefull while debugging dll problems afterwards)

0
 

Author Comment

by:jpetter
ID: 33946540
skullnobrains,

I apologize for not getting back to this sooner, but have been buried on another project.

I too believe the problems lies in permissions, but finding the root issue has been difficult for me.

I will paste an excerpt from both my /etc/passwd, and /etc/groups that shows me (username=v269239) in the code section. I believe I am mapped, though I am just basing that on the fact that on some other systems, this configuration is working for me.

What I find odd is that of all the files the configure script complains about "Permission denied", I have access to from the command line. (both in Windows and Cygwin) In the script however, I continue to get the "Permission denied" error.

If you have any ideas of what could be going on, I would certainly appreciate the help. I'm about fresh out of ideas...have even completely removed Cygwin a couple time and reinstalled it - this last time with everything...I took the entire install thinking I may have been missing something, but I don't know what it could be.

Thanks, and again I apologize for being "absent" for a couple weeks.

Jeff
/etc/passwd:

SYSTEM:*:18:544:,S-1-5-18::

LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::

NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::

Administrators:*:544:544:,S-1-5-32-544::

ASPNET:unused:1005:513:ASP.NET Machine Account,U-TUSNY062LK11002\ASPNET,S-1-5-21-3773055056-1013549282-4279914243-1005:/home/ASPNET:/bin/bash

HDSADMIN:unused:1009:513:U-TUSNY062LK11002\HDSADMIN,S-1-5-21-3773055056-1013549282-4279914243-1009:/home/HDSADMIN:/bin/bash

HDSUSER:unused:1016:513:U-TUSNY062LK11002\HDSUSER,S-1-5-21-3773055056-1013549282-4279914243-1016:/home/HDSUSER:/bin/bash

HelpAssistant:unused:1015:513:Remote Desktop Help Assistant Account,U-TUSNY062LK11002\HelpAssistant,S-1-5-21-3773055056-1013549282-4279914243-1015:/home/HelpAssistant:/bin/bash

localadmin:unused:500:513:U-TUSNY062LK11002\localadmin,S-1-5-21-3773055056-1013549282-4279914243-500:/home/localadmin:/bin/bash

LocalGuest:unused:501:513:U-TUSNY062LK11002\LocalGuest,S-1-5-21-3773055056-1013549282-4279914243-501:/home/LocalGuest:/bin/bash

smsinstall:unused:1008:513:U-TUSNY062LK11002\smsinstall,S-1-5-21-3773055056-1013549282-4279914243-1008:/home/smsinstall:/bin/bash

SUPPORT_388945a0:unused:1002:513:CN=Microsoft Corporation,L=Redmond,S=Washington,C=US,U-TUSNY062LK11002\SUPPORT_388945a0,S-1-5-21-3773055056-1013549282-4279914243-1002:/home/SUPPORT_388945a0:/bin/bash

V269239:unused:54552:10513:U-US1\V269239,S-1-5-21-1801674531-2049760794-725345543-44552:/home/V269239:/bin/bash

root:*:500:500:S-1-5-32-544::



/etc/group:

root:S-1-5-32-544:0:

SYSTEM:S-1-5-18:18:

Administrators:S-1-5-32-544:544:

Backup Operators:S-1-5-32-551:551:

Guests:S-1-5-32-546:546:

Network Configuration Operators:S-1-5-32-556:556:

Power Users:S-1-5-32-547:547:

Remote Desktop Users:S-1-5-32-555:555:

Replicator:S-1-5-32-552:552:

Users:S-1-5-32-545:545:

HelpLibraryUpdaters:S-1-5-21-3773055056-1013549282-4279914243-1025:1025:

HelpServicesGroup:S-1-5-21-3773055056-1013549282-4279914243-1001:1001:

Offer Remote Assistance Helpers:S-1-5-21-3773055056-1013549282-4279914243-1010:1010:

SQLServer2005MSSQLServerADHelperUser$TUSNY062LK11002:S-1-5-21-3773055056-1013549282-4279914243-1030:1030:

SQLServer2005MSSQLUser$TUSNY062LK11002$SQLEXPRESS:S-1-5-21-3773055056-1013549282-4279914243-1031:1031:

SQLServer2005SQLBrowserUser$TUSNY062LK11002:S-1-5-21-3773055056-1013549282-4279914243-1029:1029:

None:S-1-5-21-3773055056-1013549282-4279914243-513:513:

Domain Users:S-1-5-21-1801674531-2049760794-725345543-513:10513:

Open in new window

0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 33990435
i was busy as well
.... and now deeply sorry because i really do not believe i can help you

the only thing i could possibly think of is something weird in the path you installed cygwin to
(special characters that would mess some of the forking windows calls but not others, maybe spaces...)

i'd probably also try to run both the commands and the script as root just to make sure

i'f you have valuable information, i'm ready to help
if you find the solution on your own, please post, i'm definitely interested and i guess others are as well
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 33990448
actually just saw this after posting the previous
youe ids are not correct

every one is S-1-5-21-3773055056 ....
but you are S-1-5-21-1801674531

guess there was some kind of mistake there ? or you are remotely logging to another machine ???

maybe that helps
0
 

Author Comment

by:jpetter
ID: 33990682
skullnobrains,

Interesting catch on that one. I didn't do anything unusual that I know of.. When I created the file initially, I tried both the -d, and -D (separately) while generating the /etc/passwd file as I do belong to a domain, so I thought that was appropriate. I didn't even notice the pattern you mentioned. After making a backup, I tried playing around, but I got errors regardless of what I made that string to be. I couldn't even unpack the tarball as I received the error: "Cannot change ownership to uid 7155, gid 10: Invalid argument" on each file it tried to decompress.

I've had some other "odd" problems with this system, and think maybe I need to reload the OS, and then try this over again.

I really appreciate your help on this, and sticking with it for so long. I'll give you the points, which I imagine are secondary to solving the problem, but I think I need to get a clean load of the OS so I know I'm chasing the correct errors.

Thanks,
Jeff
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 33992102
help was my pleasure

the problem was interesting,
you look like someone who does what it takes to help himself out,
and do not relinquish to provide relevant information

feel free to ask anything you want directly to me and without points
i'll be glad to help if i can
use that thread if you cannot send me an email through the site
i cannot paste it here because i recollect i already have been in trouble here years ago because i posted my email once

ps : thanks for the catch, but i'm not sure that actually solves your problem. hope it does.
0
 

Author Comment

by:jpetter
ID: 33992512
Thanks a lot for the help. As I write, I'm no farther than I was, but I haven't rebuilt the system yet. I should note that I have successfully done this before on XP SP3 systems, which adds to my confusion, and has me leaning towards rebuilding from the ground up.

I appreciate your offer, and don't be surprised if I take you up on it sometime.

Thanks again,
Jeff
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now