List:MySQL++« Previous MessageNext Message »
From:Michael Lovett Date:October 4 2004 4:22pm
Subject:Segmentation Fault on pass2
View as plain text  
Hi

I've got a really trivial app, based almost line for line on one of the mysql++ samples.

The logic is in a procedure that I call from main.

If I call this procedure twice in a row I get a seg fault on the second call.

If I code the app to call the routine once, but run the whole application two times in a
row, all is well.

This leads me to believe some resource is getting cleaned up after the app exists that's
not getting cleaned up when my proc exits. Any input would be greatly appreciated!
Here's the proc:

try {
      Connection conn(DATABASE,HOST,USER,PASSWORD,use_exceptions);
      Query query = conn.query();
      query << "select server_name_tx from tblTabServer";
      Result res = query.store();
      Row row;
      Result::iterator i;
      for (i = res.begin(); i < res.end(); i++) {
         row = *i;
         cout << row[0] << endl;
         }
      }
   catch(exception &e) {
      cout << e.what() << endl;
      exit(-1);
      }

By the way, I compiled this under RH 7.2 using the g++3 compatibility library.

Thread
Segmentation Fault on pass2Michael Lovett4 Oct
  • Re: Segmentation Fault on pass2Warren Young5 Oct
Re: Segmentation Fault on pass2Michael Lovett5 Oct
Re: Segmentation Fault on pass2Warren Young5 Oct
Re: Segmentation Fault on pass2Warren Young5 Oct
Re: Segmentation Fault on pass2Michael Lovett5 Oct
Re: Segmentation Fault on pass2Michael Lovett6 Oct