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

Avoid crash in pyexiv2 with some image files. #585

Merged
merged 2 commits into from
Jun 12, 2017

Conversation

mribbons
Copy link
Contributor

Resolves #580

Issue was caused by attempting to read data in ImageUniqueID tag,
even though data is populated.

By only reading the values we need from metadata we avoid the issue
in pyexiv2.

Should also improve performance.

stacktrace of error:

.#0 strlen () at ../sysdeps/x86_64/strlen.S:106
.#1 0x00007fffdb154ce7 in exiv2wrapper::ExifTag::ExifTag(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, Exiv2::Exifdatum*, Exiv2::ExifData*, Exiv2::ByteOrder) () from /usr/lib/python2.7/dist-packages/libexiv2python.so
.#2 0x00007fffdb154eb4 in exiv2wrapper::Image::getExifTag(std::__cxx11::basic_string<char, std::char_traits, std::allocator >) ()
from /usr/lib/python2.7/dist-packages/libexiv2python.so
.#3 0x00007fffdb15f3e6 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<exiv2wrapper::ExifTag const (exiv2wrapper::Image::)(std::__cxx11::basic_string<char, std::char_traits, std::allocator >), boost::python::default_call_policies, boost::mpl::vector3<exiv2wrapper::ExifTag const, exiv2wrapper::Image&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >::operator()(_object, _object*) ()
from /usr/lib/python2.7/dist-packages/libexiv2python.so
.#4 0x00007ffff52845cd in boost::python::objects::function::call(_object*, _object*) const () from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.#5 0x00007ffff52847c8 in ?? () from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.#6 0x00007ffff528c823 in boost::python::detail::exception_handler::operator()(boost::function0 const&) const ()
from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.#7 0x00007fffdb15dd63 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<Exiv2::BasicError, void ()(Exiv2::BasicError const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(Exiv2::BasicError const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0 const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0 const&) () from /usr/lib/python2.7/dist-packages/libexiv2python.so
.#8 0x00007ffff528c7f8 in boost::python::detail::exception_handler::operator()(boost::function0 const&) const ()
from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.#9 0x00007ffff5d01ab8 in boost::python::detail::translate_exception<ecto::except::NullTendril, void ()(ecto::except::NullTendril const&)>::operator()(boost::python::detail::exception_handler const&, boost::function0 const&, void ()(ecto::except::NullTendril const&)) const ()
from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.#10 0x00007ffff5d0099f in bool boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(ecto::except::NullTendril const&)> >::operator()<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void ()(ecto::except::NullTendril const&)>, boost::_bi::list2<boost::python::detail::exception_handler const&, boost::function0 const&> >(boost::_bi::type, boost::python::detail::translate_exception<ecto::except::NullTendril, void ()(ecto::except::NullTendril const&)>&, boost::_bi::list2<boost::python::detail::exception_handler const&, boost::function0 const&>&, long) ()
from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.#11 0x00007ffff5cffbe7 in bool boost::_bi::bind_t<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void (
)(ecto::except::NullTendril const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(ecto::except::NullTendril const&)> > >::operator()<boost::python::detail::exception_handler, boost::function0 >(boost::python::detail::exception_handler const&, boost::function0 const&) ()
from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.#12 0x00007ffff5cfeb54 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void (
)(ecto::except::NullTendril const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(ecto::except::NullTendril const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0 const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0 const&) ()
from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.#13 0x00007ffff528c7f8 in boost::python::detail::exception_handler::operator()(boost::function0 const&) const ()
from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
...

Resolves OpenDroneMap#580

Issue was caused by attempting to read data in ImageUniqueID tag,
even though data is populated.

By only reading the values we need from metadata we avoid the issue
in pyexiv2.

Should also improve performance.

stacktrace of error:

.#0  strlen () at ../sysdeps/x86_64/strlen.S:106
.OpenDroneMap#1  0x00007fffdb154ce7 in exiv2wrapper::ExifTag::ExifTag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Exiv2::Exifdatum*, Exiv2::ExifData*, Exiv2::ByteOrder) () from /usr/lib/python2.7/dist-packages/libexiv2python.so
.OpenDroneMap#2  0x00007fffdb154eb4 in exiv2wrapper::Image::getExifTag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
   from /usr/lib/python2.7/dist-packages/libexiv2python.so
.OpenDroneMap#3  0x00007fffdb15f3e6 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<exiv2wrapper::ExifTag const (exiv2wrapper::Image::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), boost::python::default_call_policies, boost::mpl::vector3<exiv2wrapper::ExifTag const, exiv2wrapper::Image&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::operator()(_object*, _object*) ()
   from /usr/lib/python2.7/dist-packages/libexiv2python.so
.OpenDroneMap#4  0x00007ffff52845cd in boost::python::objects::function::call(_object*, _object*) const () from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.OpenDroneMap#5  0x00007ffff52847c8 in ?? () from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.OpenDroneMap#6  0x00007ffff528c823 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
   from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.OpenDroneMap#7  0x00007fffdb15dd63 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<Exiv2::BasicError<char>, void (*)(Exiv2::BasicError<char> const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(Exiv2::BasicError<char> const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&) () from /usr/lib/python2.7/dist-packages/libexiv2python.so
.OpenDroneMap#8  0x00007ffff528c7f8 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
   from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
.OpenDroneMap#9  0x00007ffff5d01ab8 in boost::python::detail::translate_exception<ecto::except::NullTendril, void (*)(ecto::except::NullTendril const&)>::operator()(boost::python::detail::exception_handler const&, boost::function0<void> const&, void (*)(ecto::except::NullTendril const&)) const ()
   from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.OpenDroneMap#10 0x00007ffff5d0099f in bool boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(ecto::except::NullTendril const&)> >::operator()<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void (*)(ecto::except::NullTendril const&)>, boost::_bi::list2<boost::python::detail::exception_handler const&, boost::function0<void> const&> >(boost::_bi::type<bool>, boost::python::detail::translate_exception<ecto::except::NullTendril, void (*)(ecto::except::NullTendril const&)>&, boost::_bi::list2<boost::python::detail::exception_handler const&, boost::function0<void> const&>&, long) ()
   from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.OpenDroneMap#11 0x00007ffff5cffbe7 in bool boost::_bi::bind_t<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void (*)(ecto::except::NullTendril const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(ecto::except::NullTendril const&)> > >::operator()<boost::python::detail::exception_handler, boost::function0<void> >(boost::python::detail::exception_handler const&, boost::function0<void> const&) ()
   from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.OpenDroneMap#12 0x00007ffff5cfeb54 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<ecto::except::NullTendril, void (*)(ecto::except::NullTendril const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(ecto::except::NullTendril const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&) ()
   from /home/mribbons/OpenDroneMap170517/SuperBuild/install/lib/python2.7/dist-packages/ecto/ecto_main.so
.OpenDroneMap#13 0x00007ffff528c7f8 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
   from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
...
Copy link
Member

@pierotofy pierotofy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me.

@dakotabenjamin
Copy link
Member

Any reason why you changed the file permissions? Otherwise looks good. I'll test and merge.

@mribbons
Copy link
Contributor Author

Ok fixed that, didn't realise I could just push straight to my master branch to have this PR updated.

The permission change was caused by modifying the files over a poorly configured samba share.

@dakotabenjamin dakotabenjamin merged commit 8bc6a04 into OpenDroneMap:master Jun 12, 2017
peddyhh pushed a commit to peddyhh/ODM that referenced this pull request Jun 7, 2020
Avoid crash in pyexiv2 with some image files.

Former-commit-id: 8bc6a04
pierotofy pushed a commit that referenced this pull request Sep 21, 2020
Avoid crash in pyexiv2 with some image files.

Former-commit-id: 8bc6a04
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

Successfully merging this pull request may close these issues.

3 participants