Hi,
sent this to John-Mark Bell, who advised me to send it to the list...
i'm not subscribed though, so maybe i'll need to.
In any case, i'm willing to test diffs/svn trunk of libcss/netsurf to
ensure netsurf works on OpenBSD/sparc64. In the meantime i've already
imported netsurf's port to our portstree, see
http://marc.info/?l=openbsd-ports-cvs&m=127784283903476&w=2.
Local patches are very minimal, i can explain them if needed.
Thanks,
Landry
----- Forwarded message from Landry Breuil <landry(a)rhaalovely.net> -----
Date: Tue, 29 Jun 2010 21:21:09 +0200
From: Landry Breuil <landry(a)rhaalovely.net>
To: jmb(a)netsurf-browser.org
Subject: netsurf on OpenBSD/sparc64
User-Agent: Mutt/1.5.20 (2009-06-14)
Message-ID: <20100629192109.GA6153(a)dawn.rhaalovely.net>
Hi,
i'm an openbsd developer, and made a port of netsurf (and its depending
libs) for OpenBSD. Everything works fine, it's pretty cool and well
done.. tested on amd64/i386/powerpc, ok. But on sparc64, it really badly
crashes in libcss (SIGBUS). Basically, the 'bytecode' handling in libcss only
does unaligned memory accesses, ie accessing memory at the middle of a
word - on sparc64 a pointer should end up in 0/8, here it accesses
memory at pointers finishing by 4/C too. i'd say the guilty function is
advance_bytecode which does weird pointer arithmetics, but there are
lots of occurences of weird cast usages. And using uint32_t to walk
arrays of bytes when a pointer is 64 bits will only lead to issues.
I'm not a C expert, but i've fixed quite some programs doing SIGBUS'es on
sparc64, and that kind of construct seems highly non-valid to me - they
only arise on sparc64 because it's a strict alignment architecture.
lwc_string **p = (void *) ((uint8_t *) s->style->bytecode + i);
Would you consider helping me in trying to run netsurf there ? Should i
write to the dev mailing list instead ?
TIA,
Landry
Ps:i attach gdb traces/crashes of netsurf and libcss regress test..
(gdb) r
http://google.fr
Starting program: /usr/local/bin/netsurf
http://google.fr
Program received signal SIGBUS, Bus error.
cascade_font_family (opv=33816612, style=0xffffffffffff03d0,
state=0xffffffffffff0550) at src/select/properties.c:2582
2582 font = *((lwc_string **)
(gdb) p style->bytecode
$2 = (void *) 0x4d2b5dd4
(gdb) bt
#0 cascade_font_family (opv=33816612, style=0xffffffffffff03d0,
state=0xffffffffffff0550) at src/select/properties.c:2582
#1 0x000000004dad9d58 in cascade_style (style=Variable "style" is not
available.
) at src/select/select.c:1184
#2 0x000000004dadb030 in css_select_style (ctx=0x49c11320,
node=Variable "node" is not available.
) at src/select/select.c:933
#3 0x0000000000139564 in nscss_get_style (html=0x465af050,
n=0x40725800, pseudo_element=0, media=64, inline_style=0x0,
alloc=0x187320 <myrealloc>, pw=0x465af050) at css/select.c:188
#4 0x0000000000188238 in box_construct_element (n=0x40725800,
content=0x465af050, parent_style=0x4d27e650, parent=0x4d27e050,
inline_container=0xffffffffffff0cf8, href=0x0, target=0x0,
title=0x0) at render/box_construct.c:855
#5 0x0000000000188910 in convert_xml_to_box (n=0x40725800,
content=0x465af050, parent_style=0x4d27e650, parent=0x4d27e050,
inline_container=0xffffffffffff0cf8, href=0x0, target=0x0,
title=0x0) at render/box_construct.c:246
#6 0x00000000001881ac in box_construct_element (n=0x44ee5000,
content=0x465af050, parent_style=0x0, parent=0xffffffffffff0eb8,
inline_container=0xffffffffffff1048, href=0x0, target=0x0,
title=0x0) at render/box_construct.c:552
#7 0x0000000000188910 in convert_xml_to_box (n=0x44ee5000,
content=0x465af050, parent_style=0x0, parent=0xffffffffffff0eb8,
inline_container=0xffffffffffff1048, href=0x0, target=0x0,
title=0x0) at render/box_construct.c:246
#8 0x0000000000188e68 in xml_to_box (n=0x44ee5000, c=0x465af050) at
render/box_construct.c:187
#9 0x000000000018fab0 in html_finish_conversion (c=0x465af050) at
render/html.c:535
#10 0x000000000018fe7c in html_convert_css_callback (css=Variable "css"
is not available.
) at render/html.c:1233
#11 0x0000000000126bb0 in hlcache_content_callback (c=0x465ae050,
msg=CONTENT_MSG_DONE, data=
{error = 0x11d4d8 "", redraw = {x = 0, y = 1.63755739e-39, width =
0, height = 0, full_redraw = false, object = 0x43b80a00, object_x =
-nan(0x7fffff), object_y = -nan(0x7f0f00), object_width = 0,
object_height = 4.58504858e-42}, delay = 0, download = 0x11d4d8},
pw=0x41c47b60) at content/hlcache.c:617
#12 0x000000000011fe6c in content_broadcast (c=0x465ae050,
msg=CONTENT_MSG_DONE, data=
{error = 0x11d4d8 "", redraw = {x = 0, y = 1.63755739e-39, width =
0, height = 0, full_redraw = false, object = 0x43b80a00, object_x =
-nan(0x7fffff), object_y = -nan(0x7f0f00), object_width = 0,
object_height = 4.58504858e-42}, delay = 0, download = 0x11d4d8})
at content/content.c:1020
#13 0x0000000000121464 in content_set_done (c=0x465ae050) at
content/content.c:701
#14 0x0000000000130ec4 in nscss_content_done (css=0x465ae088,
pw=0x465ae050) at css/css.c:235
#15 0x0000000000130bcc in nscss_import (handle=0x49c104a0,
event=Variable "event" is not available.
) at css/css.c:517
#16 0x0000000000126bb0 in hlcache_content_callback (c=0x43b80850,
msg=CONTENT_MSG_DONE, data=
{error = 0x0, redraw = {x = 0, y = 0, width = 0, height = 0,
full_redraw = false, object = 0x0, object_x = 0, object_y = 0,
object_width = 0, object_height = 0}, delay = 0, download = 0x0},
pw=0x49c104a0) at content/hlcache.c:617
#17 0x000000000011fe6c in content_broadcast (c=0x43b80850,
msg=CONTENT_MSG_DONE, data=
{error = 0x0, redraw = {x = 0, y = 0, width = 0, height = 0,
full_redraw = false, object = 0x0, object_x = 0, object_y = 0,
object_width = 0, object_height = 0}, delay = 0, download = 0x0}) at
content/content.c:1020
#18 0x0000000000121464 in content_set_done (c=0x43b80850) at
content/content.c:701
#19 0x00000000001217a8 in content_llcache_callback (llcache=Variable
"llcache" is not available.
) at content/content.c:673
#20 0x00000000001280ac in llcache_object_notify_users
(object=0x465ac000) at content/llcache.c:1305
#21 0x0000000000129608 in llcache_poll () at content/llcache.c:238
#22 0x00000000001273ac in hlcache_poll () at content/hlcache.c:93
#23 0x000000000014315c in netsurf_main_loop () at desktop/netsurf.c:170
#24 0x0000000000160c1c in main (argc=2, argv=0xffffffffffff34f8) at
gtk/gtk_gui.c:412
(gdb) r ../test/data/Aliases ../test/data/parse/tests1.dat
Starting program:
/usr/ports/pobj/libcss-0.0.1/libcss-0.0.1/build-OpenBSD-OpenBSD-release-lib-shared/test_parse-auto
../test/data/Aliases ../test/data/parse/tests1.dat
Test 1: PASS
Test 2: PASS
Test 3: PASS
Test 4: PASS
Test 5: PASS
Program received signal SIGBUS, Bus error.
0x0000000000102684 in run_test (data=Variable "data" is not available.
) at test/parse-auto.c:489
489 if (lwc_string_length(*p) !=
----- End forwarded message -----