Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authenticated: #14308112 Date: Tue, 23 Aug 2005 15:46:24 +0300 From: Pavel Tsekov X-X-Sender: ptsekov AT mordor To: znort AT pop DOT gmx DOT net cc: cygwin AT cygwin DOT com Subject: Re: signal trouble In-Reply-To: <4a03a72c050823024012eb6fe7@mail.gmail.com> Message-ID: References: <4a03a72c050823024012eb6fe7 AT mail DOT gmail DOT com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1924604259-1124801184=:1556" X-Y-GMX-Trusted: 0 X-IsSubscribed: yes ---559023410-1924604259-1124801184=:1556 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, On Tue, 23 Aug 2005, znort wrote: > Could you tell/help me why the little code : [...] > Under cygwin gcc version 3.4.4 (cygming special) and Linux with gcc 3.3.5 > same "strange" results... (no segmentation fault with cygwin anyway) > > (notes : Under Solaris x86 (gcc3.4.4) it works perfectly !?) > > I think I've forgotten something but where ? See the attached file - it is modified version of your program. When the second SIGSEGV occurs SIGSEGV signals are blocked. This is because you exited the signal handler via a longjmp() and the signal mask is not cleared. To do what you want you must use sigsetjmp/siglongjmp pair of calls or remove SIGSEGV from the list of blocked signals. ---559023410-1924604259-1124801184=:1556 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="longjmp.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="longjmp.c" I2luY2x1ZGUgPHNpZ25hbC5oPg0KI2luY2x1ZGUgPHNldGptcC5oPg0KI2lu Y2x1ZGUgPHN0ZGlvLmg+DQoNCi8qIGptcF9idWYgY29udGV4dDsgKi8NCnNp Z2ptcF9idWYgY29udGV4dDsNCg0KaW50IHlvZyhpbnQgbikNCnsNCiAgIGNo YXIgKnA9TlVMTDsNC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MpOw0KICAgICAgIC8vcmV0dXJu IDU1NTsNCiAgICAgfQ0KICAgICBlbHNlDQogICAgIHsNCiAgICAgICBmcHJp bnRmKHN0ZGVyciwgIm91Y2ggLS0gc2lnbmFsICVkXG4iLCBzaWcpOw0KICAg ICB9DQogICB9DQoNCiAgIHB1dHMoImVuZCIpOw0KICAgcmV0dXJuIDA7DQoN Cn0NCg== ---559023410-1924604259-1124801184=:1556 Content-Type: text/plain; charset=us-ascii -- 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/ ---559023410-1924604259-1124801184=:1556--