GNOME Bugzilla – Bug 717931
Crash in Exiv2 during export
Last modified: 2013-05-01 06:38:00 UTC
---- Reported by jim@yorba.org 2011-09-15 16:23:00 -0700 ---- Original Redmine bug id: 4120 Original URL: http://redmine.yorba.org/issues/4120 Searchable id: yorba-bug-4120 Original author: Jim Nelson Original description: Reported downstream at https://bugs.launchpad.net/ubuntu/+source/shotwell/+bug/850549 A crash occurred during export deep inside in Exiv2. The stack trace is as follows: #0 size (this=0x7f60fc186f58) at /usr/include/c++/4.5/bits/basic_string.h:702 No locals. #1 compare (__str=..., this=0x7f60fc186f58) at /usr/include/c++/4.5/bits/basic_string.h:2132 __size = <optimized out> __osize = <optimized out> __r = <optimized out> #2 operator< <char, std::char_traits<char>, std::allocator<char> > (__rhs=..., __lhs=...) at /usr/include/c++/4.5/bits/basic_string.h:2419 No locals. #3 operator() (__y=..., __x=..., this=<optimized out>) at /usr/include/c++/4.5/bits/stl_function.h:230 No locals. #4 std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert_unique_ (this=0x7f60fc186f30, __position=..., __v=...) at /usr/include/c++/4.5/bits/stl_tree.h:1240 No locals. #5 0x00007f611762201e in insert (__x=..., __position=<optimized out>, this=0x7f60fc186f30) at /usr/include/c++/4.5/bits/stl_map.h:541 No locals. #6 operator[] (__k=..., this=0x7f60fc186f30) at /usr/include/c++/4.5/bits/stl_map.h:451 No locals. #7 XMPMeta::RegisterNamespace (namespaceURI=<optimized out>, prefix=<optimized out>) at XMPMeta.cpp:1049 nsURI = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7f60fc183888 "http://ns.adobe.com/camera-raw-settings/1.0/"}} prfix = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7f60fc1838d8 "crs:"}} #8 0x00007f61176226b8 in XMPMeta::Initialize () at XMPMeta.cpp:679 flag = <optimized out> opt1 = <optimized out> opt2 = <optimized out> Related issues: blocked by gexiv2 - 4122: XMP library must be initialized in thread-safe way (Fixed) ---- Additional Comments From shotwell-maint@gnome.bugs 2013-05-01 11:38:00 -0700 ---- ### History #### #1 Updated by Jim Nelson about 2 years ago This bug bit digiKam a while back: http://bugs.kde.org/show_bug.cgi?id=166424 The problem was that the XMP library Exiv2 uses (supplied by Adobe) is thread- safe except for their initialization call. Exiv2 will initialize the XMP library when a new XMPParser is created, which could happen in multiple threads. It falls on the caller (i.e. gexiv2) to properly initialize the XMP library: http://dev.exiv2.org/projects/exiv2/wiki/Thread_safety This is an edge case, but one worth considering to get out the door in time for Oneiric. #### #2 Updated by Jim Nelson about 2 years ago * **Assignee** deleted (<strike>_Jim Nelson_</strike>) * **Target version** changed from _0.11.2_ to _0.12_ This is a significant change to gexiv2, as we would prefer not to require the caller to manually invoke an initialization function (and if we did, that would be an ABI change). As this appears to be an edge case, we'll get to this in 0.12. #### #3 Updated by Adam Dingle almost 2 years ago * **Description** updated (diff) * **Priority** changed from _Urgent_ to _High_ #### #4 Updated by Adam Dingle almost 2 years ago * **Priority** changed from _High_ to _Urgent_ #### #5 Updated by Jim Nelson over 1 year ago Also reported at https://bugs.launchpad.net/ubuntu/+source/shotwell/+bug/947140. #### #6 Updated by Adam Dingle over 1 year ago * **Assignee** set to _Clinton Rogers_ Clint, let's pick this off for 0.12. We'd like to solve this by adding an initialization function to gexiv2 which the caller must invoke before calling any other functions. This will be an ABI change to gexiv2 so we'll want to increment its shared library version number. Jim should code review this change. #### #7 Updated by Clinton Rogers over 1 year ago * **% Done** changed from _0_ to _40_ commit:cd1214c8b41d03820a01a8ed508824736311c940 lays the groundwork on the gexiv2 side; the Shotwell work will be done in a later commit. #### #8 Updated by Clinton Rogers over 1 year ago * **File** _4120=f0rmat_patch.patch_ added * **Status** changed from _Open_ to _Review_ * **% Done** changed from _40_ to _80_ We now initialize the XMP subsystem in main() before the AppWindow() is spawned. #### #9 Updated by Clinton Rogers over 1 year ago * **Status** changed from _Review_ to _5_ * **% Done** changed from _80_ to _100_ * **Resolution** set to _fixed_ bacc3567b0f96633ea83e1b8a8a7ebaddd4b127a #### #10 Updated by Clinton Rogers over 1 year ago * **File** deleted (<strike>_4120=f0rmat_patch.patch_</strike>) #### #11 Updated by Charles Lindsay 7 months ago * **Status** changed from _5_ to _Fixed_ --- Bug imported by chaz@yorba.org 2013-11-25 21:54 UTC --- This bug was previously known as _bug_ 4120 at http://redmine.yorba.org/show_bug.cgi?id=4120 Unknown Component Using default product and component set in Parameters Unknown milestone "unknown in product shotwell. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one.