From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.bugs Subject: bug#20209: GUILE 2.0.11: crash in set_port_filename_x for bytevector ports Date: Fri, 27 Mar 2015 09:18:48 +0100 Message-ID: <87bnje26qf.fsf@fencepost.gnu.org> References: <87fv8r1pio.fsf@fencepost.gnu.org> <87egob8irs.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427444441 7498 80.91.229.3 (27 Mar 2015 08:20:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 08:20:41 +0000 (UTC) Cc: 20209@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 27 09:20:30 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YbPUx-00049L-Tr for guile-bugs@m.gmane.org; Fri, 27 Mar 2015 09:20:12 +0100 Original-Received: from localhost ([::1]:48836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPUx-0000JA-3z for guile-bugs@m.gmane.org; Fri, 27 Mar 2015 04:20:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPUt-0000GK-Re for bug-guile@gnu.org; Fri, 27 Mar 2015 04:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbPUp-0001kw-FB for bug-guile@gnu.org; Fri, 27 Mar 2015 04:20:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPUp-0001kS-BT for bug-guile@gnu.org; Fri, 27 Mar 2015 04:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YbPUo-00055W-Rk for bug-guile@gnu.org; Fri, 27 Mar 2015 04:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 27 Mar 2015 08:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20209 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 20209-submit@debbugs.gnu.org id=B20209.142744435619502 (code B ref 20209); Fri, 27 Mar 2015 08:20:02 +0000 Original-Received: (at 20209) by debbugs.gnu.org; 27 Mar 2015 08:19:16 +0000 Original-Received: from localhost ([127.0.0.1]:37799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbPU3-00054U-MX for submit@debbugs.gnu.org; Fri, 27 Mar 2015 04:19:16 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:59760 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbPU0-00054K-Sj for 20209@debbugs.gnu.org; Fri, 27 Mar 2015 04:19:13 -0400 Original-Received: from localhost ([127.0.0.1]:38833 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbPTz-0006bN-QB; Fri, 27 Mar 2015 04:19:12 -0400 Original-Received: by lola (Postfix, from userid 1000) id A9932E0CAC; Fri, 27 Mar 2015 09:18:48 +0100 (CET) In-Reply-To: <87egob8irs.fsf@netris.org> (Mark H. Weaver's message of "Thu, 26 Mar 2015 19:02:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7759 Archived-At: Mark H Weaver writes: > The problem turns out to be that binary ports are not initialized until > the (ice-9 binary-ports) module is loaded. As a result, the port > returned by 'scm_open_bytevector_input_port' has a bad type tag. > > The workaround is to call scm_c_resolve_module ("ice-9 binary-ports") > after initializing Guile before the first call to > 'scm_open_bytevector_input_port'. It kind of defeats the point of having scm_open_bytevector_input_port in the C library part if you have to call scm_c_resolve_module before use. It's also a rather inscrutable error symptom. Any chance wrong-type-arg can guard against uninitialized/invalid types specifically? There is a reasonably high chance that bad/uninitialized SCM will wash up there. The more thorough way would be to check the type tag to be in valid range before doing any smob callback. -- David Kastrup