Stefan Berghofer wrote:
Hello,
the attached ML file causes Poly/ML 4.1.3 to crash with a segmentation fault under Linux version 2.4.21-243-smp4G. Any help would be greatly appreciated.
The bug seems to be in the implementation of the equality operator. I managed to come up with a smaller example: If you define
datatype ('a, 'v) trie = Trie of 'v option * ('a * ('a, 'v) trie) list;
val x = Trie (NONE, [(0, Trie (SOME ~2, []))]);
val y = Trie (NONE, [(~2, Trie (NONE, [(0, Trie (SOME 1, [])), (0, Trie (NONE, []))])), (0, Trie (SOME ~2, [(0, Trie (SOME 2, [])), (1, Trie (SOME ~1, []))]))]);
then the comparison
x = y
causes a segmentation fault with PolyML 4.1.3 (both under Linux and Solaris). With PolyML 4.1, 4.1.1, and 4.1.2 the above comparison leads to the error message
Exception- InternalError: outer level reached in lookupOldAddr raised while compiling
whereas with PolyML 4.0, the comparison still evaluates correctly to false.
Greetings, Stefan