Closed GoogleCodeExporter closed 9 years ago
Do you have a stack trace?
Original comment by jbe...@gmail.com
on 22 Jul 2013 at 1:14
Original comment by jbe...@gmail.com
on 22 Jul 2013 at 1:16
Thanks for checking the defect.
Stack trace looks like this:
#0 YAML::detail::node_data::begin (this=0x80704e0) at
/data/tmp/tmp/yaml_expt_2/yaml-cpp/src/node_data.cpp:121
#1 0x0804b648 in YAML::detail::node_ref::begin (this=0x80701b8) at
./yaml-cpp/include/yaml-cpp/node/detail/node_ref.h:41
#2 0x0804ba04 in YAML::detail::node::begin (this=0x8070358) at
./yaml-cpp/include/yaml-cpp/node/detail/node.h:84
#3 0x0804c127 in YAML::Node::begin (this=0xbfffed40) at
./yaml-cpp/include/yaml-cpp/node/impl.h:286
#4 0x0804fa9c in YAML::convert<std::__debug::vector<int, std::allocator<int>
> >::decode (node=..., rhs=...) at
./yaml-cpp/include/yaml-cpp/node/convert.h:190
#5 0x0804e8f5 in YAML::as_if<std::__debug::vector<int, std::allocator<int> >,
void>::operator() (this=0xbfffecac) at
./yaml-cpp/include/yaml-cpp/node/impl.h:119
#6 0x0804d972 in YAML::Node::as<std::__debug::vector<int, std::allocator<int>
> > (this=0xbfffed40) at ./yaml-cpp/include/yaml-cpp/node/impl.h:143
#7 0x0804a3ac in main () at test1.cpp:10
Original comment by mm.st...@gmail.com
on 22 Jul 2013 at 2:54
To reproduce the above I did the following:
1. Modified top level CMakeLists.txt to add _GLIBCXX_DEBUG in Debug mode:
diff -r c93a3c943d96 CMakeLists.txt
--- a/CMakeLists.txt Wed Jul 10 08:29:11 2013 -0500
+++ b/CMakeLists.txt Mon Jul 22 15:58:10 2013 +0100
@@ -129,7 +129,7 @@
#
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
- set(CMAKE_CXX_FLAGS_DEBUG "-g")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g -D_GLIBCXX_DEBUG -O0")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
#
set(GCC_EXTRA_OPTIONS "")
2. Build the lib:
$ cmake -DCMAKE_BUILD_TYPE=Debug ../yaml-cpp/
$ make
2. Compile attached test1.cpp with :
g++ -O0 -g -I./yaml-cpp/include -D_GLIBCXX_DEBUG test1.cpp ./Debug/libyaml-cpp.a
Original comment by mm.st...@gmail.com
on 22 Jul 2013 at 3:01
Attachments:
In this case the problem could be due to YAML::detail::node_iterator_base which
could be constructed with either a SeqIter or a MapIter. When it is constructed
with SeqIter the MapIter member m_mapIt remains uninitialized and singular;
hence we get the error when we try to copy construct node_iterator_base
initialized with a sequence.
One potential solution is to use template (rather than enum) to choose sequence
and map and have specialized implementation for each of them. Does it make
sense ?
Original comment by mm.st...@gmail.com
on 23 Jul 2013 at 8:08
I have a rather ugly patch to get around this problem, check the file attached.
Original comment by mm.st...@gmail.com
on 25 Jul 2013 at 12:53
Attachments:
I'm unable to reproduce this, even with your CMakeLists changes.
Incidentally, the example you have at the top of this issue is nearly identical
to the test NodeTest.StdVector:
https://code.google.com/p/yaml-cpp/source/browse/test/node/node_test.cpp?r=6f449
17eb3a2248224b8d13e3f6e04ede380da5d#95
and this test passes with the build flags you gave.
For sanity, I made sure that all sub-iterators are default-initialized,
r86c2a73684f83be182b559b52d7df4280fb1675f, but I suspect that this doesn't do
anything.
If you can reproduce this at tip, please reopen.
Original comment by jbe...@gmail.com
on 24 Jan 2015 at 10:24
Original issue reported on code.google.com by
mm.st...@gmail.com
on 22 Jul 2013 at 11:17