[gambit-list] A small bug report

Marc Feeley feeley at IRO.UMontreal.CA
Wed Dec 8 21:38:57 EST 2004


> 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


More information about the Gambit-list mailing list