[odb-users] Strange crash when inheriting a composite id from a polymorphic base class

Mihir Pendse mpendse90 at gmail.com
Sun Jun 22 20:42:33 EDT 2014


I have a polymorphic base class which has a composite id; the code snippet is:

#pragma db value
struct shape_key
    double tau;
    double pi;

    bool operator==(const shape_key& rhs) const
        return ((tau == rhs.tau) && (pi == rhs.pi));

    bool operator<(const shape_key& rhs) const
        return ((tau < rhs.tau) && (pi < rhs.pi));

#pragma db object abstract
struct shape
    int vertices;

#pragma db object polymorphic pointer(std::shared_ptr)
struct parallelogram : public shape
    #pragma db id column("")
    shape_key key;

    virtual ~parallelogram()

#pragma db value
struct triangle
    int angles;
    int sides;

#pragma db object
struct square : public parallelogram
    odb::vector<triangle> triangles;

On compilation, the compiler crashes with this error:

terminate called after throwing an instance of

  what():  N4cutl8compiler7context8no_entryE
*** WARNING *** there are active plugins, do not report this as a bug
unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_START_UNIT                | odb
PLUGIN_PRAGMAS                   | odb
PLUGIN_OVERRIDE_GATE             | odb
In file included from <standard-odb-epilogue>:8:0:
In member function ‘virtual const char*
__gnu_cxx::__concurrence_lock_error::what() const’:
internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The code works if I use a basic data type as the key.
I am running the ODB compiler 2.3.0, g++ 4.7.2 on Ubuntu 12.04 x86_64.

How do I solve this problem?


Mihir Pendse

More information about the odb-users mailing list