GNU bug report logs - #20209
GUILE 2.0.11: crash in set_port_filename_x for bytevector ports

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Thu, 26 Mar 2015 20:19:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: David Kastrup <dak <at> gnu.org>
Subject: bug#20209: closed (Re: bug#20209: GUILE 2.0.11: crash in
 set_port_filename_x for bytevector ports)
Date: Tue, 28 Feb 2017 13:21:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#20209: GUILE 2.0.11: crash in set_port_filename_x for bytevector ports

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 20209 <at> debbugs.gnu.org.

-- 
20209: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20209
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Mark H Weaver <mhw <at> netris.org>, 20209-done <at> debbugs.gnu.org
Subject: Re: bug#20209: GUILE 2.0.11: crash in set_port_filename_x for
 bytevector ports
Date: Tue, 28 Feb 2017 14:20:14 +0100
On Thu 23 Jun 2016 18:34, Andy Wingo <wingo <at> pobox.com> writes:

> From: Andy Wingo <wingo <at> pobox.com>
> Date: Thu, 23 Jun 2016 18:31:55 +0200
> Subject: [PATCH] Register R6RS port and bytevector internals early
>
> * libguile/bytevectors.c (sym_big, sym_little): Rename from scm_sym_big
>   and scm_sym_little, and don't use the snarf mechanism as we need to
>   initialize this value eagerly in case the C API is used before the
>   Scheme module is loaded.
>   (scm_bootstrap_bytevectors): Initialize the endianness symbols here.
> * libguile/r6rs-ports.c (scm_register_r6rs_ports): Register the R6RS
>   port kinds here, for the same reason.

Already applied to 2.0; now applied to master too.

Andy

[Message part 3 (message/rfc822, inline)]
From: David Kastrup <dak <at> gnu.org>
To: bug-guile <at> gnu.org
Subject: GUILE 2.0.11: crash in set_port_filename_x for bytevector ports
Date: Thu, 26 Mar 2015 21:18:23 +0100
[Message part 4 (text/plain, inline)]
The following code

[nextbug.c (text/x-csrc, inline)]
#include <libguile.h>

int main()
{
  scm_init_guile ();
  SCM str = scm_c_make_bytevector (0);
  SCM port = scm_open_bytevector_input_port (str, SCM_UNDEFINED);
  scm_set_port_filename_x (port, scm_from_locale_string ("/usr/local/tmp/lilypond/ly/init.ly"));
  return 0;
}
[Message part 6 (text/plain, inline)]
crashes with the backtrace

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xb7699059 in scm_iprlist () from /usr/lib/libguile-2.0.so.22
(gdb) bt
#0  0xb7699059 in scm_iprlist () from /usr/lib/libguile-2.0.so.22
#1  0xb7699e95 in ?? () from /usr/lib/libguile-2.0.so.22
#2  0xb7699153 in scm_iprlist () from /usr/lib/libguile-2.0.so.22
#3  0xb7699e95 in ?? () from /usr/lib/libguile-2.0.so.22
#4  0xb7699153 in scm_iprlist () from /usr/lib/libguile-2.0.so.22
#5  0xb7699e95 in ?? () from /usr/lib/libguile-2.0.so.22
#6  0xb7698ec9 in scm_prin1 () from /usr/lib/libguile-2.0.so.22
#7  0xb769a606 in scm_simple_format () from /usr/lib/libguile-2.0.so.22
#8  0xb76e5f0b in ?? () from /usr/lib/libguile-2.0.so.22
#9  0xb76e6539 in ?? () from /usr/lib/libguile-2.0.so.22
#10 0xb76e664c in scm_call_with_vm () from /usr/lib/libguile-2.0.so.22
#11 0xb764cc67 in scm_apply () from /usr/lib/libguile-2.0.so.22
#12 0xb764e90e in scm_apply_1 () from /usr/lib/libguile-2.0.so.22
#13 0xb76cdb7b in scm_throw () from /usr/lib/libguile-2.0.so.22
#14 0xb76ce04c in scm_ithrow () from /usr/lib/libguile-2.0.so.22
#15 0xb764b6a3 in scm_error_scm () from /usr/lib/libguile-2.0.so.22
#16 0xb764b778 in scm_error () from /usr/lib/libguile-2.0.so.22
#17 0xb764ba22 in scm_wrong_type_arg () from /usr/lib/libguile-2.0.so.22
#18 0xb76927ca in scm_set_port_filename_x () from /usr/lib/libguile-2.0.so.22
#19 0x08048723 in main () at nextbug.c:8

after outputting

guile: uncaught throw to wrong-type-arg: (set-port-filename! Wrong type argument in position ~A: ~S (1 (Segmentation fault (core dumped)

(by the way: what's up with the non-call of format here?  It's not the
first time I see wrong-type-arg spitting out a format string unmodified)

Compilation was done using
gcc -Wall -ggdb `guile-config compile` nextbug.c `guile-config link` -o nextbug

Version is gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1

platform is
Linux version 3.16.0-33-generic (buildd <at> brownie) (gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6) ) #44-Ubuntu SMP Thu Mar 12 12:25:57 UTC 2015


A few simple experiments for triggering the same crash from Scheme
rather than C were not successful.  That does not necessarily mean much.

It's not hard to guess that this is yet another roadblock on the way to
get LilyPond working with GUILE2.

Any ideas regarding what may be causing this error and how to work
around it?

-- 
David Kastrup

This bug report was last modified 8 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.