#25 virtual keyword causes exception?

open
nobody
5
2009-09-28
2009-09-28
No

Adding "virtual" to a simple method causes the following exception to be raised:

"Program: A.exe
Exception: 0xC00000FD
Address: 00000000"

This happens both on the emulator I'm using (Microsoft DeviceEmulator Manager 9.0.21022.8) and on the real device (Intel XScale 400Mhz PXA 255).

The code being compiled is:

#include <iostream>

using std::cout;
using std::endl;

class Simple
{
public:
Simple();
virtual ~Simple();
};

Simple::Simple()
{
}

Simple::~Simple()
{
}

int
main()
{
cout << "Strange?" << endl;
}

I'm compiling the code with

arm-wince-cegcc-g++ -o A.exe A.cpp

If I remove "virtual" from the destructor then the code runs without an exception. This happens for any method not just the destructor.

arm-wince-cegcc-g++ --version gives:

arm-wince-cegcc-g++ (GCC) 4.1.0
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any ideas?

Discussion

  • Danny Backx

    Danny Backx - 2009-09-30

    I cannot reproduce this, but I'm using the gcc-4.4 based software.
    Could you pick up the latest release (0.59.1) and try it ?

     
  • Rob Eggleton

    Rob Eggleton - 2009-10-01
     
  • Rob Eggleton

    Rob Eggleton - 2009-10-01

    I've updated to 0.59.1 (and downloaded mpfr 2.4.1). Exactly the same thing is happening. I've attached a tar ball of: the source, the output from strace when compiling, the resultant .exe file and the build (go) script. It's weird I have another app with a few thousand lines which all works fine ... but as soon as I add "virtual" it fails.

     
  • Danny Backx

    Danny Backx - 2009-10-01

    The test below is with your executable on my iPAQ 214 running WM 6.0.

    pavilion: {121} rcp A.exe ipaq:/temp
    pavilion: {122} rsh ipaq /temp/A.exe
    Strange
    pavilion: {123}

     
  • Paul Sokolovsky

    Paul Sokolovsky - 2011-02-05

    Thanks for your bug report!

    To ease maintenance of the project, we are migrating bug tracking facilities to Trac. We would appreciate if you re-posted this bug on Trac via https://sourceforge.net/apps/trac/cegcc/newticket . Please include link to this bug for reference.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks