delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/03/00:12:53

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Brian Kramer <kram9361 AT uidaho DOT edu>
Subject: Re: Spawnvp on pwd.exe and mkdir.exe fails
Date: Mon, 3 Apr 2006 04:12:29 +0000 (UTC)
Lines: 82
Message-ID: <loom.20060403T060922-722@post.gmane.org>
References: <loom DOT 20060403T014817-595 AT post DOT gmane DOT org> <44309988 DOT 2030109 AT cygwin DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Larry Hall (Cygwin <reply-to-list-only-lh <at> cygwin.com> writes:

> 
> Brian Kramer wrote:
> > I have a simple C++ file I am using to spawn pwd.exe and mkdir.exe.  These 
are 
> > causing stackdumps.  Can anyone help me resolve this?  ls.exe does not 
cause a 
> > stackdump.
> > 
> > The same C++ file compiles using Visual Studio and the output is as 
expected.  
> > 
> > In particular on Windows:
> > pid=1996
> > /cygdrive/e/tempprojects/pwd/Debug
> > done
> > 
> > And under cygwin:
> > pid=5860
> > (pwd.exe.stackdump written)
> > done
> > 
> > Here's my program:
> > 
> > #include <process.h>
> > #include <stdio.h>
> > 
> > int main()
> > {
> >     char* argv[] = {"pwd.exe", 0};
> >     int pid = spawnvp( _P_NOWAIT, argv[0], argv );
> >     printf("pid=%d\n",pid);
> > 
> >     int termstat;
> >     cwait( &termstat, pid, WAIT_CHILD );
> >     printf("done\n");
> > 
> >     return 0;       
> > }
> 
> You should include the path to "pwd.exe" (i.e. "/bin/pwd.exe").  If this
> doesn't solve your problem, I suggest you read and follow the problem
> reporting guidelines found here:
> 
> > Problem reports:       http://cygwin.com/problems.html
> 
> FWIW, with the correction I suggested, this works fine for me with Cygwin
> 1.5.19.
> 

Hi, Larry.  Thanks for your prompt Sunday night reply!

I tried that also.  Note that "ls.exe" gives the correct result:
pid=1312
    E:\tempprojects\pwd\*.*
[Debug]                              pwd.suo*
a.exe                                pwd.vcproj
pwd.cpp                              pwd.vcproj.BKRAMERHOME.bkramer.user
pwd.exe.stackdump                    ReadMe.txt
pwd.ncb                              stdafx.cpp
pwd.sln                              stdafx.h
    434176 (400541) bytes in 11 files
done

I normally have c:\cygwin\bin on the path, which is why using "/bin/ls.exe" 
and "ls.exe" both work.

I upgraded to Cygwin 1.5.19 today to see if that helped on my real cases 
("pwd.exe" and "mkdir.exe"), and it did not.  The interesting this is that 
this code used to work just fine: something "happened" and I would't know how 
to start diagnosing this issue...

Did you run the example I gave?  

A clean reinstall of Cygwin, perhaps?

Brian






--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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