contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.71k stars 2.58k forks source link

Cooja Mote Configuration Test Failures #2202

Open adamrenner opened 7 years ago

adamrenner commented 7 years ago

I have found a problem with the Cooja Mote Configuration Tests that is repeatable on several computers and releases.

Tests 3 and 4 of the test fail. image and image

This occurs on release-3-0 and release-3-1, but not on release-2-7 Additionally, I do not experience these issues when doing this inside of Instant Contiki.

I suspect that this could be an issue related to 64 bit operating systems

I have also tried with several java versions including Sun 7 and 8 and OpenJDK 7 and 8.

Some information has suggested turning off extensions and ensuring the a 32 bit version of the ncurses library was installed, but these did not fix the problem.

sbungartz commented 7 years ago

Hi, I'm getting the same results. However, for me this also happens in Instant Contiki 3. From the looks of the Java code these tests can never succeed. For example in ConfigurationWizard.java:763 we have:

    addresses = new HashMap<String, Symbol>();
//    boolean parseOK = ContikiMoteType.parseMapFileData(mapData, addresses);
//    if (!parseOK) {
//      testOutput.addMessage("### Error: Failed parsing map file data", MessageList.ERROR);
//      return false;
//    }

and later, without doing anything else on addresses on line 807:

    String varName;
    varName = "var1";
    if (!addresses.containsKey(varName)) {
      testOutput.addMessage("Could not find address of: " + varName, MessageList.ERROR);
      return false;
    }

So these tests seem to be unmaintained.

In Instant Contiki 3 however, I successfully ran a simulation with a hello-world cooja mote.

Have you tried actually running a cooja mote? Sadly I did not have any success there either on my non-virtual system. I tried both gcc 5 and gcc 4 as well as Java 8 and Java 7.

Maybe it really is a 64 bit issue - I'm running 64 bit Ubuntu 16.04 and have only tried 64 bit jdks yet.

It would be nice if the developers could say something about the setups that cooja motes are currently expected to work with.

adamrenner commented 7 years ago

Yes, I was running Cooja motes successfully in Instant Contiki, but Cooja would crash if I ran them in another operating system. That is what took me down the path of checking the results of the tests. I just assumed that the crashes and failures of the tests were related. This might be a bad assumption.

sbungartz commented 7 years ago

Hey @adamrenner or anyone else who might be interested, I managed to work around this by creating a Docker image to run this from. Since Docker virtualization is much more lightweight, you don't really notice that it's not running on your host (which needs to be Linux though for this to be easy...). I used a 32-bit Ubuntu 14.04 as the base system and it seems to work for me. (Might be worth trying 64-bit as well to see if that's actually the problem, but I only need something that works right now). You can check out the README at https://github.com/sbungartz/cooja-docker if you're interested.