From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5694 invoked by alias); 30 Aug 2012 16:41:05 -0000 Received: (qmail 5677 invoked by uid 22791); 30 Aug 2012 16:41:01 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from server-nat-6.cs.umd.edu (HELO bacon.cs.umd.edu) (128.8.127.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Aug 2012 16:40:48 +0000 Received: from wireless-206-196-164-53.umd.edu (wireless-206-196-164-53.umd.edu [206.196.164.53]) (Authenticated sender: khooyp) by bacon.cs.umd.edu (Postfix) with ESMTPSA id C95F5B40634; Thu, 30 Aug 2012 12:40:46 -0400 (EDT) Subject: Re: Disable -lmcheck when Python has threads (Re: [BUG] gdb crash when "python import gtk") Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Khoo Yit Phang In-Reply-To: <2E2CF815-7C3F-40D1-A8FB-CEB190731F20@cs.umd.edu> Date: Thu, 30 Aug 2012 16:41:00 -0000 Cc: Jan Kratochvil , Hui Zhu , gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <412B852B-1E0B-4F3F-B13A-B556EFF67806@cs.umd.edu> References: <20120719073959.GA10044@host2.jankratochvil.net> <20120830160438.GA25469@host2.jankratochvil.net> <41429A68-82EE-4B57-BAB3-559D2907A71B@cs.umd.edu> <2E2CF815-7C3F-40D1-A8FB-CEB190731F20@cs.umd.edu> To: Khoo Yit Phang X-CSD-MailScanner-ID: C95F5B40634.A9BB5 X-CSD-MailScanner: Found to be clean X-CSD-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=not spam, ALL_TRUSTED -50.00) X-CSD-MailScanner-From: khooyp@cs.umd.edu X-CSD-MailScanner-Watermark: 1346949646.97861@2boqHmHhyQzlCdGgoVeGiw Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00099.txt.bz2 Hi, Here's a test case that shows the problem, semi-reliably (it is a concurren= cy bug): (gdb) python >from threading import Thread >def blah(): > while True: > a =3D [ {}, {}, {}, {}, 1, 2, "abc" ] > >t =3D Thread(None, blah) >t.start() > >for i in range(100000): > gdb.execute("break foo", to_string=3DTrue) >end (gdb) *** glibc detected *** /home/khooyp/Projects/Research/gdb-1/build.yu= buntu/gdb/gdb: munmap_chunk(): invalid pointer: 0x09b05d10 *** ... It is unrelated to pygtk. Yit August 30, 2012 On Aug 30, 2012, at 12:11 PM, Khoo Yit Phang wrote: > Hi, >=20 > Here's the corresponding bug report for glibc stating that it is by desig= n: http://sourceware.org/bugzilla/show_bug.cgi?id=3D9939 >=20 > Yit > August 30, 2012 >=20 > On Aug 30, 2012, at 12:08 PM, Khoo Yit Phang wrote: >=20 >> Hi, >>=20 >> On Aug 30, 2012, at 12:04 PM, Jan Kratochvil wrote: >>=20 >>> Hi, >>>=20 >>> On Thu, 30 Aug 2012 18:00:46 +0200, Khoo Yit Phang wrote: >>>> I ran into a similar issue as below and tracked it down: the "memory >>>> clobbered before allocated block" (and other related messages) because >>>> -lmcheck is not thread safe, and triggers spuriously when threads are = used >>>> in Python (e.g., the "gtk" module). >>>=20 >>> this needs some references to glibc/gtk/python maintainers statements e= tc. >>>=20 >>> -lmcheck is AFAIK thread safe in glibc itself. >>=20 >> -lmcheck is definitely not thread safe, at least as of glibc 2.13 (Ubunt= u 11.04). See the first answer of http://stackoverflow.com/questions/314931= /glibcs-lmcheck-option-and-multithreading. >>=20 >> Yit >> August 30, 2012