Package: protobuf
Version: 2.4.1-3
Severity: important
Tags: patch

Hi,

Version 2.4.1 of protobuf has a problem for static initialization with dlopen.
This problem already reported to upstream[0].

The package mozc[1] which I am maintaining has a problem[2] which does not work 
in
part for this problem. 

I create patch which revise this problem.

Could you check and apply this?

Best regards,
  Nobuhiro

[0]: https://code.google.com/p/protobuf/issues/detail?id=370
[1]: http://packages.qa.debian.org/m/mozc.html
[2]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700307
-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf

Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libprotobuf7 depends on:
ii  libc6       2.17-92+b1
ii  libgcc1     1:4.8.1-9
ii  libstdc++6  4.8.1-9
ii  zlib1g      1:1.2.8.dfsg-1

libprotobuf7 recommends no packages.

libprotobuf7 suggests no packages.

-- no debconf information
diff -Nru protobuf-2.4.1/debian/changelog protobuf-2.4.1/debian/changelog
--- protobuf-2.4.1/debian/changelog	2012-06-18 01:29:45.000000000 +0900
+++ protobuf-2.4.1/debian/changelog	2013-07-24 08:31:44.000000000 +0900
@@ -1,3 +1,11 @@
+protobuf (2.4.1-3.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fix static initialization problem with dlopen.
+    Add fix_static_initialization_problem_with_dlopen.diff
+
+ -- Nobuhiro Iwamatsu <iwama...@debian.org>  Wed, 24 Jul 2013 08:27:47 +0900
+
 protobuf (2.4.1-3) unstable; urgency=low
 
   * Add patch from Steven Chamberlain fixing build failures of the
diff -Nru protobuf-2.4.1/debian/patches/fix_static_initialization_problem_with_dlopen.diff protobuf-2.4.1/debian/patches/fix_static_initialization_problem_with_dlopen.diff
--- protobuf-2.4.1/debian/patches/fix_static_initialization_problem_with_dlopen.diff	1970-01-01 09:00:00.000000000 +0900
+++ protobuf-2.4.1/debian/patches/fix_static_initialization_problem_with_dlopen.diff	2013-07-24 08:30:48.000000000 +0900
@@ -0,0 +1,49 @@
+Description: Fix static initialization problem with dlopen
+Origin: upstream, https://code.google.com/p/protobuf/issues/attachmentText?id=370&aid=3700010000&name=quick_patch.diff&token=veyaIIhquJ8gVFu20MrgOM-XmYM%3A1374621685076
+Bug: https://code.google.com/p/protobuf/issues/detail?id=370
+Bug-Debian: http://bugs.debian.org/
+Forwarded: not-needed
+Last-Update: <2013-07-24>
+
+--- protobuf-2.4.1.orig/src/google/protobuf/descriptor_database.cc
++++ protobuf-2.4.1/src/google/protobuf/descriptor_database.cc
+@@ -309,7 +309,18 @@ bool EncodedDescriptorDatabase::Add(
+     const void* encoded_file_descriptor, int size) {
+   FileDescriptorProto file;
+   if (file.ParseFromArray(encoded_file_descriptor, size)) {
++    std::pair<const void*, int> existing = index_.FindFile(file.name());
++    if (existing.first) {
++      if (existing.second == size && memcmp(existing.first, encoded_file_descriptor, size) == 0) {
++        // Contents match
++        return true;
++      }
++      else {
++        GOOGLE_LOG(ERROR) << "File descriptor " << file.name() << " is already registered, but descriptor contents are different";
++      }
++    }
+     return index_.AddFile(file, make_pair(encoded_file_descriptor, size));
++
+   } else {
+     GOOGLE_LOG(ERROR) << "Invalid file descriptor data passed to "
+                   "EncodedDescriptorDatabase::Add().";
+--- protobuf-2.4.1.orig/src/google/protobuf/message.cc
++++ protobuf-2.4.1/src/google/protobuf/message.cc
+@@ -238,7 +238,8 @@ GeneratedMessageFactory* GeneratedMessag
+ void GeneratedMessageFactory::RegisterFile(
+     const char* file, RegistrationFunc* registration_func) {
+   if (!InsertIfNotPresent(&file_map_, file, registration_func)) {
+-    GOOGLE_LOG(FATAL) << "File is already registered: " << file;
++    registration_func(file);
++    //GOOGLE_LOG(FATAL) << "File is already registered: " << file;
+   }
+ }
+ 
+@@ -253,7 +254,7 @@ void GeneratedMessageFactory::RegisterTy
+   // the mutex.
+   mutex_.AssertHeld();
+   if (!InsertIfNotPresent(&type_map_, descriptor, prototype)) {
+-    GOOGLE_LOG(DFATAL) << "Type is already registered: " << descriptor->full_name();
++    //GOOGLE_LOG(DFATAL) << "Type is already registered: " << descriptor->full_name();
+   }
+ }
+ 
diff -Nru protobuf-2.4.1/debian/patches/series protobuf-2.4.1/debian/patches/series
--- protobuf-2.4.1/debian/patches/series	2012-06-18 01:29:45.000000000 +0900
+++ protobuf-2.4.1/debian/patches/series	2013-07-24 08:31:33.000000000 +0900
@@ -3,3 +3,4 @@
 arm_optimization.diff
 revert_upstream_issue_388_about_rpath.diff
 fix-ftbfs-gcc4.7-kfreebsd.patch
+fix_static_initialization_problem_with_dlopen.diff

Reply via email to