[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7972) zgrim

zzgrim@gmail.com wrote:
> Full_Name: zgrim
> Version: 2.4.40
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (
>   Hello, thank you for lmdb.
>   I'm using lmdb via a Go wrapper and under some not-yet-clear circumstances,
> under high concurrency stress testing,
> I sometimes get "double free or corruption" SIGABRT related to
> mdb_dbis_update().
>   The setup is using the NOTLS and RDONLY flags on a 64bit 3.17.0 Arch Linux
> system.
>   If I protect the free() inside mdb_dbis_update() (in mdb.c) with a mutex (code
> inline below), the symptom disappears.
>   I'm sorry I can't provide a simple test case, but in my code, without the
> mutex, launching some tens of test clients simultaneously trigger the
> corruption fairly quick, i.e. a few minutes or even seconds.

Sounds like you have not read the mdb_dbi_open() doc closely. The code in 
mdb_dbis_update() only triggers if you've opened new DBs in a transaction. The 
doc for mdb_dbi_open() specifically says you cannot call it from multiple 
concurrent transactions.

Closing this ITS.

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/