Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bugs
  • Category Plugins
  • Assigned To
    Uchida
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by salty-horse - 2008-01-11
Last edited by Uchida - 2010-03-17

FS#8445 - Text viewer crashes when jumping to end of file

Load 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>”

Closed by  Uchida
2010-03-17 12:19
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

patch commits.

Reproduced this bug on my 5.5G 30GB iPod video using all of the settings above.

Using SVN build r16096 and this file:
http://www.gutenberg.org/files/23042/23042.txt

nls commented on 2008-01-24 18:17

Reproducible in sim too. The crash happens in common/unicode.c after iso_decode() is called from viewer.c:916 with a negative “count” parameter.

vmh commented on 2008-07-09 11:20

Reading the bug description I first thought this could be an easy bug to fix. But after looking into the code I think it is better to leave it to someone who is more familiar with the textviewer code to fix it and it is not only a Sansa e200 specific problem.

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

I create the patch file.

Could you confirm operation?

Applying this task’s patch file after you apply  FS#9855 ,  FS#9892 ,  FS#9893 , or  FS#9898  fails.

Please use  FS#9899  (this task is closed) if you cannot mend the part in which the patch fails.

Because the patch file of  FS#9899  is 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#9546  and this patch.

If you do not apply these patch files, this patch need not be applied.

Sync the viewer_2.patch.

sync r21316

teru commented on 2009-07-14 13:25

as far as i looked the source code and check the behavior, join mode and reflow mode seem to try to fit text to the screen size independent of view mode.
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 am sorry for very late the answer.

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.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing