delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/17/01:26:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4AD95908.9020208@gmail.com>
Date: Sat, 17 Oct 2009 06:41:28 +0100
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: fork failure?
References: <4AD732C7 DOT 4020301 AT cwilson DOT fastmail DOT fm> <4AD73B83 DOT 9060505 AT gmail DOT com> <4AD74586 DOT 8070803 AT cwilson DOT fastmail DOT fm> <4AD752C8 DOT 2040908 AT gmail DOT com> <4AD7B135 DOT 6020401 AT cwilson DOT fastmail DOT fm> <4AD8220D DOT 8000908 AT cwilson DOT fastmail DOT fm> <4AD8AD47 DOT 6010605 AT cwilson DOT fastmail DOT fm> <4AD8B90B DOT 4040507 AT gmail DOT com> <4AD8CD8A DOT 7010708 AT cwilson DOT fastmail DOT fm> <4AD8D490 DOT 2040000 AT gmail DOT com> <4AD8DAC3 DOT 2080709 AT cwilson DOT fastmail DOT fm> <4AD93CA2 DOT 6020002 AT cwilson DOT fastmail DOT fm>
In-Reply-To: <4AD93CA2.6020002@cwilson.fastmail.fm>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

Charles Wilson wrote:

> I have a hunch that an STC (okay, less-hellaciously-complicated test
> case) could be developed, using just GNU pth and avoiding all the
> libassuan/gnupg gobbledygook.

  Oh yuck.  So there's this alternative user-land pthreads library that runs a
scheduler within a single real machine thread, using some hairy sjlj hackery
to perform context switches?  That's kinda asking for trouble, isn't it?

  Anyway, look here: pth_mctx.c line ~ 514

> /*
>  * VARIANT 5: WIN32 SPECIFIC JMP_BUF FIDDLING
>  *
>  * Oh hell, Win32 has setjmp(3), but no sigstack(2) or sigaltstack(2).
>  * So we have to fiddle around with the jmp_buf here too...
>  */
> 
> #elif PTH_MCTX_MTH(sjlj) && PTH_MCTX_DSP(sjljw32)
> intern int
> pth_mctx_set(pth_mctx_t *mctx, void (*func)(void),
>                      char *sk_addr_lo, char *sk_addr_hi)
> {
>     pth_mctx_save(mctx);
> #if i386
>     mctx->jb[7] = (int)sk_addr_hi;
>     mctx->jb[8] = (int)func;
> #else
> #error "Unsupported Win32 architecture"
> #endif
>     sigemptyset(&mctx->sigs);
>     mctx->error = 0;
>     return TRUE;
> }

  Umm, yes.  Poking around directly inside a sigjmp_buf.  Wonder if the layout
is actually what that code expects it to be or not?  That's where I'd start
looking next, anyway, if I was wondering why maybe things were randomly
jumping to unexpected places ...

    cheers,
      DaveK



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

- Raw text -


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