From unknown Mon Aug 18 11:18:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#29275 <29275@debbugs.gnu.org> To: bug#29275 <29275@debbugs.gnu.org> Subject: Status: dynamic-link hangs on error Reply-To: bug#29275 <29275@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:18:04 +0000 retitle 29275 dynamic-link hangs on error reassign 29275 guile submitter 29275 noxdafox severity 29275 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 12 13:22:50 2017 Received: (at submit) by debbugs.gnu.org; 12 Nov 2017 18:22:50 +0000 Received: from localhost ([127.0.0.1]:37139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDwuA-0000ne-JZ for submit@debbugs.gnu.org; Sun, 12 Nov 2017 13:22:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDwoM-0000et-BA for submit@debbugs.gnu.org; Sun, 12 Nov 2017 13:16:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDwoG-0000ko-8q for submit@debbugs.gnu.org; Sun, 12 Nov 2017 13:16:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eDwoG-0000kd-4S for submit@debbugs.gnu.org; Sun, 12 Nov 2017 13:16:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDwoF-0003B6-5f for bug-guile@gnu.org; Sun, 12 Nov 2017 13:16:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDwoC-0000ib-2A for bug-guile@gnu.org; Sun, 12 Nov 2017 13:16:43 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:56020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDwoB-0000hq-QO for bug-guile@gnu.org; Sun, 12 Nov 2017 13:16:39 -0500 Received: by mail-lf0-x22d.google.com with SMTP id e143so15959914lfg.12 for ; Sun, 12 Nov 2017 10:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=jIYOXeHWyQvCX3brNAW4Eqzfb+MlLHbgOx6eVMWsY+0=; b=tSbE4ZDKLZacihjTKDwOCV5uYh80U9GIfXF+vHhIrhxvY77AXO5KXN/53WTq1lMJyx QKRt95saX1GRTXAdIumFdyK44yMxahXcu8eOEKbH9mc9B/3Li4/vQzsgRLDylFjOmGtI LS0RK/jKf1jG51fXvKLDZcBcF+bMnt3C0cwVpImP3hp1Sq3IDJl4J7rUETmd3PpV/qFV Gcv0YUNIno7beLgh2TnAhy5WUcjqogpWXnJL9t0dScJoeQVBUX96xra6bU6f4saWeW9B MiRs1PJv466caME6XCEW01PIZnhZwn2UG/hl4YfWQxpAn2vzmBlUynkimYP7vPe2hevb pjCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=jIYOXeHWyQvCX3brNAW4Eqzfb+MlLHbgOx6eVMWsY+0=; b=qXe38VjKs+4d0/LVPj7KicDIKXkCNbj22SJnaz2CtcpgepFvDyobcxB5uvVth6PeG1 XajpRIwfg/8jBNRDdivQd3/m79lgEjO6wpHvXuYG2eWI4HgWOoBy70eC5lx8RURxZcp9 lg2blbQZXj/9NJc2Vsy9oPw21AFSxbiETIRDV0gOGEREbuZMXjhKuzyK7sHX9zFS6sjN LRBApdf5c//mFdN00j0jH/oW1COD+HRq9709k/WoFusozxRv5op9cPhKzwmutwayXRwb RBpAdb6HAhecPYbsa8DDlbdIvFmLjzqRGJsr4FaJ1rA70gHb8f1wJxbizAQ2TClizij7 hwUg== X-Gm-Message-State: AJaThX6ToIyHYlEylW7BjIBF4JMbxEyH62OYREG/LJHy0LS2lAIv+ZYD xTBpCOm17HbBgNRphJyh/jgwXg== X-Google-Smtp-Source: AGs4zMZGXkvHelUGJaOa/AtYflg9KjjI+igWyrsXlFkRfqLhzs7r1iuJZfViaJkdm4dLtBner5h2nQ== X-Received: by 10.46.65.14 with SMTP id o14mr2420827lja.172.1510510597695; Sun, 12 Nov 2017 10:16:37 -0800 (PST) Received: from [192.168.1.102] (82-203-191-46.bb.dnainternet.fi. [82.203.191.46]) by smtp.gmail.com with ESMTPSA id x7sm852057lje.47.2017.11.12.10.16.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Nov 2017 10:16:36 -0800 (PST) To: bug-guile@gnu.org From: noxdafox Subject: dynamic-link hangs on error Message-ID: Date: Sun, 12 Nov 2017 20:16:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 12 Nov 2017 13:22:49 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Greetings, I am trying to call some C function which seems not to be included in Guile library (fnmatch). If dynamic-link is given wrong library objects, it will hang forcing the user to kill the VM as it becomes unresponsive. I could find at least 2 ways to reproduce it: 1. Calling dynamic-link on a wrong object 2. Calling dynamic-link subsequently on 2 non existing objects Here's an example: GNU Guile 2.2.2 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (use-modules (system foreign)) scheme@(guile-user)> (define libc-obj (dynamic-link "nonexisting")) ERROR: In procedure dynamic-link: ERROR: In procedure dynamic-link: file: "nonexisting", message: "file not found" Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> (define libc-obj (dynamic-link "nonexisting")) ^^^ here the VM becomes unresponsive. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 22 10:48:01 2017 Received: (at 29275-done) by debbugs.gnu.org; 22 Nov 2017 15:48:01 +0000 Received: from localhost ([127.0.0.1]:52896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHXFo-0007vv-Vf for submit@debbugs.gnu.org; Wed, 22 Nov 2017 10:48:01 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:60662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHXFn-0007vn-Fn for 29275-done@debbugs.gnu.org; Wed, 22 Nov 2017 10:47:59 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 242AAFF1C; Wed, 22 Nov 2017 16:48:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YYunDmyFtEtP; Wed, 22 Nov 2017 16:48:00 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6334EF382; Wed, 22 Nov 2017 16:48:00 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: noxdafox Subject: Re: bug#29275: dynamic-link hangs on error References: Date: Wed, 22 Nov 2017 16:47:57 +0100 In-Reply-To: (noxdafox@gmail.com's message of "Sun, 12 Nov 2017 20:16:35 +0200") Message-ID: <873756xqky.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29275-done Cc: 29275-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, noxdafox skribis: > GNU Guile 2.2.2 > Copyright (C) 1995-2017 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> (use-modules (system foreign)) > scheme@(guile-user)> (define libc-obj (dynamic-link "nonexisting")) > ERROR: In procedure dynamic-link: > ERROR: In procedure dynamic-link: file: "nonexisting", message: "file > not found" > > Entering a new prompt.=C2=A0 Type `,bt' for a backtrace or `,q' to contin= ue. > scheme@(guile-user) [1]> (define libc-obj (dynamic-link "nonexisting")) > > ^^^ here the VM becomes unresponsive. This is because libguile synchronizes uses of =E2=80=98dynamic-link=E2=80= =99 with a non-recursive mutex. Here, the =E2=80=9Cinner=E2=80=9D =E2=80=98dynamic-li= nk=E2=80=99 call occurs while the mutex is already held by the calling thread, which is why it just hangs. Fixed in commit 48d42553ef5a9c2240bc2296d1b38dbfd5fca1ac, which will be in the next 2.2 release. Thanks, Ludo=E2=80=99. From unknown Mon Aug 18 11:18:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 21 Dec 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator