Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 14 Oct 2003 17:16:29 -0400 (EDT)
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: Brian Ford <ford@vss.fsi.com>
cc: cygwin@cygwin.com
Subject: Re: cygpath hangings
In-Reply-To: <Pine.GSO.4.56.0310141554180.823@eos>
Message-ID: <Pine.GSO.4.56.0310141712520.20462@slinky.cs.nyu.edu>
References: <20031014100230.A12215@fw.j-son.org> <006501c392b7$dc780730$200aa8c0@thorin>
 <3F8BE1B9.3000704@cs.york.ac.uk> <Pine.GSO.4.56.0310140914020.20462@slinky.cs.nyu.edu>
 <Pine.GSO.4.56.0310141554180.823@eos>
Importance: Normal
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 14 Oct 2003, Brian Ford wrote:

> Igor,
>
> On Tue, 14 Oct 2003, Igor Pechtchanski wrote:
>
> > On Tue, 14 Oct 2003, chris wrote:
> >
> > > -- Code begins --
> > >
> > > #include <shlobj.h>
> > >
> > > void fee (void) {
> > >   char *buf;
> > >   LPITEMIDLIST id;
> > >   SHGetPathFromIDList (id, buf);
> > > }
> > >
> > > int main (int argc, char **argv)
> > > {
> > >     return 0;
> > > }
> >
> > Chris,
> >
> > I suspect that this hang might be happening while loading the DLL.  Could
> > you try to link your program with something like below and see if it still
> > hangs, and what it outputs?
> >
> Yes, it still hangs when run under setup from explorer.  No output from
> the hung one, or when run stand alone in bash.
>
> > If it doesn't hang, try renaming
> > SHGetPathFromIDList below to something else (e.g., foo) that calls the
> > real SHGetPathFromIDList, call foo() from your fee() above, and link your
> > program against both test_dll.dll and SHLWAPI.DLL.
> >
> Well, I didn't link explicitly with SHLWAPI.DLL, but same here.

Does "cygcheck yourprog.exe" show both test_dll.dll and SHLWAPI.DLL?

> There will be no ouput unless main calls foo, right?

Actually, if the DLL was loaded, there should be output even if foo isn't
called...

> Then, I still get a hang under setup from explorer; no output.

This could be because the DLL was not loaded, or because of the two stdio
conflicts...  Did you compile the DLL with -mno-cygwin?

> Stand alone in a shell, output is:
>
> DLL loaded: process attach
> DLL loaded: thread attach
> Segmentation fault (core dumped)
>
> The SEGV is expected given the code is invalid anyway.
>
> Nothing to see here... move along...
> [snip test_dll.c]

Hmm.  Maybe if the DLL has exported global variables, not just functions?
I'll see if I can come up with the appropriate code and will then post it
to the list.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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/

