[elinks-dev] elinks 0.13-20080905 internal error with a certian HTML file.

Kalle Olavi Niemitalo kon at iki.fi
Mon Sep 8 15:10:49 PDT 2008


أحمد المحمودي <aelmahmoudy at users.sourceforge.net> writes:

> Unfortunately I cannot find any *core* files after elinks crashes !

You may be able to change that with ulimit -c in bash.
However, for easily reproduceable crashes, I find it easier
to run elinks within gdb, because that way there is no core
file that I'd have to delete later.

> Btw, I just tried another thing now: if I attempt to open the file using 
> elinks from a gnome-terminal (TERM=xterm), no crash happens !

Thank you.  That was the critical hint.

With commit 80a5c6d466af4bed62d4d0f57f7a8e596b2166b3,
I get this backtrace for the write that corrupts memory:

#0  0x080ac48b in set_hline at src/document/html/renderer.c:503
#1  0x080aba89 in put_chars at src/document/html/renderer.c:1673
#2  0x080da96d in convert_string_elinks at src/intl/charsets.c:1363
#3  0x080ab814 in put_chars_conv at src/document/html/renderer.c:1396
#4  0x080a568f in put_chrs at src/document/html/parser.c:155
#5  0x080bbbd6 in parse_html at src/document/html/parser/parse.c:779
#6  0x080aeaf6 in format_html_part at src/document/html/renderer.c:2244
#7  0x080b13a7 in format_cell at src/document/html/tables.c:91
#8  0x080b15d1 in draw_table_cell at src/document/html/tables.c:883
#9  0x080b1801 in draw_table_cells at src/document/html/tables.c:932
#10 0x080b2bd8 in format_table at src/document/html/tables.c:1334
#11 0x080b6cd8 in html_table at src/document/html/parser/general.c:664
#12 0x080bc4ce in start_element at src/document/html/parser/parse.c:986
#13 0x080bc891 in process_element at src/document/html/parser/parse.c:1156
#14 0x080bbccd in parse_html at src/document/html/parser/parse.c:792
#15 0x080aeaf6 in format_html_part at src/document/html/renderer.c:2244
#16 0x080b13a7 in format_cell at src/document/html/tables.c:91
#17 0x080b15d1 in draw_table_cell at src/document/html/tables.c:883
#18 0x080b1801 in draw_table_cells at src/document/html/tables.c:932
#19 0x080b2bd8 in format_table at src/document/html/tables.c:1334
#20 0x080b6cd8 in html_table at src/document/html/parser/general.c:664
#21 0x080bc4ce in start_element at src/document/html/parser/parse.c:986
#22 0x080bc891 in process_element at src/document/html/parser/parse.c:1156
#23 0x080bbccd in parse_html at src/document/html/parser/parse.c:792
#24 0x080aeaf6 in format_html_part at src/document/html/renderer.c:2244
#25 0x080b13a7 in format_cell at src/document/html/tables.c:91
#26 0x080b15d1 in draw_table_cell at src/document/html/tables.c:883
#27 0x080b1801 in draw_table_cells at src/document/html/tables.c:932
#28 0x080b2bd8 in format_table at src/document/html/tables.c:1334
#29 0x080b6cd8 in html_table at src/document/html/parser/general.c:664
#30 0x080bc4ce in start_element at src/document/html/parser/parse.c:986
#31 0x080bc891 in process_element at src/document/html/parser/parse.c:1156
#32 0x080bbccd in parse_html at src/document/html/parser/parse.c:792
#33 0x080aeaf6 in format_html_part at src/document/html/renderer.c:2244
#34 0x080af054 in render_html_document at src/document/html/renderer.c:2350
#35 0x0809a23f in render_encoded_document at src/document/renderer.c:266
#36 0x0809a4b4 in render_document at src/document/renderer.c:346
#37 0x0809aa66 in render_document_frames at src/document/renderer.c:475
#38 0x08150d9a in draw_formatted at src/viewer/text/draw.c:351
#39 0x08131263 in display_timer at src/session/session.c:454
#40 0x081354ed in loading_callback at src/session/task.c:538
#41 0x080e796a in notify_connection_callbacks at src/network/connection.c:458
#42 0x080e7a66 in done_connection at src/network/connection.c:475
#43 0x080e887c in abort_connection at src/network/connection.c:769
#44 0x0810bf8b in file_protocol_handler at src/protocol/file/file.c:315
#45 0x080e87b3 in run_connection at src/network/connection.c:753
#46 0x080e8d2a in try_connection at src/network/connection.c:823
#47 0x080e8be0 in check_queue at src/network/connection.c:857
#48 0x080e1f12 in check_bottom_halves at src/main/select.c:115
#49 0x080e25e2 in select_loop at src/main/select.c:290
#50 0x080e1924 in main at src/main/main.c:358

Line 503 of src/document/html/renderer.c is:
POS(document->comb_x, document->comb_y).data = prev;

Interesting values:
document->comb_x = 113;
document->comb_y = 83;
part->box = {x = 17, y = 9, width = 102, height = 85};
part->document->data[part->box.y + document->comb_y].length = 119;

Witekfl, how do we fix this?  I already tried the following patch
(thinking that perhaps document->box had been changed but comb_x
and comb_y had not) but it didn't help.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: absolute-comb_xy.patch
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20080909/1044e028/attachment.ksh>
-------------- next part --------------

> How do I use valgrind ?

Generally you can just run
  valgrind --log-file=/some/file elinks
and examine the log file afterwards.  If you want to examine the state
of ELinks as soon as an invalid pointer is used, you can instead do
  valgrind --db-attach=yes elinks
but then you may have to reset the terminal settings with e.g.
  stty sane < /dev/pts/6
From another terminal before you can answer valgrind's prompt.

Valgrind tends to report many errors in Guile and Python
libraries, so if you link ELinks with them, you should suppress
those errors so that you can focus on ELinks itself.  I set up
the following file for --suppressions=valgrind.suppressions:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: valgrind.suppressions
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20080909/1044e028/attachment-0001.ksh>
-------------- next part --------------

I haven't yet read the documentation on suppressions files, so
there probably are better ways of writing these suppressions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20080909/1044e028/attachment.sig>


More information about the elinks-dev mailing list