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 From: Marcus Crestani Reply-To: crestani AT informatik DOT uni-tuebingen DOT de To: cygwin AT cygwin DOT com Subject: SIGSEGV address with SA_SIGINFO Date: Tue, 10 May 2005 14:03:50 +0200 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505101403.50204.crestani@informatik.uni-tuebingen.de> Hi, I am trying obtain the address caused by a SIGSEGV inside a signal handler, but it seems that the siginfo_t struct isn't set correctly. The value I get from si->si_addr differs from the address where the segfault actually occurred. void fault_handler (int sn, siginfo_t * si, void *ctx) { fprintf (stderr, "fault_handler: %x\n", si->si_addr); } void install_fault_handler (void) { struct sigaction act, segv_oact; memset(&act, sizeof(sigaction), 0); act.sa_sigaction = fault_handler; sigemptyset(&act.sa_mask); act.sa_flags = SA_SIGINFO; sigaction(SIGSEGV, &act, &segv_oact); } int main (void) { char *p = 0; install_fault_handler (); p[0] = 23; return 0; } The SEGFAULT in the above code snippet occurs in 0x0, the information retrieved from si->si_addr actually shows 0x7c80b651. I found in the archives that some "limited implementation of sigaction" was done in 2004. What is the state of the SA_SIGINFO functionality in current cygwin? Is there a way to obtain the correct fault address? Please CC me privately, I am not subscribed to this list. Thanks for your help, -- Marcus -- 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/