MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

ole
MAME Porter
Reged: 02/09/14
Posts: 19
Send PM
Re: mame 0152 running on ARM produces segmentation fault
02/16/14 03:28 AM


Hi,
Thanks for the tip. I did what you suggested and I got quite further. I had another issue with the build, but it seems it's resolved now.
Mame aborted on the following assertion:

FATALERROR: assert: src/emu/emualloc.c:269: entry != NULL

setting breakpoint on the assert and running gdb revealed this:

(gdb)
resource_pool::add (this=0xbefd70d0, item=...) at src/emu/emualloc.c:269
269 assert(entry != NULL);
(gdb) bt
#0 resource_pool::add (this=0xbefd70d0, item=...) at src/emu/emualloc.c:269
#1 0x002d4eca in resource_pool::add_array (this=0xbefd70d0, array=0x107eb50, count=256)
at src/emu/emualloc.h:266
#2 0x002d3b3c in render_font::load_cached (this=0x107d5d8, file=..., hash=0) at src/emu/rendfont.c:601
#3 0x002d241a in render_font::render_font (this=0x107d5d8, manager=..., filename=0x4ec86c "ui.bdf")
at src/emu/rendfont.c:116
#4 0x002cdafa in render_manager::font_alloc (this=0x8fe7f8, filename=0x8eed40 "default")
at src/emu/render.c:2583
#5 0x00301396 in ui_get_font (machine=...) at src/emu/ui.c:476
#6 0x003013c6 in ui_get_line_height (machine=...) at src/emu/ui.c:488
#7 0x00301d80 in ui_draw_text_box (container=0x40370008, text=0x884a08 "Initializing...", justify=0, xpos=0.5,
ypos=0.5, backcolor=4010807344) at src/emu/ui.c:788
#8 0x00303090 in handler_messagebox (machine=..., container=0x40370008, state=0) at src/emu/ui.c:1218
#9 0x003011a8 in ui_update_and_render (machine=..., container=0x40370008) at src/emu/ui.c:439
#10 0x00321ebc in video_manager::frame_update (this=0x9006b8, debug=false) at src/emu/video.c:212
#11 0x00301076 in ui_set_startup_text (machine=..., text=0x4e504c "Initializing...", force=1)
at src/emu/ui.c:406
#12 0x0028c834 in running_machine::start (this=0xbefd70d0) at src/emu/machine.c:310
#13 0x0028ce3c in running_machine::run (this=0xbefd70d0, firstrun=true) at src/emu/machine.c:384
#14 0x0028b060 in mame_execute (options=..., osd=...) at src/emu/mame.c:202


That looked quite promising. The ui_draw_text_box tries to render "Initializing...". To do that it needs to load the "default" font and eventually fails
to use embedded font. I had a look at the resource_pool::add() and the memory_entry::find() and found out that all memory pointers (entry->m_base) in the
memory pool are aligned to 8 bytes. In resource_pool::add() there is a "safety" search to the "address - 4" if the first search fails. As the addresses
on my system are aligned to 8 bytes I changed the safety search to "address - 8" and then it all started to work. I could see the mini_osd_interface::update()
started ticking regularly and width and height of the screen was set to 256.
So far it seems the "safety find" was required only once (in the glyph allocation), the rest of the find()'s were spot on. This is not a proper fix though, as
the magic number 8 has to have some reasonable explanation (which I don't have). Or at least the size should be detected in runtime. Thanks again.

Ole







Entire thread
Subject Posted by Posted on
* mame 0152 running on ARM produces segmentation fault ole 02/09/14 11:33 PM
. * Re: mame 0152 running on ARM produces segmentation fault MooglyGuy  02/12/14 10:34 AM
. * Re: mame 0152 running on ARM produces segmentation fault ole  02/16/14 03:56 AM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  02/12/14 05:51 PM
. * Re: mame 0152 running on ARM produces segmentation fault sz72  02/11/14 10:58 PM
. * Re: mame 0152 running on ARM produces segmentation fault ole  02/16/14 03:28 AM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  02/18/14 05:47 PM
. * Re: mame 0152 running on ARM produces segmentation fault AnonymousDeveloper  02/20/14 04:55 AM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  03/11/14 06:09 PM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  02/20/14 06:20 PM
. * Re: mame 0152 running on ARM produces segmentation fault ole  02/19/14 12:51 AM
. * Re: mame 0152 running on ARM produces segmentation fault not6  03/13/14 12:42 AM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  02/12/14 05:52 PM
. * Re: mame 0152 running on ARM produces segmentation fault R. Belmont  02/10/14 08:16 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 2 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 6587