This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: Problems with Xemacs
Christopher Faylor wrote:
>
> On Fri, Oct 10, 2003 at 02:22:06PM -0400, Pierre A. Humblet wrote:
> >Christopher Faylor wrote:
> >>
> >> On Fri, Oct 10, 2003 at 01:50:35PM -0400, Pierre A. Humblet wrote:
> >> >Christopher Faylor wrote:
> >> >>
> >> >> On Fri, Oct 10, 2003 at 12:14:46PM -0500, Brian Ford wrote:
> >> >> >On Fri, 10 Oct 2003, Pierre A. Humblet wrote:
> >> >> >> P.S.: I saw the recent ChangeLog
> >> >> >> (shared_info::initialize): Don't initialize user stuff if myself doesn't exit.
> >> >> >> and have been scratching my head about why it's helpful.
> >> >> >
> >> >> >I could be wrong, but I think this is the change that fixed strace -p. It
> >> >> >was getting a SEGV trying to access the pinfo.
> >> >>
> >> >> That was one of the changes, yes.
> >> >
> >> >But the user stuff (cygheap->user.init ()) does not touch myself, nor
> >> >any pinfo
> >>
> >> myself == 0 is used as a flag that the DLL isn't fully initialized.
> >
> >OK, but cygheap->user.init () only touches cygheap->user (which must exists),
> >hMainProc (its former lack of initialization may have been the real problem)
> >and wincap.
>
> I added the initialization.
I saw that, it's a good catch. I didn't think of testing the case
where the dll is loaded with LoadLibrary. I am not too sure of the
call flow in that case.
> I considered the initialization of
> hMainProc a hack and a last resort. See the GetCurrentProcess() MSDN
> description for why.
- if cygheap->user.init () is the only place with this problem, it could
call GetCurrentProcess() instead of reading hMainProc, removing
the need for the hack.
- given the fact that hMainProc is not inheritable, why do we even bother
to obtain it by duplication instead of always setting it to
GetCurrentProcess()?
> However, rather than argue about this vital issue, I'll remove the
> myself check.
Thanks, it will probably save us grief.
Pierre