home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,551 of 33,346   
   red floyd to Harry   
   Re: Best practice to handle segmentation   
   06 Oct 11 14:02:20   
   
   d5397751   
   From: no.spam.here@its.invalid   
      
   On 10/6/2011 11:34 AM, Harry wrote:   
   > Hi Gurus,   
   > Is it a best practice to handle segmentation fault inside a shared   
   > library(.so) C++ ?   
   > The shared library is used by C/C++ and java applications.   
   > My intention is that the program using my shared library should get   
   > return values in all cases even in case of segmentation faults.   
      
   1. Technically OT, as segfaults and shared libraries are out of scope,   
     as the C++ standard(s) do not discuss them.   
   2. That said, it's a bad idea.  How do you plan on trapping segfaults?   
     What if the users of your library have ideas about how *THEY* want   
     to handle such faults?   What guarantees do you have about data   
     integrity after such a fault occurs?   
      
      
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca