Hi Tom

I re-checked the RPM I downloaded and founf it was the same as the latest 0.51 RPM, sorry about that, but thats the one that causes me problems.

I already built my test program as you did, so syorry no makefile.
I also tried replacing sstream. same problem.

So... I removed the 0.51 RPM and downloaded the 0.51 source. Built & installed it and re-tried the test program.
Now it works ok!

The only thing we can think of is a problem when linking to libm? see http://gcc.gnu.org/ml/gcc-bugs/2000-09/msg00194.html for a trail of messages. But we're still pretty confused!

thanks for the help, great product.

Mark Turner




Tom Kaiser <[EMAIL PROTECTED]>

05/03/01 20:15
Please respond to sablist

       
        To:        Sablotron Mailing List <[EMAIL PROTECTED]>
        cc:        
        Subject:        Re: [Sab] Sablot library & dynamic_cast problem



Most extraordinary... I have no explanation for this. I did a test on RH
6.1 which worked fine. I replaced sstream (which I don't know about) by
iostream. I used
g++ -otest test.cpp -lsablot -lexpat
to do the build. Correct? If not, could you send a makefile which
produces the crash with this .cpp file?

Does the same happen with Sablot 0.51?

Tom Kaiser

Mark Turner wrote:

>
> Hi
>
> We have been developing some apps using the Sablot 0.50 library and
> have recently found a problem and traced it back to Sablotron. Below
> is some test code which causes a Segmentation Fault when doing a
> dynamic_cast, but only when I link the sablot ( &expat ) shared
libraries.
>
> #include <stdio.h>
> #include <sstream>
> //#include "sablot.h"
>
> class A
> {
> public:
>         virtual void dostuff() { std::cout << "A" << std::endl; }
> };
>
> class B : public A
> {
> public:
>         void dostuff() { std::cout << "B" << std::endl; }
> };
>
> void doit(A& a)
> {
>         try
>         {
>                 B& b = dynamic_cast<B&>(a);                // this
> dynamic cast causes a SEGMENTATION FAULT
>                 b.dostuff();
>         }
>         catch( ... )
>         {
>                 std::cout << "bad cast" << std::endl;
>         }
> }
>
> int main()
> {
>         std::cout <<"start..."<<std::endl;
>
>         A* a = new A();
>         A* b = new B();
>
>         doit(*b);                        // this fails
>
>         return 1;
> }
>
>
> Were using Red Hat 7.0. Has anyone else experienced these problems?
>
> thanks
>
> Mark Turner





Reply via email to