Author Topic: Bug Reports  (Read 465920 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Bug Reports
« Reply #1590 on: November 14, 2011, 03:00:40 pm »
This happened again: Axe have a bug with generating appvar O.o
It gives me ERR:MEMORY even though appvar is only 48 bytes big O.o
« Last Edit: November 14, 2011, 03:00:52 pm by TBO_Yeong »
Sig wipe!

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Bug Reports
« Reply #1591 on: November 14, 2011, 03:14:37 pm »
That doesn't sound like Axe is the one at fault.  Can you please post your code for doing this?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Bug Reports
« Reply #1592 on: November 16, 2011, 03:03:35 pm »
Data(0,0,0,0,0,0,0,0,0,......)->A
GetCalc("appvMTEMP",48)->B
Copy(A,B,48
Sig wipe!

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Bug Reports
« Reply #1593 on: November 16, 2011, 03:06:22 pm »
change a to gdb1 plz and post results
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #1594 on: November 16, 2011, 03:18:44 pm »
Axe has problems when the last of the compiled code in a program is targeted by the peephole optimizer. In this case, Axe is producing erroneous code because Copy(A,B,48 is the last bit of code in the program and it's targeted by the peephole optimizer. This can be avoided easily enough until it is fixed by putting some other code after it or turning off the peephole optimizer altogether by pressing ZOOM to compile instead of ENTER.
« Last Edit: November 16, 2011, 03:19:54 pm by Runer112 »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Bug Reports
« Reply #1595 on: November 16, 2011, 03:19:14 pm »
still gives me an ERR:MEMORY.

EDIT: I had 19545 RAM left, fyi
« Last Edit: November 16, 2011, 03:19:42 pm by TBO_Yeong »
Sig wipe!

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Bug Reports
« Reply #1596 on: November 16, 2011, 06:04:05 pm »
I know exactly what is causing that error.  It is as runner said, the peephole optimizer.  There is currently a bug where Axe confuses offsets with constants and is turning your code into exactly this:

Code: [Select]
Data(0,0,0,0,0,0,0,0,0,......)->A
GetCalc("appvMTEMP",)->B
Copy(A,B,48

The current offset in the code is 48 and you were using 48 at the same time to specify the size.  It also happens to be in a pattern that normally peephole optimizes.  So now its attempting to create an appvar with a size equal to the pointer which is a number around $9E00 which is over 40,000 bytes!  You can fix this temporarily as Runer said by using zoom compile or adding one more zero to your data.  Adding more code to the end wouldn't fix anything because there aren't any known bugs with ending code changing behavior to my knowledge.
« Last Edit: November 16, 2011, 06:05:35 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Bug Reports
« Reply #1597 on: November 16, 2011, 07:42:26 pm »
ah, thank you so much for clearing that out for me. :D
Sig wipe!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #1598 on: November 16, 2011, 08:48:07 pm »
I know exactly what is causing that error.  It is as runner said, the peephole optimizer.  There is currently a bug where Axe confuses offsets with constants and is turning your code into exactly this:

Code: [Select]
Data(0,0,0,0,0,0,0,0,0,......)->A
GetCalc("appvMTEMP",)->B
Copy(A,B,48

The current offset in the code is 48 and you were using 48 at the same time to specify the size.  It also happens to be in a pattern that normally peephole optimizes.  So now its attempting to create an appvar with a size equal to the pointer which is a number around $9E00 which is over 40,000 bytes!  You can fix this temporarily as Runer said by using zoom compile or adding one more zero to your data.  Adding more code to the end wouldn't fix anything because there aren't any known bugs with ending code changing behavior to my knowledge.


Uhh... I don't think that explains the code I'm looking at:

Code: [Select]
ld hl,Data000
ld (axv_A),hl
ld hl,Data001
push hl
ld hl,48 ;I'm still here
call p_NewVar
ld (axv_B),hl
ld hl,(axv_A)
push hl
ld hl,(axv_B)
push hl
ld hl,48
pop de
;Note the abrupt end

p_NewVar:
B_CALL(_EnoughMem)
pop hl
ex (sp),hl
jr c,__NewVarFail
push de
push hl
MOV9TOOP1()
B_CALL(_ChkFindSym)
jr c,__NewVarSkip
B_CALL(_DelVarArc)
__NewVarSkip:
pop hl
ld a,(hl)
MOV9TOOP1()
pop hl
push af
B_CALL(_CreateVar)
pop af
ex de,hl
and %00011111
ret z
cp CplxObj
ret z
inc hl
inc hl
ret
__NewVarFail:
ld hl,0
ret
__NewVarEnd:

Data000:
.block 48

Data001:
.db AppVarObj,"MTEMP",0

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Bug Reports
« Reply #1599 on: November 16, 2011, 08:51:52 pm »
That's because the 2 passes get out of sync since it did the replacement in the first pass but didn't in the 2nd.  That can result in all kinds of crazy stuff. ;)
« Last Edit: November 16, 2011, 08:53:02 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #1600 on: November 16, 2011, 08:54:07 pm »
Ah, I guess that could do it. A very crazy bug indeed. O.O

Offline TeruFSX

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 5
  • Rating: +0/-0
    • View Profile
Re: Bug Reports
« Reply #1601 on: November 17, 2011, 10:20:00 am »
There appears to be a bug where certain for-output combinations go and corrupt a bunch of memory.

I tried to do this:
Code: [Select]
0->I
For(I,1,8)
rand^16->{I+L1}
End
0->I
For(I,1,8)
Output({I+L1},I,"*")
End
Pause 5000
It ran fine, but upon returning to the home screen it filled with garbage. Free RAM hit 0.
EDIT: Does output use 16-bit ints?
« Last Edit: November 17, 2011, 10:23:32 am by TeruFSX »

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Bug Reports
« Reply #1602 on: November 17, 2011, 02:28:40 pm »
For the output command, the column is in the range 0-15 and the row is in the range 0-7.
In your code, I ranges from 1 to 8, so everywhere you have I, you need I-1 (unless you want to use {L₁+0} for something else).
Code: [Select]
For(I,1,8)
rand^16→{I-1+L₁}
End
For(I,1,8)
Output({I-1+L₁},I-1,"∗")
End
Pause 5000

Edit:
The fact that you have 0→I before For(I,1,8) makes me think that you are trying to make I range from 0 to 7. However, For(I,1,8) starts off by storing 1 to I, causing the 0→I statement to be useless. Instead you may want For(I,0,7).
« Last Edit: November 17, 2011, 02:38:34 pm by jacobly »

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Bug Reports
« Reply #1603 on: November 17, 2011, 06:43:58 pm »
I know exactly what is causing that error.  It is as runner said, the peephole optimizer.  There is currently a bug where Axe confuses offsets with constants and is turning your code into exactly this:

Code: [Select]
Data(0,0,0,0,0,0,0,0,0,......)->A
GetCalc("appvMTEMP",)->B
Copy(A,B,48

The current offset in the code is 48 and you were using 48 at the same time to specify the size.  It also happens to be in a pattern that normally peephole optimizes.  So now its attempting to create an appvar with a size equal to the pointer which is a number around $9E00 which is over 40,000 bytes!  You can fix this temporarily as Runer said by using zoom compile or adding one more zero to your data.  Adding more code to the end wouldn't fix anything because there aren't any known bugs with ending code changing behavior to my knowledge.
Aha, so this must be why the Essence editor truncates randomly...
Good to hear that it's found tho :)
« Last Edit: November 17, 2011, 06:44:18 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Bug Reports
« Reply #1604 on: November 21, 2011, 10:07:26 pm »
According to this, Axe uses some SMC.  I think it's probably the programmer's fault, but I figured I'd post this here so it could be looked into.