[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


Hi,

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
'cutl::compiler::context::no_entry'

  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:
/net/binlib/ubuntu/sandy/gcc/lib/odb/odb-2.3/libodb-2.3.0_gcc-4.7.2/include/odb/tr1/pointer-traits.hxx:
In member function ‘virtual const char*
__gnu_cxx::__concurrence_lock_error::what() const’:
/net/binlib/ubuntu/sandy/gcc/lib/odb/odb-2.3/libodb-2.3.0_gcc-4.7.2/include/odb/tr1/pointer-traits.hxx:116:1:
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?

Regards,

Mihir Pendse



More information about the odb-users mailing list