This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8445 - Text viewer crashes when jumping to end of file
Attached to Project:
Rockbox
Opened by Ori Avtalion (salty-horse) - Friday, 11 January 2008, 15:18 GMT+2
Last edited by Yoshihisa Uchida (Uchida) - Wednesday, 17 March 2010, 13:19 GMT+2
Opened by Ori Avtalion (salty-horse) - Friday, 11 January 2008, 15:18 GMT+2
Last edited by Yoshihisa Uchida (Uchida) - Wednesday, 17 March 2010, 13:19 GMT+2
|
DetailsLoad the following file in the text viewer:
http://www.gutenberg.org/dirs/etext95/study10.txt Set these settings: wordwrap: on. line mode: reflow. wide view: yes. scrollbar: off. Click the "end of file" key ("right" in sansa e200). An error appears: "Data abort at <address>" |
This task depends upon
Closed by Yoshihisa Uchida (Uchida)
Wednesday, 17 March 2010, 13:19 GMT+2
Reason for closing: Accepted
Additional comments about closing: patch commits.
Wednesday, 17 March 2010, 13:19 GMT+2
Reason for closing: Accepted
Additional comments about closing: patch commits.
Using SVN build r16096 and this file:
http://www.gutenberg.org/files/23042/23042.txt
As Nils already mentioned the crash happens when iso_decode() is called with a negative count value. The problem is, THERE IS A MISMATCH BETWEEN PIXELWIDTH AND MEMORY POSITION.
While 'col' is in pixelwidth and 'k' is the index in the memory.
[code]
#define MAX_COLUMNS 64
...
unsigned char scratch_buffer[MAX_COLUMNS + 1];
...
scratch_buffer[k] = 0;
endptr = rb->iso_decode(scratch_buffer + col, utf8_buffer,
prefs.encoding, k-col);
[/code]
When calling iso_decode() for the next screen 'col' has the value 176 (pixelwidth of the E200 screen).
The source 'scratch_buffer + col' will point to some undefined memory location and 'k-col' is negative (k=0..64).
I just wonder why the combination of line mode 'join' and 'wide view' doesn't crash, while it uses a similar code, but I would say it's also wrong there.
r17994
Could you confirm operation?
FS#9855,FS#9892,FS#9893, orFS#9898fails.Please use
FS#9899(this task is closed) if you cannot mend the part in which the patch fails.FS#9899is old, I send a new patch.Please apply the patch in order of
FS#9855,FS#9892,FS#9893,FS#9898,FS#9902,FS#9853,FS#9546and this patch.If you do not apply these patch files, this patch need not be applied.
this means that scrolling left/right screen doesn't make sence. correct me if i'm wrong.
so, forcing narrow view would avoid crash when line mode is set to join or reflow.
i created a patch to do it.
any thoughts?
I think that it is a problem that invalidates the effect of WIDE mode.
I corrected that it did not abend like not changing the movement of original at WIDE mode.
I thought that it does not abend. But there are still a lot of problems in the display etc.
It is necessary to rewrite it completely, and I am doing the work now.