delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/21/23:35:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
Path: not-for-mail
From: "Dylan Cuthbert" <dylan AT q-games DOT com>
Newsgroups: gmane.os.cygwin
Subject: Re: g++ (v.3.1.1-4) -mno-cygwin with a hello world sample crashes oddly
Date: Mon, 22 Jul 2002 12:37:22 +0900
Lines: 84
Message-ID: <ahfuhp$3li$1@main.gmane.org>
References: <20020721170010 DOT GB1183 AT redhat DOT com> <20020721185338 DOT 65304 DOT qmail AT web10105 DOT mail DOT yahoo DOT com> <20020721234307 DOT GC4030 AT redhat DOT com>
NNTP-Posting-Host: pppa20.kyoto-ip.dti.ne.jp
Mime-Version: 1.0
X-Trace: main.gmane.org 1027308922 3762 210.159.246.20 (22 Jul 2002 03:35:22 GMT)
X-Complaints-To: usenet AT main DOT gmane DOT org
NNTP-Posting-Date: Mon, 22 Jul 2002 03:35:22 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

Sorry about the wild goose chase but it was very odd behaviour.

In 10 years of using gcc I've never come across the "trying to execute an
.obj file causes crash" problem before, but I was using linux and as you
say, the executable bit wouldn't have got set and I'd have noticed
immediately.

It seems strange that in this day and age, a .exe wouldn't have any info in
it to prevent something that is not an .exe from being run.  To this extent,
any user can rename any file a .exe and cause his/her machine to do very
unstable things, that's just bad all round.  Good old windows strikes again.

Thanks for tracking it down.

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com

"Christopher Faylor" <cgf AT redhat DOT com> wrote in message
news:20020721234307 DOT GC4030 AT redhat DOT com...
> On Sun, Jul 21, 2002 at 08:53:38PM +0200, Sylvain Petreolle wrote:
> >This thread is not dead.
> >The result of this shows that Cygwin can at the moment be told to
> >execute code without having a correct executable file (also COFF
> >format).
> >
> >Cygwin should have detected a non-executable file and
> >have refused to launch it.
>
> Actually if it was going to happen anywhere, it is ash that should have
> detected it, not cygwin.  Since windows (without ntsec) has no concept
> of an executable bit, unrecognized files are passed directly to /bin/sh.
> This is similar to unix, except on unix there is the added protection
> of the executable bit.  If the file doesn't have the executable bit set
> then it is actually never forwarded to /bin/sh by the OS.
>
> >What happens here on NT:
> >if you use incorrect syntax by appending .exe in g++ cmd :
> >$ g++ -mno-cygwin -c cpplus.cpp -o cpplus.exe ; g++ -mno-cygwin -c
> >cpplus.cpp -o cpplus
> >$ ls -l cpplus cpplus.exe
> >-rw-r--r--    1 Nom      544          1855 Jul 21 20:38 cpplus
> >-rwxr-xr-x    1 Nom      544          1855 Jul 21 20:41 cpplus.exe
> >finally tring to launch it:
> >$ ./cpplus
> >BASH: ./cpplus: Permission denied
>
> I don't see this behavior on XP.  Attempting to run the non-executable
> program (cpplus in this case) either hangs or gives strange messages.
>
> It's possible that, in your case, bash notices the lack of executable
> bit and never passes things on for execution.  I don't know why your
> experience differs but I am not going to lose sleep over it.
>
> >$ ./cpplus.exe
> >runs and hangs. (note that under Windows ME it doesn't run,saying
> >permission denied though it's detected as executable by ls).
> >
> >two problems:
> >- ls should show non executable file (problem in cygwin filesystem /ls
> >excutable detection routine)
>
> If the file has a .exe extension, it is assumed to be executable.  This
> is by design.  We've had two threads in the last week complaining about
> cygwin being slow.  Every time we open a file to check to see if it's
> executable we slow things down.
>
> >- incorrect code can be launched on NT systems.
>
> I've explained what is happening above.
>
> As usual, I'd welcome patches to ash to fix this behavior.  I'm not
> concerned about this enough to devote any time to it myself.
>
> cgf
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019