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

co_set_str causes segfault in size 32 tree #90

Closed
gradyoti opened this issue Feb 10, 2014 · 3 comments
Closed

co_set_str causes segfault in size 32 tree #90

gradyoti opened this issue Feb 10, 2014 · 3 comments
Labels
Milestone

Comments

@gradyoti
Copy link
Collaborator

On size 32 tree when calling co_tree_set_str
Does not occur with size 16.

Specific input:
TestString1 = co_str8_create("1TESTVALUE1", 12, 0);

ret = co_tree_insert(Tree32, "1TESTKEY1", 9, TestString1);
ASSERT_EQ(1, ret);

ret = co_tree_set_str(Tree32, "1TESTKEY1", 9, "REPLACESTRING", 8);
ASSERT_EQ(1, ret);

Valgrind output:
==8934== Process terminating with default action of signal 11 (SIGSEGV)
==8934== Access not within mapped region at address 0x15
==8934== at 0x4C2E893: memcpy@GLIBC_2.2.5 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8934== by 0x4E4BF12: co_node_set_str (tree.c:364)
==8934== by 0x4E4C3A6: co_tree_set_str (tree.c:403)
==8934== by 0x4383E5: TreeTest::UpdateObj() (tree.cpp:173)
==8934== by 0x438791: TreeTest_TreeUpdateTest_Test::TestBody() (tree.cpp:192)
==8934== by 0x45DD87: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test
, void (testing::Test::)(), char const) (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x458F77: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test_, void (testing::Test::)(), char const) (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x440304: testing::Test::Run() (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x440AE1: testing::TestInfo::Run() (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x44117B: testing::TestCase::Run() (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x447941: testing::internal::UnitTestImpl::RunAllTests() (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== by 0x45F165: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl_, bool (testing::internal::UnitTestImpl::_)(), char const*) (in /home/gj/src/commotiond/build/tests/commotion_test)
==8934== If you believe this happened as a result of a stack
==8934== overflow in your program's main thread (unlikely but
==8934== possible), you can try to increase the size of the
==8934== main thread stack using the --main-stacksize= flag.
==8934== The main thread stack size used in this run was 8388608.

@areynold
Copy link
Collaborator

@gradyoti Is this resolved by #103?

@gradyoti
Copy link
Collaborator Author

Yep! Resolved.

@jheretic
Copy link
Member

Resolved per #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants