X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org X-Spam-Score: -0.09 To: "cygwin AT cygwin DOT com" Subject: signals of type SIGSEGV handled only once (in multithreaded process) Date: Fri, 15 Feb 2008 9:37:51 +0100 From: "klement2" X-Mailer: Azet.sk V1.00b (webmail client) X-Original-IP: 212.5.194.155 Content-Transfer-Encoding: 8bit Content-Type: multipart/mixed; charset="UTF-8"; boundary="--=a7d09919b3a42c2" MIME-Version: 1.0 Message-Id: <20080215083751.535E978014@ems008.s.etech.sk> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 ----=a7d09919b3a42c2 Content-Type: text/plain; charset="UTF-8"; Content-Transfer-Encoding: 8bit After excellently quick correction of pthread_kill when the argument signal is zero (by cgf), I have found another problem related to signal handling. The code in attachment demonstrates it ( because of pthread_kill, it must be run with cygwin1-20080213.dll and newer ). It seams that signal handlers for signals like SIGSEGV, SIGFPE are called only once, and the default handler is called for the second time the signal occures in the process. I'm not sure if the example is reasonable (e.g. pthread_exit in signal handler...), but works as expected on linux. Output from the example compiled and run in linux: Starting SIGSEGV1... tid1=b7f1abb0 Sigaction success, errno = 0 Join1 ---> Result: 0, xx=8 Ret. value ---> Result: 8, xx=8 Good thread create ---> Result: 0, xx=8 Starting SIGSEGV2... tid2=b7519bb0 Sigaction success, errno = 0 <--------------------------- this is the end in cygwin (crash info message)------------ xx=9 Join2 ---> Result: 0, xx=9 Ret. value ---> Result: 9, xx=9 ----=a7d09919b3a42c2 Content-Type: text/plain; name="sigpk4.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sigpk4.c" I2luY2x1ZGUgPHNpZ25hbC5oPg0KI2luY2x1ZGUgPHB0aHJlYWQuaD4NCiNp bmNsdWRlIDxlcnJuby5oPg0KDQp2b2xhdGlsZ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UdWMS4uLlxuIik7DQoJcHRocmVhZF9jcmVhdGUoJnRpZCwgTlVM TCwgVGhyZWFkMSwgKHZvaWQqKTEpOw0KCXByaW50ZigidGlkMT0leFxuIiwg dGlkKTsNCgl3aGlsZSAocHRocmVhZF9raWxsKHRpZCwgMCkgIT1FU1JDSCkN CgkJc2xlZXAoMSk7DQoJcHJpbnRyYygiSm9pbjEiLHB0aHJlYWRfam9pbih0 aWQsKHZvaWQqKikmcmMpKTsNCglwcmludHJjKCJSZXQuIHZhbHVlIiwgcmMp Ow0KDQoJcHJpbnRyYygiR29vZCB0aHJlYWQgY3JlYXRlIixwdGhyZWFkX2Ny ZWF0ZSgmdGlkLCBOVUxMLCBPS1RocmVhZCwgTlVMTCkpOw0KDQoJcHJpbnRm KCJTdGFydGluZyBTSUdTRUdWMi4uLlxuIik7DQoJcHRocmVhZF9jcmVhdGUo JnRpZDIsIE5VTEwsIFRocmVhZDEsICh2b2lkKikyKTsNCglwcmludGYoInRp ZDI9JXhcbiIsIHRpZDIpOw0KCXdoaWxlIChwdGhyZWFkX2tpbGwodGlkMiwg MCkgIT1FU1JDSCkNCgkJc2xlZXAoMSk7DQoJcHJpbnRmKCJ4eD0lZFxuIix4 eCk7DQoJcHJpbnRyYygiSm9pbjIiLHB0aHJlYWRfam9pbih0aWQyLCh2b2lk KiopJnJjKSk7DQoJcHJpbnRyYygiUmV0LiB2YWx1ZSIsIHJjKTsNCg0KDQoJ cmV0dXJuIDA7DQp9DQo= ----=a7d09919b3a42c2 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/ ----=a7d09919b3a42c2--