Oz and Mozart Users Mailing List

Bug 1160 understood


From: Terence M. Rokop (rokopt@polyserve.com)
Date: Wed Nov 05 2003 - 03:45:37 CET


I finally understand the cause of bug 1160, which I filed a few weeks
ago, and which has been preventing me from building Mozart 1.3.0 on
various new Linux distributions -- it failed on Debian unstable,
Mandrake 9.2, and SuSE 9.0. The problem was this:

        http://dev.perl.org/perl5/news/2003/perl-5.8.1-RC3.html#hash%20randomisation

As of version 5.8.1, perl's foreach returns different key orders each
time it is run on the same hash table. mozart/platform/emulator/atoms.perl
had been relying on foreach returning the same key order every time it ran
on the %atoms and %names hashes, because it was called twice on each, once
to generate atoms.hh and once to generate atoms.cc. Because perl generated
different orders with each execution, the mapping of the preprocessor
#defines of atoms and names, such as AtomNil, to the generated atoms and
names, such as oz_atomNoDup("nil"), was random. That was why the atom
called "nil" was not equal to AtomNil.

When I replaced the four lines (two of each type) reading

        foreach $key (keys %atoms) {
        foreach $key (keys %names) {

in atoms.perl with

        foreach $key (sort keys %atoms) {
        foreach $key (sort keys %names) {

respectively, the build succeeded.

-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
Please send bug reports to bugs@mozart-oz.org.



This archive was generated by hypermail 2b29.