Ошибка access violation no rtti data

We are running Inventor 2023, all updates/drivers are current for all software, Anti virus security has been setup with allowable permissions and so on . It is vary clear that Inventor is the problem. This seems to be Autodesks go to for fixing issues just blame other software products. 

Basically you have a rather large multi body , the customer decides they want to change the design. So when you start altering the geometry you get a lot of broken features in the feature tree that needs to be repaired. You roll back the EOF and start repairing features . Some features you don’t need so you delete them up till the RTTI error pops up.

It happens quite regularly so yes the error can be reproduced consistently. 

The work around is, once the error pops up,  is to save the file, shut down Inventor, restart Inventor, open the file and then you are able to keep rolling down the EOF fixing the broken features.

If en.cppreference.com’s explanation of The Standard can be trusted, I think this is an error in MSVC:

  1. When dynamic_cast is used in a constructor or a destructor (directly or indirectly), and expression refers to the object that’s currently under construction/destruction, the object is considered to be the most derived object. If new-type is not a pointer or reference to the constructor’s/destructor’s own class or one of its bases, the behavior is undefined.

As far as I can tell, the problematic cases are being called from the constructors of classes that the dynamic_cast is trying to cast newComposite into. This should be perfectly acceptable, unless I’m misunderstanding something.

But supposing this is an MSVC problem that we need to accommodate, the only solution I can think of is to refactor every constructor (or at least the constructors that are problematic) to make them private/protected and replace them with an equivalent T::create(...) function that constructs the class and then adds the aspects after construction is complete. That should be a guaranteed way to fix this problem, but it does break the API.

Working with VS 2019, Python 3.7 64bit on Windows 10 and pybind11 2.4.3 I have run into the following problem:

When I create an object with a pybind11 py::class_ on the Python side and pass it directly to a method on the C++ side storing it in a std::vector, an attempt to read out the object later from Python results in an Access violation - no RTTI data. If the Python code stores the created object first in a Python variable to then pass it to C++ the subsequent access from Python works as intended.

I don’t have much experience in using pybind11 and C++ so I am probably making a simple mistake, would appreciate any help on how to set up the C++ and pybind11 usage so that the Python workaround to use a variable is not needed and I don’t get any access violation.

Here are some code details, the C++ code is

#include <iostream>

#include <vector>

#include <pybind11/pybind11.h>

using namespace std;


class XdmItem;

class XdmValue {

public:

    virtual XdmItem* itemAt(int n);

    virtual int size();

    void addXdmItem(XdmItem* val);


protected:
    std::vector<XdmItem*> values;
};

void XdmValue::addXdmItem(XdmItem* val) {
    values.push_back(val);
}

XdmItem* XdmValue::itemAt(int n) {
    if (n >= 0 && (unsigned int)n < values.size()) {
        return values[n];
    }
    return NULL;
}

int XdmValue::size() {
    return values.size();
}

class XdmItem : public XdmValue {

public:

    int size();

};

int XdmItem::size() {
    return 1;
}


namespace py = pybind11;

PYBIND11_MODULE(UseClassHierarchyAsPythonModule, m) {


    py::class_<XdmValue>(m, "PyXdmValue")
        .def(py::init<>())
        .def("size", &XdmValue::size)
        .def("item_at", &XdmValue::itemAt)
        .def("add_item", &XdmValue::addXdmItem);

    py::class_<XdmItem, XdmValue>(m, "PyXdmItem")
        .def(py::init<>())
        .def("size", &XdmItem::size);



#ifdef VERSION_INFO
    m.attr("__version__") = VERSION_INFO;
#else
    m.attr("__version__") = "dev";
#endif
}

the Python code that works flawlessly is

import UseClassHierarchyAsPythonModule

value = UseClassHierarchyAsPythonModule.PyXdmValue()

print(value, type(value))

print(value.size())

item = UseClassHierarchyAsPythonModule.PyXdmItem()

value.add_item(item)

print(value.size())

item0 = value.item_at(0)

print(item, type(item))

while the following code causes the Access violation - no RTTI data!:

import UseClassHierarchyAsPythonModule

value = UseClassHierarchyAsPythonModule.PyXdmValue()

print(value, type(value))

print(value.size())

value.add_item(UseClassHierarchyAsPythonModule.PyXdmItem())

print(value.size())

item0 = value.item_at(0)

print(item, type(item))

It gives

  Message=Access violation - no RTTI data!
  Source=C:SomePathAccessViolation.py
  StackTrace:
  File "C:SomePathAccessViolation.py", line 13, in <module>
    item0 = value.item_at(0)

If I enable native code debugging the stack trace include the pybind C++ code and is

>   UseClassHierarchyAsPythonModule.pyd!pybind11::polymorphic_type_hook<XdmItem,void>::get(const XdmItem * src, const type_info * & type) Line 818  C++
    UseClassHierarchyAsPythonModule.pyd!pybind11::detail::type_caster_base<XdmItem>::src_and_type(const XdmItem * src) Line 851 C++
    UseClassHierarchyAsPythonModule.pyd!pybind11::detail::type_caster_base<XdmItem>::cast(const XdmItem * src, pybind11::return_value_policy policy, pybind11::handle parent) Line 871  C++
    UseClassHierarchyAsPythonModule.pyd!pybind11::cpp_function::initialize::__l2::<lambda>(pybind11::detail::function_call & call) Line 163 C++
    UseClassHierarchyAsPythonModule.pyd!pybind11::handle <lambda>(pybind11::detail::function_call &)::<lambda_invoker_cdecl>(pybind11::detail::function_call & call) Line 100   C++
    UseClassHierarchyAsPythonModule.pyd!pybind11::cpp_function::dispatcher(_object * self, _object * args_in, _object * kwargs_in) Line 624 C++
    [External Code] 
    AccessViolation.py!<module> Line 13 Python

Any idea what is wrong in my C++/pybind11 use?

Access violation — no RTTI data!


Quick Fields
Version 10


Updated July 28, 2017

Profile image


asked on July 28, 2017

Has anyone seen this error before in Quick Fields? 

The Quick Fields session is configured to immediately store documents to Laserfiche. If their is an error, then it sits in the Revision Pane. As the QF Session was still running, I updated one of the documents to remove the red flag and attempted to store the document. Right after I tried storing the document, I received the following error, «Access violation — no RTTI data!»


0


0




Post Link

We are running Inventor 2023, all updates/drivers are current for all software, Anti virus security has been setup with allowable permissions and so on . It is vary clear that Inventor is the problem. This seems to be Autodesks go to for fixing issues just blame other software products. 

Basically you have a rather large multi body , the customer decides they want to change the design. So when you start altering the geometry you get a lot of broken features in the feature tree that needs to be repaired. You roll back the EOF and start repairing features . Some features you don’t need so you delete them up till the RTTI error pops up.

It happens quite regularly so yes the error can be reproduced consistently. 

The work around is, once the error pops up,  is to save the file, shut down Inventor, restart Inventor, open the file and then you are able to keep rolling down the EOF fixing the broken features.

If en.cppreference.com’s explanation of The Standard can be trusted, I think this is an error in MSVC:

  1. When dynamic_cast is used in a constructor or a destructor (directly or indirectly), and expression refers to the object that’s currently under construction/destruction, the object is considered to be the most derived object. If new-type is not a pointer or reference to the constructor’s/destructor’s own class or one of its bases, the behavior is undefined.

As far as I can tell, the problematic cases are being called from the constructors of classes that the dynamic_cast is trying to cast newComposite into. This should be perfectly acceptable, unless I’m misunderstanding something.

But supposing this is an MSVC problem that we need to accommodate, the only solution I can think of is to refactor every constructor (or at least the constructors that are problematic) to make them private/protected and replace them with an equivalent T::create(...) function that constructs the class and then adds the aspects after construction is complete. That should be a guaranteed way to fix this problem, but it does break the API.

Access violation — no RTTI data!


Quick Fields
Version 10


Updated July 28, 2017

Profile image


asked on July 28, 2017

Has anyone seen this error before in Quick Fields? 

The Quick Fields session is configured to immediately store documents to Laserfiche. If their is an error, then it sits in the Revision Pane. As the QF Session was still running, I updated one of the documents to remove the red flag and attempted to store the document. Right after I tried storing the document, I received the following error, «Access violation — no RTTI data!»

I am trying to serialize set of classes (where every class which has virtual destructor) using boost serialization. Test for all classes are passing except 1 which give above error.

I even tried setting enabling RTTI in VS 2012 but no use.. still the error exists.

I saw a link with similar type of issue but no help.

Boost Serialization of simple class with RTTI turned Off (-fno-rtti)

complete error message is — unknown location(0): fatal error in «mychecktest»: std::bad_typeid: Access violation — no RTTI data!

There is another link on similar problem but no solution
http://lists.boost.org/boost-testing/2005/05/1014.php

really don’t know what could go wrong… really need help on this.

Thanks,

Community's user avatar

asked Apr 30, 2014 at 11:30

sia's user avatar

1

in my case, i was also getting same issue and it was due to 1 of member variables was not serializing properly and hence this issue occured.
You can also do the same check at and give it a try.

answered May 7, 2014 at 11:15

user1291401's user avatar

user1291401user1291401

2541 gold badge6 silver badges18 bronze badges

1

I was working on a model i made in Freecad when i got this error.
Anybody knows what’s going on?

Thank you.

17:11:59 Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Sketch::checkGeoId. GeoId index out range.
17:12:07 TempoVis.restore: failed to restore detail (‘SDVProperty’, ‘tekening_Ster_v5_almost’, ‘Sketch.Visibility’): Unknown document ‘tekening_Ster_v5_almost’
17:12:07 TempoVis.restore: failed to restore detail (‘SDVProperty’, ‘tekening_Ster_v5_almost’, ‘Sketch.LinkVisibility’): Unknown document ‘tekening_Ster_v5_almost’
17:12:10 0 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:10 6.3483e-05 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:25 Traceback (most recent call last):
File «<string>», line 1, in <module>
<class ‘NameError’>: Unknown document »
17:12:25 Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Unknown document »
17:12:27 Traceback (most recent call last):
File «<string>», line 1, in <module>
<class ‘NameError’>: Unknown document »
17:12:27 Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Unknown document »
17:12:32 22.6109 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:32 22.6109 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:34 Traceback (most recent call last):
File «<string>», line 1, in <module>
<class ‘NameError’>: Unknown document »
17:12:34 Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Unknown document »
17:12:40 30.5793 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:40 30.5794 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:43 Traceback (most recent call last):
File «<string>», line 1, in <module>
<class ‘NameError’>: Unknown document »
17:12:43 Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Unknown document »
17:12:46 36.8209 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:46 36.8209 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:47 37.0261 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:47 37.0261 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:48 38.0718 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:48 38.0718 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:12:52 Traceback (most recent call last):
File «<string>», line 1, in <module>
<class ‘NameError’>: Unknown document »
17:13:00 49.996 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!
17:13:00 49.9961 Selection.cpp(157): Unhandled std::exception caught in selection observer: Access violation — no RTTI data!

  • Ошибка abs хонда инсайт
  • Ошибка access user defined type not defined
  • Ошибка abs приора 16 клапанов
  • Ошибка access to requested operation is denied перевод
  • Ошибка abs плавают обороты