From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robin Templeton Newsgroups: gmane.lisp.guile.bugs Subject: bug#24320: Error when printing foreign functions Date: Sat, 27 Aug 2016 14:05:25 -0400 Message-ID: <871t1auly2.fsf@panthera.terpri.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1472324483 9223 195.159.176.226 (27 Aug 2016 19:01:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Aug 2016 19:01:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) To: 24320@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Aug 27 21:01:17 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdiqy-0001dD-0q for guile-bugs@m.gmane.org; Sat, 27 Aug 2016 21:01:16 +0200 Original-Received: from localhost ([::1]:36922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdiqv-0006dQ-Lf for guile-bugs@m.gmane.org; Sat, 27 Aug 2016 15:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdiqq-0006dF-4q for bug-guile@gnu.org; Sat, 27 Aug 2016 15:01:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdiqk-000667-5k for bug-guile@gnu.org; Sat, 27 Aug 2016 15:01:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdiqk-000662-2C for bug-guile@gnu.org; Sat, 27 Aug 2016 15:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bdiqj-0007Zt-S4 for bug-guile@gnu.org; Sat, 27 Aug 2016 15:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robin Templeton Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 27 Aug 2016 19:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24320 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147232442629066 (code B ref -1); Sat, 27 Aug 2016 19:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Aug 2016 19:00:26 +0000 Original-Received: from localhost ([127.0.0.1]:42206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdiqA-0007Yk-3E for submit@debbugs.gnu.org; Sat, 27 Aug 2016 15:00:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdiq9-0007YX-0q for submit@debbugs.gnu.org; Sat, 27 Aug 2016 15:00:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdiq3-00064P-1M for submit@debbugs.gnu.org; Sat, 27 Aug 2016 15:00:19 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdiq2-00064L-UU for submit@debbugs.gnu.org; Sat, 27 Aug 2016 15:00:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdiq0-0006b4-Ri for bug-guile@gnu.org; Sat, 27 Aug 2016 15:00:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdipv-00063L-UU for bug-guile@gnu.org; Sat, 27 Aug 2016 15:00:16 -0400 Original-Received: from [195.159.176.226] (port=38181 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdipv-000611-NI for bug-guile@gnu.org; Sat, 27 Aug 2016 15:00:11 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bdipo-0003fR-GT for bug-guile@gnu.org; Sat, 27 Aug 2016 21:00:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:YnyGOZt3F0QzclfWyrcsucUKhbk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8387 Archived-At: The following program causes `(@ (system vm program) print-program)' to throw an exception when run in Guile 2.1.3.104-8f2f8: (use-modules (system foreign)) (format #t "~S~%" (pointer->procedure double (dynamic-func "sqrt" (dynamic-link)) (list double))) print-program tries to access fields of the procedure's debug info record even if find-program-debug-info fails and returns #f. The following patch fixes the problem. >From 0ec7bff9e71f1c1c46fa3c1d2bdbc43f5db3588c Mon Sep 17 00:00:00 2001 From: Robin Templeton Date: Sat, 27 Aug 2016 13:42:10 -0400 Subject: [PATCH] Check for missing debug info in print-program * module/system/vm/program.scm (print-program): Check the return value of find-program-debug-info. --- module/system/vm/program.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm index 9f5b764..32c96f2 100644 --- a/module/system/vm/program.scm +++ b/module/system/vm/program.scm @@ -265,7 +265,7 @@ lists." ;; It could be the procedure had its name property set via the ;; procedure property interface. (name (or (and program (procedure-name program)) - (program-debug-info-name pdi))) + (and pdi (program-debug-info-name pdi)))) (source (match (find-program-sources addr) (() #f) ((source . _) source))) -- 2.9.3