"Permission denied" on /usr/bin/sh when running gmake with multiple jobs

View: New views
12 Messages — Rating Filter:   Alert me  

"Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I've tried to solve my problem online and in the mailing list archives, but
I've had no joy.

I'm working on a makefile for an application. Everything runs fine if I just
run the make in a single job. However if I use the gmake -j<N> to run
multiple concurrent jobs I get unexpected errors from my scripts.
Specifically it seems that /usr/bin/sh becomes randomly unavailable.

Here's the (sort | uniq) error output from the make with N=3: And again,
everything's ok with N=1.

/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
/cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: /usr/bin/sh: bad
interpreter: Permission denied
/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: /usr/bin/sh.exe: bad
interpreter: Permission denied
/usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: Permission
denied
/usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: Permission
denied

I'm currently getting this on both a Windows  7  (x64) machine and an XP
(x86) machine.

Any ideas anyone?

John.





 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh, and the cygwin version is...

/usr/bin/sh --version
GNU bash, version 3.2.49(22)-release (i686-pc-cygwin)
Copyright (C) 2007 Free Software Foundation, Inc.

/john

-----Original Message-----
From: John Daintree [mailto:johnd@...]
Sent: 21 October 2009 14:26
To: cygwin@...
Subject: "Permission denied" on /usr/bin/sh when running gmake with multiple
jobs

Hello all,

I've tried to solve my problem online and in the mailing list archives, but
I've had no joy.

I'm working on a makefile for an application. Everything runs fine if I just

run the make in a single job. However if I use the gmake -j<N> to run
multiple concurrent jobs I get unexpected errors from my scripts.
Specifically it seems that /usr/bin/sh becomes randomly unavailable.

Here's the (sort | uniq) error output from the make with N=3: And again,
everything's ok with N=1.

/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
/cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: /usr/bin/sh: bad
interpreter: Permission denied
/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
/cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: /usr/bin/sh.exe: bad
interpreter: Permission denied
/usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: Permission
denied
/usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: Permission
denied

I'm currently getting this on both a Windows  7  (x64) machine and an XP
(x86) machine.

Any ideas anyone?

John.





 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Re: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've installed the beta of cygwin 1.7 and I have the same problem there.

I've now attempting to build cygwin from sources to try to figure out what's
going on.

"John Daintree" <johnd@...> wrote in message
news:hbn24q$gjf$1@......

> Hello all,
>
> I've tried to solve my problem online and in the mailing list archives,
> but I've had no joy.
>
> I'm working on a makefile for an application. Everything runs fine if I
> just run the make in a single job. However if I use the gmake -j<N> to run
> multiple concurrent jobs I get unexpected errors from my scripts.
> Specifically it seems that /usr/bin/sh becomes randomly unavailable.
>
> Here's the (sort | uniq) error output from the make with N=3: And again,
> everything's ok with N=1.
>
> /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
> /cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: /usr/bin/sh: bad
> interpreter: Permission denied
> /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_cc:
> /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: /usr/bin/sh.exe: bad
> interpreter: Permission denied
> /usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/allos/bin/verbose: Permission
> denied
> /usr/bin/sh: /cygdrive/j/12.1.dss/svn/apl/win/bin/mk_depend: Permission
> denied
>
> I'm currently getting this on both a Windows  7  (x64) machine and an XP
> (x86) machine.
>
> Any ideas anyone?
>
> John.
>
>
>
>
>
>
>
>
>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Re: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by Jurriaan Kalkman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: John Daintree <johnd@...>
Date: Fri, Oct 23, 2009 at 12:02:52PM +0100
> I've installed the beta of cygwin 1.7 and I have the same problem there.

You're not running something like a virus scanner, are you? I know my
scripts throw some strange errors when McAfee is running. Why these
errors mostly happen at night while I'm in bed, I'm not sure. However, I
do know that since I've disabled McAfee, I sleep a lot better since work
never calls in the middle of the night.

HTH,
Jurriaan

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jurriaan,

I've tried that, completely removed my Sophos anti-virus. I'm still getting
the same problem.

/john

-----Original Message-----
From: jurriaan@...
[mailto:jurriaan@...]
Sent: 23 October 2009 19:08
To: cygwin@...
Subject: Re: "Permission denied" on /usr/bin/sh when running gmake with
multiple jobs

From: John Daintree <johnd@...>
Date: Fri, Oct 23, 2009 at 12:02:52PM +0100
> I've installed the beta of cygwin 1.7 and I have the same problem there.

You're not running something like a virus scanner, are you? I know my
scripts throw some strange errors when McAfee is running. Why these
errors mostly happen at night while I'm in bed, I'm not sure. However, I
do know that since I've disabled McAfee, I sleep a lot better since work
never calls in the middle of the night.

HTH,
Jurriaan

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I'm still having this problem but I'm beginning to narrow it down.
 
Here's an example of the error I get:

"J:\trunk\svn\apl\win\bin\mk_cc:
/cygdrive/j/trunk/svn/apl/allos/bin/verbose: /usr/bin/sh: bad interpreter:
Permission denied"

I've upgraded to cygwin 1.7, and I'm running this on Windows 7 x64. Cygwin
is installed on the local C drive. I've removed all anti-virus software.

It seems that I only get this sporadic (and incorrect) "bad interpreter"
message if my scripts are located on a mounted SAMBA drive. If I move all
the scripts to my local drive the access problem goes away, but I want to
keep them on the remove drive. If I run my make task with a single job (-j1)
the problem goes away.

Here's my mount output

C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
I: on /cygdrive/i type smbfs (binary,posix=0,user,noumount,auto)
J: on /cygdrive/j type smbfs (binary,posix=0,user,noumount,auto)
M: on /cygdrive/m type smbfs (binary,posix=0,user,noumount,auto)
U: on /cygdrive/u type smbfs (binary,posix=0,user,noumount,auto)
Z: on /cygdrive/z type ntfs (binary,posix=0,user,noumount,auto)

My scripts are located on /cygdrive/j which cygwin has auto-mounted from my
J: drive, which I'd previously (using Windows) mapped from our SAMBA server.
I've experimented with acl/noacl but that seems to make no difference, and
to be honest, I'm sort of guessing a bit.

I also thought I try mapping the relevant drive directly (ie //devt/files on
/cygdrive/j) to remove the intermediate use of "J:", but I can't find out
how to prevent cygwin from automatically mounting all my drives.

I've also been trying to build a local cygwin so I can try to debug the
problem, but I can't get the build process to complete (see
http://article.gmane.org/gmane.os.cygwin/111950)


Does anyone have any tips, or things I can try in order to get this to work?


Thanks,
John.






-----Original Message-----
From: John Daintree [mailto:johnd@...]
Sent: 24 October 2009 13:37
To: cygwin@...
Subject: RE: "Permission denied" on /usr/bin/sh when running gmake with
multiple jobs

Hi Jurriaan,

I've tried that, completely removed my Sophos anti-virus. I'm still getting
the same problem.

/john

-----Original Message-----
From: jurriaan@...
[mailto:jurriaan@...]
Sent: 23 October 2009 19:08
To: cygwin@...
Subject: Re: "Permission denied" on /usr/bin/sh when running gmake with
multiple jobs

From: John Daintree <johnd@...>
Date: Fri, Oct 23, 2009 at 12:02:52PM +0100
> I've installed the beta of cygwin 1.7 and I have the same problem there.

You're not running something like a virus scanner, are you? I know my
scripts throw some strange errors when McAfee is running. Why these
errors mostly happen at night while I'm in bed, I'm not sure. However, I
do know that since I've disabled McAfee, I sleep a lot better since work
never calls in the middle of the night.

HTH,
Jurriaan

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Re: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 28 14:39, John Daintree wrote:
> My scripts are located on /cygdrive/j which cygwin has auto-mounted from my
> J: drive, which I'd previously (using Windows) mapped from our SAMBA server.
> I've experimented with acl/noacl but that seems to make no difference, and
> to be honest, I'm sort of guessing a bit.
>
> I also thought I try mapping the relevant drive directly (ie //devt/files on
> /cygdrive/j) to remove the intermediate use of "J:", but I can't find out
> how to prevent cygwin from automatically mounting all my drives.

The /cygdrive mounts are always automatic.  If you want to mount the
path manually, use another directory like, say, /home/devt-files or
something.  See
http://cygwin.com/1.7/cygwin-ug-net/using.html#mount-table


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Corinna,

Thanks, I've tried that and it doesn't seem to make much difference, I still
get the same problem.

Can you shed some light on http://article.gmane.org/gmane.os.cygwin/111950?
I may need to get my local cygwin build working to investigate this further.

/john

-----Original Message-----
From: Corinna Vinschen [mailto:corinna-cygwin@...]
Sent: 29 October 2009 08:23
To: cygwin@...
Subject: Re: "Permission denied" on /usr/bin/sh when running gmake with
multiple jobs

On Oct 28 14:39, John Daintree wrote:
> My scripts are located on /cygdrive/j which cygwin has auto-mounted from
my
> J: drive, which I'd previously (using Windows) mapped from our SAMBA
server.
> I've experimented with acl/noacl but that seems to make no difference, and
> to be honest, I'm sort of guessing a bit.
>
> I also thought I try mapping the relevant drive directly (ie //devt/files
on
> /cygdrive/j) to remove the intermediate use of "J:", but I can't find out
> how to prevent cygwin from automatically mounting all my drives.

The /cygdrive mounts are always automatic.  If you want to mount the
path manually, use another directory like, say, /home/devt-files or
something.  See
http://cygwin.com/1.7/cygwin-ug-net/using.html#mount-table


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Re: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



http://cygwin.com/acronyms/#TOFU


On Oct 29 11:25, John Daintree wrote:
> Can you shed some light on http://article.gmane.org/gmane.os.cygwin/111950?
> I may need to get my local cygwin build working to investigate this further.

>> "J:\trunk\svn\apl\win\bin\mk_cc:
>> /cygdrive/j/trunk/svn/apl/allos/bin/verbose: /usr/bin/sh: bad interpreter:
>> Permission denied"

Where's this Windows path coming from?  Are you sure you're using only
Cygwin tools?  If so, get rid of the Win32 path and use either the
matching /cygdrive path, or mount (the relevant subtree of) drive J to
some other POSIX path.

The permission denied is probably not the permission of sh itself, but
the permissions of the script.  It's lacking execute permissions,
perhaps.  If the script gets generated during the make run, it might
be a race.  One job tries to use the script before another job has
run chmod on the script.

Instead of building your own debug version of Cygwin, you could also
just start with stracing your make runs and see what happens when the
script access fails.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Corinna,

I was using a "gmake" not the cygwin "make", and that was generating the
windows path. I've moved over to the cygwin supplied make and fixed up all
the relevant environment variables. No windows paths anymore but I'm still
getting the permission problem.

None of the scripts are created dynamically.

I'd tried strace before, but didn't really know how to interpret the output
or locate the relevant bits. (is there an article that describes the
output?)

I've run the make again under strace and posted the output of both strace
and make (I couldn't find how to have the output of both go to the same
file) to www.johndaintree.com/index.htm. Would it be too much to ask that
you take a look?

Thanks for your help,

john.



-----Original Message-----
From: Corinna Vinschen [mailto:corinna-cygwin@...]
Sent: 29 October 2009 13:39
To: cygwin@...
Subject: Re: "Permission denied" on /usr/bin/sh when running gmake with
multiple jobs



http://cygwin.com/acronyms/#TOFU


On Oct 29 11:25, John Daintree wrote:
> Can you shed some light on
http://article.gmane.org/gmane.os.cygwin/111950?
> I may need to get my local cygwin build working to investigate this
further.

>> "J:\trunk\svn\apl\win\bin\mk_cc:
>> /cygdrive/j/trunk/svn/apl/allos/bin/verbose: /usr/bin/sh: bad
interpreter:
>> Permission denied"

Where's this Windows path coming from?  Are you sure you're using only
Cygwin tools?  If so, get rid of the Win32 path and use either the
matching /cygdrive path, or mount (the relevant subtree of) drive J to
some other POSIX path.

The permission denied is probably not the permission of sh itself, but
the permissions of the script.  It's lacking execute permissions,
perhaps.  If the script gets generated during the make run, it might
be a race.  One job tries to use the script before another job has
run chmod on the script.

Instead of building your own debug version of Cygwin, you could also
just start with stracing your make runs and see what happens when the
script access fails.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Re: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by Corinna Vinschen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 30 08:55, John Daintree wrote:

> Hi Corinna,
>
> I was using a "gmake" not the cygwin "make", and that was generating the
> windows path. I've moved over to the cygwin supplied make and fixed up all
> the relevant environment variables. No windows paths anymore but I'm still
> getting the permission problem.
>
> None of the scripts are created dynamically.
>
> I'd tried strace before, but didn't really know how to interpret the output
> or locate the relevant bits. (is there an article that describes the
> output?)
>
> I've run the make again under strace and posted the output of both strace
> and make (I couldn't find how to have the output of both go to the same
> file) to www.johndaintree.com/index.htm. Would it be too much to ask that
> you take a look?

That's a local problem on your side, apparently.  It took some time to
find the cause in this big strace, but here it is:

261  861750 [main] sh 6296 fhandler_base::open: C00000BF = NtCreateFile (0x0, 80100000, \??\J:\trunk\svn\apl\win\bin\mk_cc, io, NULL, 0, 7, 1, 4020, NULL, 0)

The Windows NtCreateFile function returns an status code 0xC00000BF,
which is called STATUS_NETWORK_BUSY.  This translates into Win32 error
54, ERROR_NETWORK_BUSY which tranlates into the english text... "The
network is busy."

I have no clue what causes this kind of error.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


RE: "Permission denied" on /usr/bin/sh when running gmake with multiple jobs

by John Daintree :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Corinna,

That's very helpful, thank you for taking the time to look through the
output. I've talk to my IT guys about how we should proceed.

/john


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple