BricxCC/NBC test release 2011-07-19

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by muntoo »

I know this won't help, but my attached program fails at OptLevel3. There's some problem in WordWrapOut(). If you remove my #if 0s in WordWrapOut(), you'll notice some more strange behaviour.

Everything works OK if you comment out line 242 in NXTFileManager.nxc:

Code: Select all

// FileTaskOpen(fname);
Attachments
NXTFileManager.zip
(1.06 MiB) Downloaded 416 times
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by afanofosc »

Can you be more specific about how it fails? If you comment out that particular line then the entire function is optimized out and that completely changes the resulting dataspace so it makes it hard to sort out what it is about the program without this code that works vs not working when the code is compiled into the RXE. If you could make some small additions to your code that adjust the contents of the dataspace and make it work at level 3 optimizations then that might help me. Unless you are talking specifically about an unsafe compiler optimization that is breaking the code rather than revealing a long existing very low level bug in the compiler having to do with the organization of the dataspace.

Can you also elaborate on the more strange behavior that I should notice if I took out your #if 0? You'd be amazed at the things in other people's program's behavior that I simply do not notice since I have no idea what its correct behavior is supposed to be.

Maybe one of the changes I made to speed up optimization has had an unexpected side effect that is the root cause of these strange problems. I will check into this possibility.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by afanofosc »

schodet wrote: OK, but, I did not see the new image yet (here? http://bricxcc.sourceforge.net/test_releases/).
I apologize for the delay. I will try to remember to upload a new test release tonight.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by muntoo »

More detailed error report:
nbc -Z3 - NXTFileManager.rxe gave a File Error! -5 when running the program, so I nexttool -cleared all the files off my NXT, and recompiled/downloaded the program. Now, if I press the right button, the program freezes and the display clears halfway. (The screen was refreshing while WordWrapOut() executed and froze the NXT?)

nbc -Z1 - It works fine - the program doesn't freeze/crash. At least, not while navigating through the file list.

It sounds like a firmware bug (in addition to the compiler): the firmware shouldn't freeze no matter what the .rxe file's input is ...right? Instead, it should've returned a File Error, or something.



EDIT: Also, the output NBC code has a lot of duplicate identifiers. You might wanna fix that. :)
EDIT 2: Attached shorter version (still a bit long) that still gives me trouble.
Attachments
NXTFileManager_BugHunting.zip
(1.06 MiB) Downloaded 464 times
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
pbenco
Posts: 71
Joined: 29 Sep 2010, 09:43
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by pbenco »

Dear afanofosc

I have a digital scope too, 200MHz capable, how could I help?
Could you provide a test firmware with the speedy i2c, and a test program able to expose the behaviour you try to catch.
Best regards
ben
pbenco.wordpress.com/
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by muntoo »

Found a little bug! (-Z3. I don't know about -Z2, though.)

The __strToLines_7qG2_szOut_7qG2_000 variable's value never changes during the program! It's always 0x0.

This is why I can't see LCD_LINE4 text in WordWrapOut(). (One of the #if 0s.)
Attachments
NXTFileManager.nbc.zip
(5 KiB) Downloaded 417 times
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
afanofosc_99
Posts: 15
Joined: 26 Sep 2010, 18:18

Re: BricxCC/NBC test release 2011-07-19

Post by afanofosc_99 »

muntoo wrote: EDIT: Also, the output NBC code has a lot of duplicate identifiers. You might wanna fix that. :)
EDIT 2: Attached shorter version (still a bit long) that still gives me trouble.
There should not be any duplicate identifiers. Can you elaborate?

John Hansen
afanofosc_99
Posts: 15
Joined: 26 Sep 2010, 18:18

Re: BricxCC/NBC test release 2011-07-19

Post by afanofosc_99 »

pbenco wrote:Dear afanofosc

I have a digital scope too, 200MHz capable, how could I help?
Could you provide a test firmware with the speedy i2c, and a test program able to expose the behaviour you try to catch.
Best regards
ben
I've been feverishly trying to finish up a project that has delayed posting a new test firmware and compiler/IDE. I apologize for the delay. I will post here when I have uploaded a new test release zip with the firmware image and a compiler and test program.

John Hansen
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by schodet »

afanofosc_99 wrote:I've been feverishly trying to finish up a project that has delayed posting a new test firmware and compiler/IDE. I apologize for the delay. I will post here when I have uploaded a new test release zip with the firmware image and a compiler and test program.
No problem :)
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: BricxCC/NBC test release 2011-07-19

Post by muntoo »

afanofosc_99 wrote:There should not be any duplicate identifiers. Can you elaborate?
I meant duplicate definitions like this:

Code: Select all

dseg	segment
;------- definitions -------
// ...

Location_def	struct
X	sword
Y	sword
Location_def	ends

// ... Later ...

Location_def	struct
X	sword
Y	sword
Location_def	ends

// ...
dseg ends
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest