Intermittent bug exhibited by kaffe.io.ConverterAlias

Matthew Bloch kaffe@rufus.w3.org
Wed, 12 Dec 2001 01:04:52 +0000 (GMT)


   [just posting this to the main Kaffe list in case it's less quiet than
    the pocketlinux one; if there's a policy on when to cross-post, please
    tell me]

This is a weird one, probably my own fault for relying on unstablecode
from CVS?  Mind you not sure where to look to find lists of existing bugs
/ past CVS checkins etc.  As I said, there's nowhere explicitly stated
that tells you how the Kaffe in the pocketlinux CVS differs from the
pocketlinux release, and how much that differs from the latest Kaffe
release.  Slightly confusing; can anyone point me to some formal revision
docs, if there are any?

Anyhow, if you've got a PocketLinux setup handy that's built from the CVS
as of a few days ago, try this program (based on kaffe.io.ConverterAlias),
compiled with jikes 1.15 just in case, and tell me what you get:

----------------------------------------------------------------------
import java.util.Hashtable;

public class ConverterAlias {

    static String encodingDefault = System.getProperty("file.encoding");
    static Class noConverter = ConverterAlias.class;

    private static Hashtable alias = new Hashtable();

    static {
        alias.put("ISO-8859-1",         "Default");
        alias.put("ISO 8859-1",         "Default");
        alias.put("ISO 8859_1",         "Default");
        alias.put("ISO8859_1",          "Default");
        alias.put("ISO-IR-100",         "Default");
        alias.put("LATIN1",             "Default");
        alias.put("L1",                 "Default");
        alias.put("CSISOLATIN1",        "Default");
        alias.put("IBM819",             "Default");
        alias.put("CP819",              "Default");
        alias.put("ISO-2022-JP",        "EUC_JP");
        alias.put("EBCDIC",             "CP1046");
        alias.put("UTF-8",              "UTF8");
        alias.put("KOI8-R",             "KOI8_R");
    }

    static String alias(String name) {
        name = name.toUpperCase();
        String alternate = (String)alias.get(name);
        if (alternate == null) {
            return (name);
        } else {
            return (alternate);
        }
    }

    public static void main(String[] args)
    {
        System.out.println(ConverterAlias.alias("ISO-8859-1"));
    }
}
----------------------------------------------------------------------

My compile options were:

----------------------------------------------------------------------
--target=arm-linux
--host=arm-linux
--with-engine=jit3
--with-execute='/'
--with-awt=fgl
--with-staticlib
--with-staticbinary
--without-flash
--without-x
--without-png
--without-tiff
--without-verifier
--with-jpeg
--with-gif
--with-rawjar=file
--with-optimize-memory
--with-threads=unix-jthreads
--without-verifier
--with-libraries=native,io,awt,net,zip
----------------------------------------------------------------------

You'd expect to get the string 'Default' printed on screen, but ohhhh no
:)  On my system (an Acorn RISC PC running Linux 2.2.16-rmk1), I get the
string I3O-8859-1.  Where on earth is that 3 coming from?  Is there some
memory corruption going on?  I get the correct result if I delete pretty
much any of the above lines (try removing the alias.put lines or the
conversion to uppercase).  I'm just hoping whoever wrote this might have
more of an answer, since I've not got time to chase a random piece of
memory corruption.  But if it's 'obviously' my compile options, or that
behaviour is somehow explicable, tell me now!

cheers,

-- 
Matthew       > http://www.soup-kitchen.net/
              > ICQ 19482073