Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg Fault Copying xtypes::DynamicData #105

Open
KyleStevenson3 opened this issue Jul 30, 2021 · 1 comment
Open

Seg Fault Copying xtypes::DynamicData #105

KyleStevenson3 opened this issue Jul 30, 2021 · 1 comment

Comments

@KyleStevenson3
Copy link

KyleStevenson3 commented Jul 30, 2021

My first attempt to use this library failed. Here is a simple program that reproduces the failure.

#include <iostream>
#include <string>
#include "xtypes/xtypes.hpp"

using namespace eprosima;

xtypes::DynamicData getTestEnum()
{
    xtypes::EnumerationType<uint32_t> testEnum("TestEnum");
    testEnum.add_enumerator("item0");
    testEnum.add_enumerator("item1");
    testEnum.add_enumerator("item2");
    xtypes::DynamicData test(testEnum);
    std::cout << "Looks good here: " << test.to_string();

    xtypes::DynamicData test2(test);
    std::cout << "Here too: " << test2.to_string();
    return test;
}

int main()
{
    xtypes::DynamicData testData(getTestEnum());
    std::cout << "Seg Faults here: " << testData.to_string();
    return 0;
}

backtrace:

>&"bt\n"
>~"#0  0x000055555555c727 in eprosima::xtypes::ReadableDynamicDataRef::for_each(std::function<void (eprosima::xtypes::ReadableDynamicDataRef::ReadableNode const&)>) const (this=0x7fffffffe590, visitor=...) at /home/kyle/VGB/eprosima_xtypes/include/xtypes/DynamicData.hpp:407\n"
>~"#1  0x000055555555e141 in eprosima::xtypes::ReadableDynamicDataRef::to_string[abi:cxx11]() const (this=0x7fffffffe590) at /home/kyle/VGB/eprosima_xtypes/include/xtypes/DynamicDataImpl.hpp:124\n"
>~"#2  0x000055555555b237 in main () at /home/kyle/VGB/XtypesTest/main.cpp:24\n"
>2322^done
MiguelBarro pushed a commit that referenced this issue Jan 26, 2023
…bjects. Fixes issue #105

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro
Copy link
Contributor

Please check this have been fixed in #113

MiguelBarro pushed a commit that referenced this issue Feb 23, 2023
…bjects. Fixes issue #105

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
rsanchez15 pushed a commit that referenced this issue Jun 15, 2023
* Refs 16497. CMake upgrade.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing cross-platform issues.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing cross-platform issues.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Update peglib api.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Preprocessor strategy refactored

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing gtest on windows

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing testing

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing testing

Signed-off-by: MiguelBarro <miguelbarro@eprosima.com>

* Refs 16497. Fixing testing

Signed-off-by: MiguelBarro <miguelbarro@eprosima.com>

* Refs 16497. Populating test environment to locate preprocessor on windows

Signed-off-by: MiguelBarro <miguelbarro@eprosima.com>

* Refs 16497. Introducing some c++17 improvements

Signed-off-by: MiguelBarro <miguelbarro@eprosima.com>

* Refs 16497. Fixing encoding issues.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Enabling ctest for individual gtest execution

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing Parser::is_token()

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Refactor static Parser object lifeliness

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fix pipes crossplatform issues

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Refactor temporary filename generation. Fixings on crossplatform command line piping.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing testing if xtypes exceptions are disabled

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Forcing current workding dir as preprocessor include path.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing windows type size on tests literals

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Match preprocessor and build platform and add copyright.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Module ownership refactor from Parser to Context.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Simplify temporary files management

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Add github source indexing to pdb files

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Enabling Windows Error Reporting for ci purposes

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fix the examples

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing old ci

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. avoid deprecated string conversions

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. New CI

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. fixing clang/OS X errors

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing move semantics on DynamicData

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Compile warnings as errors.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing clang/OS X errors

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Avoid using as primitive size_t whose definition is platform dependent.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fixing assertion regex usage

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Nightly CI

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Fix c++20 compatibility issues

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Fix C++20 compatibility issues

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Refactor to link DataType lifecycle to their associated objects. Fixes issue #105

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Allow custom cpp-peglib version selection

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Refs 16497. Added test StructType.russkel_issue

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Fix some errors

Signed-off-by: laura-eprosima <laura@eprosima.com>

* Print types with scope

Signed-off-by: laura-eprosima <laura@eprosima.com>

* Modify generator to return also the IDL separated by structures

Signed-off-by: laura-eprosima <laura@eprosima.com>

* update log traces

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Print types with scope

Signed-off-by: laura-eprosima <laura@eprosima.com>

* Fixing parser tool pin point issue

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Making platform tool distro independent

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

* Joakim Haugen's review

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>

---------

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
Signed-off-by: MiguelBarro <miguelbarro@eprosima.com>
Signed-off-by: laura-eprosima <laura@eprosima.com>
Co-authored-by: laura-eprosima <laura@eprosima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants