Bug #1270

Using libexiv2.a/.lib in multhreaded app segfaults.

Added by Ben Touchette 9 months ago. Updated 2 months ago.

Status:AssignedStart date:13 Jan 2017
Priority:NormalDue date:
Assignee:Robin Mills% Done:

0%

Category:build
Target version:v0.26.1

Description

I have a client that is using exiv2 as a library for their app and requires it to run multi-threaded. When launching several threads to access a tiff image the application will crash or segfault.

To reproduce run mt-test from the samples directory and have it access 10 or more tiff files. In my tests opening two to twenty images cause the issues, i used ReageanLargeTiff.tiff to test with in Linux and MacOS.

I am including a patch that resolves their issues and adds support for c++11 as well as switching between auto_ptr and unique_ptr depending if we are compiling with c++98 or c++11. This patch also adds a verbosity option when compiling to display more information. The patch sets the default to c++11 when compiling. This patch also adds a multi-thread test (mt-test.sh).

The current patch is only for CMake. Autoconf and the other build systems have yet to be modified to incorporate those changes.

mt_cpp11.diff Magnifier - multhithreading fix, c++11 support, verbosity switch, mt-test,.sh, switch to unique_ptr (75.4 KB) Ben Touchette, 13 Jan 2017 19:00

autoconf.diff Magnifier - patch to add c++11 support to autoconf setup. (23.3 KB) Ben Touchette, 17 Jan 2017 19:25

cpp11-autoconf.diff Magnifier - autoconf changes (23.3 KB) Ben Touchette, 17 Feb 2017 18:02

cpp11-cmake.diff Magnifier - cmake changes (3.02 KB) Ben Touchette, 17 Feb 2017 18:02

cpp11-uniqueptr.diff Magnifier - unique_ptr changes (63.3 KB) Ben Touchette, 17 Feb 2017 18:03

cpp11-mt.diff Magnifier - multithreading changes (7.3 KB) Ben Touchette, 17 Feb 2017 18:03


Related issues

Related to Exiv2 - Feature #1188: Provide build support for C++11 Assigned 29 May 2016
Related to Exiv2 - Bug #1187: Crash while reading in parallel threads Closed 29 May 2016

History

#1 Updated by Ben Touchette 8 months ago

Addendum:

Adding autoconf patch to support switch between c++11 and the previous c++ standards behavior.

Adds --disable-stdcpp11 switch to the configure script.

Behavior is in line with CMake patch.

#2 Updated by Robin Mills 8 months ago

  • Category set to build
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to 0.26

#3 Updated by Ben Touchette 7 months ago

To help i've separated the diffs into their basic component. Note that some the C++11 changes would most likely be needed for the xmp sdk split.

#4 Updated by Ben Touchette 7 months ago

crap mouse clicked on the wrong button and missing the two next files.

#5 Updated by Robin Mills 6 months ago

  • Target version changed from 0.26 to 0.27

Ben:

This is quite a large patch and SVN merge rejects part of the patch.

I'm pushing this to v0.27. I'm exhausted. I want to get the release/web-site published for Andreas to review. I'm willing to listen to any convincing reason to accept this for v0.26.

#6 Updated by Robin Mills 2 months ago

  • Target version changed from 0.27 to v0.26.1

I believe Ben has done this work and it's included in the cpp11-xmpsdk-split branch.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux