From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mF0fJ6Z7vV//aAAA0tVLHw (envelope-from ) for ; Tue, 24 Nov 2020 21:31:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MKf2IqZ7vV9FTgAAB5/wlQ (envelope-from ) for ; Tue, 24 Nov 2020 21:31:18 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2C093940482 for ; Tue, 24 Nov 2020 21:31:16 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1DA6C28CA4; Tue, 24 Nov 2020 16:31:08 -0500 (EST) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by mail.notmuchmail.org (Postfix) with ESMTPS id 96CDD28C94 for ; Tue, 24 Nov 2020 16:31:05 -0500 (EST) Received: by mail-ej1-x62a.google.com with SMTP id k9so881ejc.11 for ; Tue, 24 Nov 2020 13:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=sLBMk8TJ6RP3a7kOAlSCMbKuJ7SHqmh/ugvoPa3j1h8=; b=AflLfY4EP5kW1a6wVFKTrh+W+G1Ir6ICOVeqeXLKa+QE5KLYQLsspTH5c5ueAY1BvW nAOgp+cfj2MLfb+Klgy9g73vyAzm4f0pdSKRACwzAAvAQLDLi7UzVhgFHiYj21s8QmqN sHoshZfB5LqShVKthUCj9vGDyZZ0J53X6U6+q5Hk2qiN29VrWd7E5u6RYQeSPk5rYs/9 avTTiqfc8TgjFopMZljsVZupXSctxp29pEn3w0ZnDruxVNuuPiCj8iV8jNg+08VcdVK7 ez3NtvNaBbO1TftGE3aVGJHW2DCl7gJutV042w6jNuWU7WlV1f5b1FmXptr2Nk+LFkDz PLQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=sLBMk8TJ6RP3a7kOAlSCMbKuJ7SHqmh/ugvoPa3j1h8=; b=FR+jFllppRSOO7DMNur/1WPjuW2YFQZAq+elTxM1Iy2rfVBji+hCUD6U2ms5FwQSGb DfdvlDsSixG3zHmLp1SkpvuTYrvY9lUVbuGi4Q/esj9rO90id4A1b4m6f/WHAq8PPyNi Vccb7Q096O5CKbtVFlhUlZ6/JKBSXrh5fyuy5p8JXnWBULg16QWOH4R4xSQ4X2qPRE6L 495XszSHe8ALkexjVj73orCce55J27owzMHNZ0ZCak6gOY0CbLHm2I2ukisC8TC57u93 dR+TfxiLgvnYCoWaDIDw1pGSl0aBVq+gffk1qaiTNQbLFMGADM6DX1XCTEgKukKBWj+P dkrw== X-Gm-Message-State: AOAM533zTQYt3S6Y48alphvOn5Ny1qse7jWRsC/nitZk8TOEE6+w3DvJ N/i6IelwwhOwYHpq3zUqf1I= X-Google-Smtp-Source: ABdhPJyRpoY+0D4ICIU6c3flArDYSNcFnyEEYE4T8FPy1Liee0zjxiODbTnvs7lJA+mo1qD7H41M1A== X-Received: by 2002:a17:906:6896:: with SMTP id n22mr423507ejr.56.1606253462403; Tue, 24 Nov 2020 13:31:02 -0800 (PST) Received: from powell.devork.be (2a02-8388-8480-1180-4c18-fc69-8d8c-22b5.cable.dynamic.v6.surfer.at. [2a02:8388:8480:1180:4c18:fc69:8d8c:22b5]) by smtp.gmail.com with ESMTPSA id jr13sm119696ejb.50.2020.11.24.13.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 13:31:01 -0800 (PST) Sender: Floris Bruynooghe Received: (nullmailer pid 114149 invoked by uid 1000); Tue, 24 Nov 2020 21:31:00 -0000 From: Floris Bruynooghe To: Patrick Totzke , notmuch@notmuchmail.org Subject: Re: notmuch2 (python cffi bindings) segfault gdb logs In-Reply-To: <160612776000.3630981.17332396369796619495@piu> References: <160612776000.3630981.17332396369796619495@piu> Date: Tue, 24 Nov 2020 22:31:00 +0100 Message-ID: <871rgiqw6j.fsf@powell.devork.be> MIME-Version: 1.0 Message-ID-Hash: NM4JI5YXWYL3T756DQGDRSRU3SRR5FZM X-Message-ID-Hash: NM4JI5YXWYL3T756DQGDRSRU3SRR5FZM X-MailFrom: floris.bruynooghe@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=AflLfY4E; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.01 X-TUID: K1fJHwTSEQkx Hi Patrick, On Mon 23 Nov 2020 at 10:36 +0000, Patrick Totzke wrote: > I've been complaining about the new (and old) python bindings causing the python interpreter to segfault occasionally. So far I was not able to reproduce this reliably nor provide error traces. This has just changed: > see below and attached for what I got from gdb. Your gdb info doesn't say explicitly (or I missed it), but this is showing a SEGFAULT I guess? > I hope that whoever is in charge of the bindings can make sense of > it. I don't have any experience so far with cffi nor gdb and have a > hard time debugging this. The logs below are my attempt to collect as > much detail as possible about. Please let me know if I missed > something. >From what I can tell we're calling a function to free something which segfaults, so it probably was freed already and we didn't know. We need to find out who freed it before and why we thought it still needed to be freed. > (gdb) info threads > Id Target Id Frame > * 1 Thread 0x7ffff7c0e740 (LWP 3614451) "python3" __GI_raise (sig=sig@entry=6) > at ../sysdeps/unix/sysv/linux/raise.c:50 >From this I gather we only have one thread, could you confirm this? notmuch2 just isn't thread safe at the moment (I forget whether this was intentional or by accident, might have been intentional depending on how threadsafe libnotmuch is). > Traceback (most recent call first): > > File "/home/pazz/.local/lib/python3.8/site-packages/notmuch2/_thread.py", line 38, in _destroy > capi.lib.notmuch_thread_destroy(self._thread_p) > File "/home/pazz/.local/lib/python3.8/site-packages/notmuch2/_thread.py", line 34, in __del__ > self._destroy() > File "/home/pazz/projects/alot/alot/db/manager.py", line 570, in get_threads > I pulled alot master and this does not match at all. Could you tell me which git ref this was using so I can try and see what alot is actually doing? (or some other way of sharing the source in this backtrace) Cheers, Floris