Hello community,

here is the log from the commit of package antlr3c for openSUSE:Factory checked 
in at 2016-08-03 11:45:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/antlr3c (Old)
 and      /work/SRC/openSUSE:Factory/.antlr3c.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "antlr3c"

Changes:
--------
--- /work/SRC/openSUSE:Factory/antlr3c/antlr3c.changes  2016-02-09 
13:33:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.antlr3c.new/antlr3c.changes     2016-08-03 
11:45:17.000000000 +0200
@@ -1,0 +2,10 @@
+Thu Jun 16 07:23:25 UTC 2016 - jsl...@suse.com
+
+- port patches from home:jirislaby:statica
+  * add baselibs.conf to have 32bit libs too
+  * add fix-LIST-memory-leak.patch
+  * add fix-hash-double-free.patch
+- use standard library versioning. We do not obsolete the old
+  libraries as they are removed via weakremovers.
+
+-------------------------------------------------------------------

New:
----
  baselibs.conf
  fix-LIST-memory-leak.patch
  fix-hash-double-free.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ antlr3c.spec ++++++
--- /var/tmp/diff_new_pack.6v16An/_old  2016-08-03 11:45:18.000000000 +0200
+++ /var/tmp/diff_new_pack.6v16An/_new  2016-08-03 11:45:18.000000000 +0200
@@ -17,7 +17,7 @@
 #
 
 
-%define soname libantlr3c-3_4
+%define soname libantlr3c3
 Name:           antlr3c
 Version:        3.4
 Release:        0
@@ -26,8 +26,11 @@
 Group:          Development/Libraries/C and C++
 Url:            http://www.antlr3.org/
 Source:         http://www.antlr3.org/download/C/lib%{name}-%{version}.tar.gz
+Source1:        baselibs.conf
+Patch0:         fix-LIST-memory-leak.patch
 Patch1:         antlr-64bit.diff
 Patch2:         antlr-libversion.diff
+Patch3:         fix-hash-double-free.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  gcc
@@ -45,9 +48,6 @@
 %package -n %{soname}
 Summary:        C runtime for the ANTLR parsing library
 Group:          System/Libraries
-# From 13.3/TW201501 onwards
-Obsoletes:      libantlr3c3_4 < %{version}
-Provides:       libantlr3c3_4 = %{version}
 
 %description -n %{soname}
 ANTLR, ANother Tool for Language Recognition, is a language tool that provides 
a
@@ -73,8 +73,10 @@
 
 %prep
 %setup -q -n lib%{name}-%{version}
+%patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 autoreconf -fiv
@@ -91,7 +93,7 @@
 
 %files -n %{soname}
 %defattr(-,root,root)
-%{_libdir}/libantlr3c-%{version}.so
+%{_libdir}/libantlr3c.so.*
 
 %files devel
 %defattr(-,root,root,-)

++++++ antlr-libversion.diff ++++++
--- /var/tmp/diff_new_pack.6v16An/_old  2016-08-03 11:45:18.000000000 +0200
+++ /var/tmp/diff_new_pack.6v16An/_new  2016-08-03 11:45:18.000000000 +0200
@@ -4,19 +4,29 @@
 "-avoid-version" does not count for compatibility guarantees.
 Use one of -version-info, -release or -Wl,--version-script!
 ---
- Makefile.am |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ Makefile.am  |    2 +-
+ configure.ac |    2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
 
-Index: libantlr3c-3.4/Makefile.am
-===================================================================
---- libantlr3c-3.4.orig/Makefile.am
-+++ libantlr3c-3.4/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
 @@ -62,7 +62,7 @@ include_HEADERS =    include/antlr3.h
                                        include/antlr3treeparser.h              
                \
                                        antlr3config.h
  
 -libantlr3c_la_LDFLAGS = -avoid-version
-+libantlr3c_la_LDFLAGS = -release ${PACKAGE_VERSION}
++libantlr3c_la_LDFLAGS = -version-info @LIB_VERSION@
  
  INCLUDES = -Iinclude
  
+--- a/configure.ac
++++ b/configure.ac
+@@ -34,6 +34,8 @@ AC_COPYRIGHT([
+ ])
+ AC_CONFIG_SRCDIR(src/antlr3parser.c)
+ 
++LIB_VERSION=`echo $PACKAGE_VERSION|sed 's@\.@:@g'`
++AC_SUBST([LIB_VERSION])
+ 
+ AC_ARG_ENABLE([debuginfo],
+               [AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into 
the library (default --disable-debuginfo)])],

++++++ baselibs.conf ++++++
libantlr3c3
++++++ fix-LIST-memory-leak.patch ++++++
>From 26aaa0f97e45025c48139bd39adc8808f9b4e697 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jirisl...@gmail.com>
Date: Thu, 17 Feb 2011 21:26:57 +0100
Subject: [PATCH] collections: fix a LIST memory leak

When using antlr3 lists, Valgrind reports leaks like this:
==30092== HEAP SUMMARY:
==30092==     in use at exit: 80 bytes in 2 blocks
==30092==   total heap usage: 286 allocs, 284 frees, 1,781,381 bytes allocated
==30092==
==30092== 40 bytes in 1 blocks are definitely lost in loss record 1 of 2
==30092==    at 0x4C2659D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30092==    by 0x4E333B8: antlr3HashPutI (antlr3collections.c:569)

It's because we use HASH as a representation for LIST. The LIST
abstracts from HASH, so a user doesn't see a hash 'entry' itself.
Hence if the user do list->remove, the HASH returns an 'entry' to us
and we return entry->data to the user. But nobody frees the entry
itself.

So free the entry from now on.

Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 src/antlr3collections.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/antlr3collections.c b/src/antlr3collections.c
index 48ffe18..01f3f7e 100644
--- a/src/antlr3collections.c
+++ b/src/antlr3collections.c
@@ -946,7 +946,9 @@ antlr3ListRemove        (pANTLR3_LIST list, ANTLR3_INTKEY 
key)
 
     if (entry != NULL)
     {
-        return  entry->data;
+       void *data = entry->data;
+       ANTLR3_FREE(entry);
+        return  data;
     }
     else
     {
-- 
1.7.3.4

++++++ fix-hash-double-free.patch ++++++
>From 6f5dad7d06620b4665303c542549d4c14f9fe784 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jirisl...@gmail.com>
Date: Sat, 19 Feb 2011 13:26:35 +0100
Subject: [PATCH] collections: hash, fix double free

We should not free the hash entry in antlr3HashFree when we didn't
strdup on that earlier.

I.e. make the free depend on table->doStrdup.

Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 src/antlr3collections.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/antlr3collections.c b/src/antlr3collections.c
index 01f3f7e..3e32dc3 100644
--- a/src/antlr3collections.c
+++ b/src/antlr3collections.c
@@ -237,7 +237,9 @@ antlr3HashFree(pANTLR3_HASH_TABLE table)
                     */
                    if  (entry->keybase.type == ANTLR3_HASH_TYPE_STR && 
entry->keybase.key.sKey != NULL)
                    {
-                       ANTLR3_FREE(entry->keybase.key.sKey);
+                       if (table->doStrdup == ANTLR3_TRUE) {
+                           ANTLR3_FREE(entry->keybase.key.sKey);
+                       }
                    }
 
                    /* Free this entry
-- 
1.7.3.4


Reply via email to