Exception handler of RHEL4 isn't working after the integration ofboost Serialization code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • girish574@gmail.com

    Exception handler of RHEL4 isn't working after the integration ofboost Serialization code


    After the integration of boost serialization code, the exceptions
    are not at all getting caught in my application. Im building on RHEL4
    kernel 2.6.9-42.ELsmp and gcc version is 4.0.2. The application
    terminates when exception is thrown. Removing the serialization code
    makes the exceptions getting caught.

    The worst part is im not able to reproduce the scenario in a small
    program.


    Also i tried building the same application on suse8 machine. Even
    with the boost serialization code exceptions are getting caught. Issue
    is there only with RHEL4 build

    Do anyone of you encountered this? Or can you point to any potential
    mistake for which this can happen?
    Is there any gcc flag that may help in this issue


    Thank You
    Girish
  • Martin York

    #2
    Re: Exception handler of RHEL4 isn't working after the integration ofboost Serialization code

    Do anyone of you encountered this? Or can you point to any potential
    mistake for which this can happen?
    Is there any gcc flag that may help in this issue
    One thought.

    After an exception is thrown the stack is unwound.
    During the unwinding the destructor of all stack objects is called.
    If one of the destructors of these objects also throws an exception
    then the application will terminate.

    struct X
    {
    ~X() {throw int(5);}
    };

    int main()
    {
    try
    {
    X a;
    throw int(6);
    }
    catch(int e)
    {
    std::cout << "Cought\n"; // Never gets here.
    }
    std::cout << "Done\n";
    }

    Comment

    • girish574@gmail.com

      #3
      Re: Exception handler of RHEL4 isn't working after the integration ofboost Serialization code

      Im having a simple scenario in my application
      int x = 6;
      try {
      throw x;
      }
      catch(int p) {
      cout << caught << endl;
      }
      This is not getting caught on RHEL4 + boost. But it does on suse8 +
      boost



      On Feb 13, 12:40 pm, Martin York <Martin.YorkAma ...@gmail.comwr ote:
      Do anyone of you encountered this? Or can you point to any potential
      mistake for which this can happen?
      Is there any gcc flag that may help in this issue
      >
      One thought.
      >
      After an exception is thrown the stack is unwound.
      During the unwinding the destructor of all stack objects is called.
      If one of the destructors of these objects also throws an exception
      then the application will terminate.
      >
      struct X
      {
      ~X() {throw int(5);}
      >
      };
      >
      int main()
      {
      try
      {
      X a;
      throw int(6);
      }
      catch(int e)
      {
      std::cout << "Cought\n"; // Never gets here.
      }
      std::cout << "Done\n";
      >
      }

      Comment

      • red floyd

        #4
        Re: Exception handler of RHEL4 isn't working after the integrationof boost Serialization code

        girish574@gmail .com wrote:
        Im having a simple scenario in my application
        int x = 6;
        try {
        throw x;
        }
        catch(int p) {
        cout << caught << endl;
        }
        This is not getting caught on RHEL4 + boost. But it does on suse8 +
        boost
        >
        >
        Sounds implementation specific. I suggest either an RHEL group, the
        BOOST mailing list, or gnu.g++.help

        Comment

        Working...