Bug#742493: [Pkg-postgresql-public] Bug#742493: Bug#742493: pgmemcache segfaults with libmemcached11

2014-05-08 Thread Hannu Valtonen

Hi,

http://bazaar.launchpad.net/~tangent-trunk/libmemcached/1.0/revision/1121.1.13

You're misreading the change. Basically libmemcached stopped using the 
custom memory allocator and changed to using malloc unconditionally, 
breaking backwards compatibility. Before the change it used the custom 
memory allocator which in our case was palloc.


- Hannu


On 8.5.2014 16.32, Christoph Berg wrote:

Re: To Hannu Valtonen 2014-05-02 20140502135529.gb14...@msgid.df7cb.de

Re: Hannu Valtonen 2014-05-02 53639ce0.30...@ohmu.fi

Hi,

This has now been fixed by: 
https://github.com/ohmu/pgmemcache/commit/47623a545be485d6dd1ffb917e990d267ad57f35

Hi,

we've had a closer look at this patch. Assuming pfree() is
PostgreSQL's free() variant (which I believe it is), it looks like
using pfree() was wrong in the first place, and the standard libc
free() should be used, whatever libmemcached version is used.

I think the following patch does the right thing:

Index: pgmemcache/pgmemcache.c
===
--- pgmemcache.orig/pgmemcache.c2014-05-08 15:25:30.260692035 +0200
+++ pgmemcache/pgmemcache.c 2014-05-08 15:27:13.164195600 +0200
@@ -818,10 +818,10 @@ static memcached_return_t server_stat_fu
  {
char *value = memcached_stat_get_value(ptr, stat, *stat_ptr, rc);
appendStringInfo(context, %s: %s\n, *stat_ptr, value);
-  libmc_stat_free(value);
+  free(value);
  }
  
-  pfree(list);

+  free(list);
return MEMCACHED_SUCCESS;
  }
  
Index: pgmemcache/pgmemcache.h

===
--- pgmemcache.orig/pgmemcache.h2014-05-08 15:25:30.260692035 +0200
+++ pgmemcache/pgmemcache.h 2014-05-08 15:27:13.224195312 +0200
@@ -36,13 +36,6 @@
  #undef PACKAGE_TARNAME
  #undef PACKAGE_VERSION
  
-/* libmemcached 1.0.16 changed the allocation function for values returned from memcached_stat_get_value */

-#if LIBMEMCACHED_VERSION_HEX = 0x0116
-  #define libmc_stat_free free
-#else
-  #define libmc_stat_free pfree
-#endif
-
  void _PG_init(void);
  void _PG_fini(void);
  




Do you plan to release a new version, or should I apply the patch to
the current version in Debian for now?

Christoph



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#742493: pgmemcache segfaults with libmemcached11

2014-05-02 Thread Hannu Valtonen

Hi,

This has now been fixed by: 
https://github.com/ohmu/pgmemcache/commit/47623a545be485d6dd1ffb917e990d267ad57f35


- Hannu


On 2.4.2014 19.02, Christoph Berg wrote:

Hi,

when rebuilt with libmemcached11, pgmemcache in Debian started to
segfault. It worked with libmemcached10 before.

I'm not sure whose fault this is - pgmemcache or libmemcached, or
possibly both. Hannu, Michael, could you have a look at this?

(Unforatunately I couldn't find an email for libmemcached, just the
launchpad tracker.)

- Forwarded message from Christoph Berg christoph.b...@credativ.de -

Date: Mon, 24 Mar 2014 13:32:05 +0100
From: Christoph Berg christoph.b...@credativ.de
Reply-To: Christoph Berg christoph.b...@credativ.de, 742...@bugs.debian.org
To: Debian Bug Tracking System sub...@bugs.debian.org
Subject: Bug#742493: Segfault with libmemcached11
X-Debian-PR-Message: report 742493
X-Debian-PR-Package: postgresql-9.3-pgmemcache
X-Debian-PR-Keywords:
X-Debian-PR-Source: pgmemcache

Package: postgresql-9.3-pgmemcache
Version: 2.1.2-1+b1
Severity: grave

The binnum to update the dependency from libmemcached10 to
libmemcached11 seems to have broken the PostgreSQL module:

http://ci.debian.net/data/unstable-amd64/packages/p/pgmemcache/2014-03-23.log

Also in my chroot:

test init ... ok
test start_memcached  ... ok
test test ... FAILED (test process exited with exit code 2)
test stop_memcached   ... ok

2014-03-24 13:16:05 CET LOG:  Serverprozess (PID 25224) wurde von Signal 11 
beendet: Segmentation fault
2014-03-24 13:16:05 CET DETAIL:  Der fehlgeschlagene Prozess führte aus: SELECT 
regexp_replace(memcache_stats(), 'pid:.*', '') AS memcache_stats;
2014-03-24 13:16:05 CET LOG:  aktive Serverprozesse werden abgebrochen
2014-03-24 13:16:05 CET WARNUNG:  breche Verbindung ab wegen Absturz eines 
anderen Serverprozesses
2014-03-24 13:16:05 CET DETAIL:  Der Postmaster hat diesen Serverprozess 
angewiesen, die aktuelle Transaktion zurückzurollen und die Sitzung zu beenden, 
weil ein anderer Serverprozess abnormal beendet wurde und möglicherweise das 
Shared Memory verfälscht hat.

! psql:test.sql:2: SSL SYSCALL error: EOF detected
! psql:test.sql:2: connection to server was lost

Christoph



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org