GNU bug report logs -
#20209
GUILE 2.0.11: crash in set_port_filename_x for bytevector ports
Previous Next
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
Mark H Weaver <mhw <at> netris.org> 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
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.