[gambit-list] A small bug report
Eric Merritt
cyberlync at gmail.com
Wed Dec 8 23:55:06 EST 2004
I realize its not a symbol. It was the fact that it crashed the system
that kind of had me worried. As I said I was just playing around when
I came across it. I was planning to use ##symbol-hash in an
application, but if its got a chance of causing a segfault then I will
avoid it (and all the others that start with ##).
If nothing else I am glad I came accross it. I didn't realize that
these were that unsafe.
thanks,
eric
On Wed, 8 Dec 2004 21:38:57 -0500, Marc Feeley <feeley at iro.umontreal.ca> wrote:
> > Marc,
> >
> > I came across this bug by accident. Its not important to me in any
> > way but I thought you should know about at. It seems that any attempt
> > to apply ##symbol-hash to a symbol composed of numbers, ie
> > (##symbol-hash '33) of (##symbol-hash '5321) causes gsi to segfault.
> > This may or may not have wider implications.
>
> Here's a Gambit rule:
>
> If a function name starts with ## then it is unsafe. It can crash
> the system if you don't give it proper arguments. You should avoid
> using it unless you are sure the arguments are correct.
>
> As the name implies ##symbol-hash expects a symbol. 33 is not a
> symbol, it is a number. This is why (##symbol-hash '33) crashes.
> Now this works: (##symbol-hash (string->symbol "33")) because
> (string->symbol "33") is a symbol.
>
> Marc
>
--
I'm a programmer, I don't have to spell correctly; I just have to
spell consistently
More information about the Gambit-list
mailing list