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

Negative Array Size Exception #2193

Closed Shridharfly closed 7 years ago

Shridharfly commented 7 years ago

I am using z1 motes and simple rpl-udp client and server in contiki 3.0, cooja simulator. The OS and JVM are both 32-bit type.

I am just trying to test quark using motes. When I run code using simple terminal, without motes and cooja simulator, it works fine. But if I test it using motes it reports following error:

[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - java.lang.NegativeArraySizeException
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.mspmote.MspMoteMemory.getMemorySegment(MspMoteMemory.java:81)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.mote.memory.Memory.getByteArray(Memory.java:165)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.interfaces.IPAddress.addIPv6Addresses(IPAddress.java:266)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.interfaces.IPAddress.updateIPAddresses(IPAddress.java:236)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.interfaces.IPAddress.access$100(IPAddress.java:58)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.interfaces.IPAddress$1.memoryChanged(IPAddress.java:154)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.mspmote.MspMoteMemory$MemoryCPUMonitor.notifyWriteAfter(MspMoteMemory.java:157)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at se.sics.mspsim.core.WatchedMemory.write(WatchedMemory.java:36)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at se.sics.mspsim.core.MSP430Core$1.write(MSP430Core.java:171)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at se.sics.mspsim.core.MSP430Core.emulateOP(MSP430Core.java:2156)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at se.sics.mspsim.core.MSP430.stepMicros(MSP430.java:256)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.mspmote.MspMote.execute(MspMote.java:337)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.mspmote.MspMote.execute(MspMote.java:298)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.motes.AbstractWakeupMote$1.execute(AbstractWakeupMote.java:47)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at org.contikios.cooja.Simulation.run(Simulation.java:281)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - at java.lang.Thread.run(Thread.java:745)

How do I get rid of this error?

Shridharfly commented 7 years ago

Trying to use malloc() in contiki caused the error.