bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20209: GUILE 2.0.11: crash in set_port_filename_x for bytevector por


From: David Kastrup
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Mark H Weaver <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]