Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segmentation fault



On Sun, 6 Feb 2000, Brad Noyes wrote:

> Hello,
> 
> I'm writing a c++ program that before i changed distributions from RH6.0, to
> Mandrake worked. But now i try to run it i get a Segmentation fault when i
> execute it with no core dump. 

This doesn't make sense to me, but then I don't use C++ so it may be that
C++ is doing some sort of exception handling that is preventing the core
dump, but I'm just speculating.  In C, in order to prevent the core
dump you'd have to do something like

int main( arg stuff here..){

...
 
   signal( SIGSEGV, mysighandler );

...

}

int mysighandler( void ){

  fprintf(stderr, "Seg Fault\n" );
  exit(1);
}


I assume C++ has some sort of similar signal handling, but I'd expect that
you'd have had to do something to make it work...


> Is there anyway that i can figure out why it is seg faulting with gdb,
> or something? 

Yes, compile the program with debug info ( -g option ) and trace it with
gdb.


-- 
"Quis custodiet ipsos custodes?"    "Who watches the watchmen?" 
-Juvenal, Satires, VI, 347 

Derek D. Martin      |  Senior UNIX Systems/Network Administrator
Arris Interactive    |  A Nortel Company
derekm at mediaone.net  |  dmartin at ne.arris-i.com
-------------------------------------------------

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org