Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 6th, 2008, 10:40 AM
Arne Steinarson
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
backtrace from a SIGSEGV handler

Hello,

[gcc/g++ 4.3 on i386, linux]

In our SIGSEGV handler we want to make a backtrace to get some context
in a generated bug report.

This works fine in most cases. However, when doing a virtual function call on
an non initialized C++ object this can lead to calling an arbitrary address.
And in the backtrace call, GCC generates a new SIGSEGV when attempting
to trace around that address. GCC then shuts down the app.

I tried installing a local SIGSEGV handler guarding the call to backtrace,
to catch this case, but it never got invoked.

Is there some way to reliably make a backtrace from inside a SIGSEGV
handler?

The alternative I can think of is to do memcpy on a chunk of the
current stack and then call backtrace at some later point, using
this saved data, when a temporary SIGSEGV handler can detect
when backtrace does invalid memory access.

But, I cannot find a backtrace variant that works with a stack copy
in this way.

Advice?

Regards
// ATS.

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Development > backtrace from a SIGSEGV handler


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT