ROBOTC.net forums
http://www.robotc.net/forums/

nxtDisplay... strings cause Click of Death in 3.62
http://www.robotc.net/forums/viewtopic.php?f=63&t=7495
Page 1 of 1

Author:  kfilar [ Wed Dec 25, 2013 2:29 pm ]
Post subject:  nxtDisplay... strings cause Click of Death in 3.62

On 2 different bricks, the following code works fine in RobotC for Mindstorms +Tetrix 3.55, but causes the NXT Click of Death in 3.62:

Code:
task main(){
  int counter = 0;
  while (counter < 30) {
    counter++;
    eraseDisplay();
    nxtDisplayBigTextLine(1, "%s", "Test");  // same result with nxtDisplayCenteredBigTextLine()
    nxtDisplayBigTextLine(3, "%d", counter);  // same result with nxtDisplayCenteredBigTextLine()
    wait1Msec(200);
  }
}


The following code, changing the line 1 parameter from a string to a string variable, fixes it:

Code:
task main(){
  int counter = 0;
  string msg = "Test";
  while (counter < 30) {
    counter++;
    eraseDisplay();
    nxtDisplayBigTextLine(1, "%s", msg);  // same result with nxtDisplayCenteredBigTextLine()
    nxtDisplayBigTextLine(3, "%d", counter);  // same result with nxtDisplayCenteredBigTextLine()
    wait1Msec(200);
  }
}


Could you shed some light on what's going on? Are you able to reproduce this?
Thanks,

Author:  mightor [ Wed Dec 25, 2013 5:31 pm ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

A bug it may be, but why would you use nxtDisplayBigTextLine(1, "%s", "Test"); and not nxtDisplayBigTextLine(1, "Test"); ?

= Xander

Author:  kfilar [ Fri Dec 27, 2013 12:19 pm ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

Well, eliminating the "%s" is certainly how we'll fix our code.

That seems to be the only issue with 3.62 we've found so far.

FTC 6002

Author:  mightor [ Fri Dec 27, 2013 12:46 pm ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

It's deffo a bug, however, it's easy to work around it :)

= Xander

Author:  kfilar [ Sat Dec 28, 2013 10:08 am ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

Easy to work around, but a nasty one though. Compiles just fine. It's only when your code runs across that statement that it goes into the click of death with very little to hint at what happened.

Author:  Ford Prefect [ Sat Dec 28, 2013 10:28 am ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

then you're quite lucky to have RobotC to program with, getting even "very little to hint at what happened".
I just got a few steps of experience with "real" C.
Here you do not even get the slightest hint when everything just dissolves into nothingness. ;)

Author:  mightor [ Sat Dec 28, 2013 10:39 am ]
Post subject:  Re: nxtDisplay... strings cause Click of Death in 3.62

Ford,

With remote gdb you can do it, but you'd have to learn how to use this very powerful (and hard to use) tool. ROBOTC's debugger is much easier to use. When I have issues like this, I will often leave "breadcrumbs" as I go through the program, using writeDebugStreamLine();

= Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/