kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Segfault in YAML::convert<std::string>::decode #270

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile yaml_test.cpp
2. Run yaml_test with simple.yaml as a command line argument

What is the expected output? What do you see instead?
Expected: There should be no output from the program. Program should run and 
terminate without error.
See: Segmentation fault.

What version of the product are you using? On what operating system?
Ubuntu 14,04 64-bit
g++ 4.8.2
yaml-cpp 0.5.1 (prebuilt packages from apt-get repositories libyaml-cpp0.5 and 
libyaml-cpp-dev)

Please provide any additional information below.
Stack trace from GDB

#0  0x00007ffff777763c in std::string::assign(std::string const&) () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x0000000000414ba1 in YAML::convert<std::string>::decode(YAML::Node const&, 
std::string&) ()
#2  0x00000000004150ec in bool 
YAML::detail::node_data::equals<std::string>(YAML::detail::node&, std::string 
const&, boost::shared_ptr<YAML::detail::memory_holder>) ()
#3  0x00000000004167b2 in YAML::detail::node& 
YAML::detail::node_data::get<std::string>(std::string const&, 
boost::shared_ptr<YAML::detail::memory_holder>) ()
#4  0x000000000041616f in YAML::detail::node& 
YAML::detail::node_ref::get<std::string>(std::string const&, 
boost::shared_ptr<YAML::detail::memory_holder>) ()
#5  0x0000000000415913 in YAML::detail::node& 
YAML::detail::node::get<std::string>(std::string const&, 
boost::shared_ptr<YAML::detail::memory_holder>) ()
#6  0x0000000000415277 in YAML::Node YAML::Node::operator[]<char [21]>(char 
const (&) [21]) ()
#7  0x00000000004135c4 in main ()

Further information: Running this as a standalone program and compiling and 
running with
g++ yaml_test.cpp -lyaml-cpp -lboost_system -lboost_filesystem -o yaml_test
./yaml_test ./simple.yaml

seems to work without issues (removing the dependency on boost also result in 
no error). 

However, if I compile from within a catkin (a wrapper around the cmake build 
system) workspace I get the segfault. I will see if I can strip down my catkin 
workspace to a more minimal version and see if I can track down the error 
further.

Original issue reported on code.google.com by bids...@gmail.com on 27 Jan 2015 at 5:47

Attachments:

GoogleCodeExporter commented 8 years ago
I have no idea what has changed, but I am no longer able to reproduce this 
error at all.

Original comment by bids...@gmail.com on 27 Jan 2015 at 11:53

GoogleCodeExporter commented 8 years ago
OK, thanks for following up.

Original comment by jbe...@gmail.com on 28 Jan 2015 at 1:19