[Bug] leJOS locks on startup screen

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

[Bug] leJOS locks on startup screen

Postby Jeb » Wed Jul 04, 2012 3:06 pm

The information that I have about this, is that running the program in the code section after this, the leJOS system crashes after around 3 weeks of it running said program it locked on the startup screen - pressing buttons didn't do anything, the only thing that made it run again was power cycling. Is there any information stored somewhere in the NXT that can help you debug this - if so, I'll go grab the brick in a day or two when I'm going to the exhibition where it's currently running.

Code: Select all
import javax.microedition.lcdui.Graphics;

import lejos.nxt.Button;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.UltrasonicSensor;


public class WaveRobot {

 public static void main(String args[]) throws InterruptedException
 {
  Graphics g = new Graphics();
  g.drawArc(5, 0, 90, 90, 0, 180);
 
  UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S3);
  while(!Button.ESCAPE.isDown())
  {
   if(sensor.getDistance() < 250)
   {
   g.clear();
   g.drawArc(5, -30, 90, 90, 0, -180);
     
   Motor.C.setSpeed(100);
   Motor.C.rotate(-50);
   Thread.sleep(500);
   Motor.A.setSpeed(100);
   for(int i = 0; i < 5; i++)
   {
    Motor.A.rotate(-50);
    Motor.A.rotate(50);
   }
   Motor.C.rotate(50);
   Thread.sleep(1000);
   g.clear();
   g.drawArc(5, 0, 90, 90, 0, 180);
   }
  }
 }
}
Jeb
New User
 
Posts: 3
Joined: Wed Jul 04, 2012 2:54 pm

Re: [Bug] leJOS locks on startup screen

Postby skoehler » Wed Jul 04, 2012 3:40 pm

So you run that program for 3 weeks - then what happens? The program crashes with an Exception on screen? What was the exception? Did you save the verbose output of the linker or did you save a debug file when linking the application? Then somehow you managed to reboot the brick (by pressing ENTER+ESCAPE?) and I guess you heard the ding-dong sound, but it didn't get past the boot-logo, right? Did you even try to reproduce this issue? I mean, it might not even happen every time. It might actually be a hardware error (bitflip in NXT's memory) or something weired that isn't reproducible.

I think, you don't need to grab that NXT. The memory is already wiped.
Reproducing the issue is more crucial. Telling us what was on the screen would be worth something - unless you neither saved a debug file (*.nxd) when linking or the verbose linker output.
skoehler
leJOS Team Member
 
Posts: 1418
Joined: Thu Oct 30, 2008 4:54 pm

Re: [Bug] leJOS locks on startup screen

Postby gloomyandy » Wed Jul 04, 2012 4:28 pm

Hmm,
I suspect that after 3 weeks we are getting very close to various internal timer values overflowing or going negative. leJOS wasn't really designed to run for so long.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: [Bug] leJOS locks on startup screen

Postby Jeb » Wed Jul 04, 2012 4:38 pm

skoehler wrote:So you run that program for 3 weeks - then what happens? The program crashes with an Exception on screen? What was the exception?

I don't know what happens exactly, all I know is that it seemingly is rebooting, then locks up on the splash screen where you have the leJOS logo and the firmware version - 0.9.1.
skoehler wrote:Did you save the verbose output of the linker or did you save a debug file when linking the application?

Yes, I have debug file. It's up here http://www.bangsholt.dk/WaveRobot.nxd
skoehler wrote:Then somehow you managed to reboot the brick (by pressing ENTER+ESCAPE?) and I guess you heard the ding-dong sound, but it didn't get past the boot-logo, right?

No, I tried to do ENTER+ESCAPE, no response, so instead I remove the battery pack and put it back in - then it worked.
skoehler wrote:Did you even try to reproduce this issue? I mean, it might not even happen every time. It might actually be a hardware error (bitflip in NXT's memory) or something weired that isn't reproducible.
<snip>
Reproducing the issue is more crucial. Telling us what was on the screen would be worth something - unless you neither saved a debug file (*.nxd) when linking or the verbose linker output.

I don't know what steps to take to try and reproduce, as I don't know exactly what happened, I only saw the result of what happened, could you possibly provide some hints? I'll let the robots run another 3 weeks and see if it happens again. For what it's worth, I got two robots running at the exhibition and both had the exact same issue, which lead me to believe it's a bug in the programming somewhere and not a hardware issue.

gloomyandy wrote:Hmm,
I suspect that after 3 weeks we are getting very close to various internal timer values overflowing or going negative. leJOS wasn't really designed to run for so long.

Andy


Okay, that might also be a possibility. Good to know.
Jeb
New User
 
Posts: 3
Joined: Wed Jul 04, 2012 2:54 pm

Re: [Bug] leJOS locks on startup screen

Postby zbuhman » Fri Jul 06, 2012 4:04 am

A signed 32-bit timer with millisecond resolution would indeed overflow after about 3 weeks.

3 weeks, 3 days, 20 hours, 31 minutes, ~23.6 seconds. Does this match your observations?
zbuhman
New User
 
Posts: 22
Joined: Mon Aug 01, 2011 12:34 am
Location: Nebraska, USA

Re: [Bug] leJOS locks on startup screen

Postby Jeb » Sat Jul 07, 2012 3:40 pm

That does sound quite likely that was when the bricks went dead - thanks for the answer.
Jeb
New User
 
Posts: 3
Joined: Wed Jul 04, 2012 2:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff