What's new

My first bug report

russofris

New member
This has been resolved via the following fix:

Uncomment "delay = 0;" in file memory.c on line 2424 as suggested by Hacktarux in thread http://www.emutalk.net/showthread.php?threadid=17373 .



Game: Zelda Majora's Mask
Error: Segfault
Occurs: In intro (see attached screenshot)
Plugins: glN64 0.4.1 rc3 -- Mupen ALSA2 ver .4 -- blight's SDL ver 0.0.8-b
Core:Interpretor
GCC3.3.2r3
CFlags:-DX86 -O3 -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=athlon-xp -Wall -pipe -g
GDB output:
Code:
[New Thread 2539676 (LWP 8341)]
rom size: 33554432 bytes (or 32 Mb or 256 Megabits)
file found
rom size: 33554432 bytes (or 32 Mb or 256 Megabits)
rom loaded succesfully
80 37 12 40
ClockRate=f
Version:144b
CRC: 5354631c 3a2def0
name: ZELDA MAJORA'S MASK
Manufacturer: Nintendo
Cartridge_ID: 535a
Country : United States
size: 4096
PC= 80080000
md5 code:2A0A8ACB61538235BC1094D297FB6556
init timer!
[New Thread 2556061 (LWP 8342)]
memory initialized
[blight's SDL input plugin]: version 0.0.8-b initialized.
[glN64]: (II) Initializing SDL video subsystem...
[glN64]: (II) Getting video info...
[glN64]: (II) Setting video mode 1024x768...
[glN64]: (II) Renderer:       GeForce FX 5600/AGP/SSE/3DNOW!
[glN64]: (II) OpenGL version: 1.4.0 NVIDIA 44.96
[glN64]: (II) Vendor:         NVIDIA Corporation
[glN64]: (II) Extensions:     GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_imaging GL_ARB_multisample GL_ARB_multitexture GL_ARB_point_parameters GL_ARB_shadow GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_window_pos GL_S3_s3tc GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_shared_texture_palette GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_vertex_array GL_HP_occlusion_test GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NVX_ycrcb GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow
demarrage r4300
interpr�tation
[New Thread 2572446 (LWP 8346)]
[New Thread 2588831 (LWP 8347)]
[New Thread 2605216 (LWP 8348)]
[New Thread 2621601 (LWP 8349)]
[New Thread 2637986 (LWP 8350)]
[New Thread 2654371 (LWP 8351)]
[New Thread 2670756 (LWP 8352)]
[New Thread 2687141 (LWP 8353)]
[New Thread 2703526 (LWP 8354)]
[New Thread 2719911 (LWP 8355)]
[New Thread 2736296 (LWP 8356)]
[New Thread 2752681 (LWP 8357)]
[New Thread 2769066 (LWP 8358)]
[New Thread 2785451 (LWP 8359)]
[New Thread 2801836 (LWP 8360)]
[New Thread 2818221 (LWP 8361)]
[New Thread 2834606 (LWP 8362)]
[New Thread 2850991 (LWP 8363)]
[New Thread 2867376 (LWP 8364)]
[New Thread 2883761 (LWP 8365)]
[New Thread 2900146 (LWP 8366)]
[New Thread 2916531 (LWP 8367)]
[New Thread 2932916 (LWP 8368)]
[New Thread 2949301 (LWP 8369)]
[New Thread 2965686 (LWP 8370)]
[New Thread 2982071 (LWP 8371)]
[New Thread 2998456 (LWP 8372)]
[New Thread 3014841 (LWP 8373)]
[New Thread 3031226 (LWP 8374)]
[New Thread 3047611 (LWP 8375)]
[New Thread 3063996 (LWP 8376)]
[New Thread 3080381 (LWP 8377)]
[New Thread 3096766 (LWP 8378)]
[New Thread 3113151 (LWP 8379)]
[New Thread 3129536 (LWP 8380)]
[New Thread 3145921 (LWP 8381)]
[New Thread 3162306 (LWP 8382)]
[New Thread 3178691 (LWP 8383)]
[New Thread 3195076 (LWP 8384)]
[New Thread 3211461 (LWP 8385)]
[New Thread 3227846 (LWP 8386)]
[New Thread 3244231 (LWP 8387)]
[New Thread 3260616 (LWP 8388)]
[New Thread 3277001 (LWP 8389)]
[New Thread 3293386 (LWP 8390)]
[New Thread 3309771 (LWP 8391)]
[New Thread 3326156 (LWP 8392)]
[New Thread 3342541 (LWP 8393)]
[New Thread 3358926 (LWP 8394)]
[New Thread 3375311 (LWP 8395)]
[New Thread 3391696 (LWP 8396)]
[New Thread 3408081 (LWP 8397)]
[New Thread 3424466 (LWP 8398)]
[New Thread 3440851 (LWP 8399)]
[New Thread 3457236 (LWP 8400)]
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2556061 (LWP 8342)]
0x0805747f in SWL () at r4300/r4300.c:874
874             word = ((unsigned long)lsrt >> 8) | (old_word & 0xFF000000);
(gdb) where
#0  0x0805747f in SWL () at r4300/r4300.c:874
#1  0x00000000 in ?? ()
Cannot access memory at address 0x1115
(gdb) disassemble 0x0805747f
Dump of assembler code for function SWL:
0x8057330 <SWL>:        push   %ebp
0x8057331 <SWL+1>:      push   %edi
0x8057332 <SWL+2>:      push   %esi
0x8057333 <SWL+3>:      push   %ebx
0x8057334 <SWL+4>:      sub    $0xc,%esp
0x8057337 <SWL+7>:      mov    0x87ed780,%esi
0x805733d <SWL+13>:     movl   $0x0,(%esp,1)
0x8057344 <SWL+20>:     movl   $0x0,0x4(%esp,1)
0x805734c <SWL+28>:     add    $0x1c,%esi
0x805734f <SWL+31>:     movzwl 0xfffffff0(%esi),%ebp
0x8057353 <SWL+35>:     mov    0xffffffe8(%esi),%edi
0x8057356 <SWL+38>:     mov    %esi,0x87ed780
0x805735c <SWL+44>:     movswl %bp,%edx
0x805735f <SWL+47>:     add    (%edi),%edx
0x8057361 <SWL+49>:     xor    %ebx,%ebx
0x8057363 <SWL+51>:     mov    %edx,%ecx
0x8057365 <SWL+53>:     and    $0x3,%ecx
0x8057368 <SWL+56>:     mov    %ecx,%edx
0x805736a <SWL+58>:     xor    $0x1,%edx
0x805736d <SWL+61>:     or     %ebx,%edx
0x805736f <SWL+63>:     je     0x8057455 <SWL+293>
0x8057375 <SWL+69>:     test   %ebx,%ebx
---Type <return> to continue, or q <return> to quit---
0x8057377 <SWL+71>:     jle    0x8057421 <SWL+241>
0x805737d <SWL+77>:     mov    %ecx,%edi
0x805737f <SWL+79>:     xor    $0x2,%edi
0x8057382 <SWL+82>:     or     %ebx,%edi
0x8057384 <SWL+84>:     je     0x80573d5 <SWL+165>
0x8057386 <SWL+86>:     mov    %ecx,%ebp
0x8057388 <SWL+88>:     xor    $0x3,%ebp
0x805738b <SWL+91>:     or     %ebx,%ebp
0x805738d <SWL+93>:     je     0x8057398 <SWL+104>
0x805738f <SWL+95>:     nop
0x8057390 <SWL+96>:     add    $0xc,%esp
0x8057393 <SWL+99>:     pop    %ebx
0x8057394 <SWL+100>:    pop    %esi
0x8057395 <SWL+101>:    pop    %edi
0x8057396 <SWL+102>:    pop    %ebp
0x8057397 <SWL+103>:    ret
0x8057398 <SWL+104>:    mov    0xffffffe8(%esi),%ecx
0x805739b <SWL+107>:    mov    0xffffffec(%esi),%edx
0x805739e <SWL+110>:    movswl 0xfffffff0(%esi),%edi
0x80573a2 <SWL+114>:    add    (%ecx),%edi
0x80573a4 <SWL+116>:    mov    0x4(%edx),%ebp
0x80573a7 <SWL+119>:    mov    (%edx),%ebx
0x80573a9 <SWL+121>:    mov    %edi,0x80e2320
---Type <return> to continue, or q <return> to quit---
0x80573af <SWL+127>:    shrd   $0x18,%ebp,%ebx
0x80573b3 <SWL+131>:    shr    $0x10,%edi
0x80573b6 <SWL+134>:    mov    %bl,0x922fae0
0x80573bc <SWL+140>:    call   *0x912e9a0(,%edi,4)
0x80573c3 <SWL+147>:    mov    0x80e2320,%esi
0x80573c9 <SWL+153>:    shr    $0xc,%esi
0x80573cc <SWL+156>:    movb   $0x1,0x87ed8e0(%esi)
0x80573d3 <SWL+163>:    jmp    0x8057390 <SWL+96>
0x80573d5 <SWL+165>:    mov    0xffffffe8(%esi),%ecx
0x80573d8 <SWL+168>:    movswl 0xfffffff0(%esi),%ebx
0x80573dc <SWL+172>:    mov    %esp,0x90ed934
0x80573e2 <SWL+178>:    add    (%ecx),%ebx
0x80573e4 <SWL+180>:    and    $0xfffffffc,%ebx
0x80573e7 <SWL+183>:    mov    %ebx,0x80e2320
0x80573ed <SWL+189>:    shr    $0x10,%ebx
0x80573f0 <SWL+192>:    call   *0x91afa40(,%ebx,4)
0x80573f7 <SWL+199>:    mov    0x87ed780,%ebp
0x80573fd <SWL+205>:    mov    (%esp,1),%edx
0x8057400 <SWL+208>:    xor    %dx,%dx
0x8057403 <SWL+211>:    mov    0xffffffec(%ebp),%edi
0x8057406 <SWL+214>:    movzwl 0x2(%edi),%eax
0x805740a <SWL+218>:    or     %edx,%eax
0x805740c <SWL+220>:    mov    %eax,0x9aefb88
---Type <return> to continue, or q <return> to quit---
0x8057411 <SWL+225>:    movzwl 0x80e2322,%eax
0x8057418 <SWL+232>:    call   *0x926fb40(,%eax,4)
0x805741f <SWL+239>:    jmp    0x80573c3 <SWL+147>
0x8057421 <SWL+241>:    test   %ebx,%ebx
0x8057423 <SWL+243>:    js     0x805742e <SWL+254>
0x8057425 <SWL+245>:    cmp    $0x1,%ecx
0x8057428 <SWL+248>:    ja     0x805737d <SWL+77>
0x805742e <SWL+254>:    mov    %ebx,%edx
0x8057430 <SWL+256>:    or     %ecx,%edx
0x8057432 <SWL+258>:    jne    0x8057390 <SWL+96>
0x8057438 <SWL+264>:    mov    0xffffffec(%esi),%ebx
0x805743b <SWL+267>:    movswl %bp,%eax
0x805743e <SWL+270>:    add    (%edi),%eax
0x8057440 <SWL+272>:    mov    (%ebx),%ecx
0x8057442 <SWL+274>:    and    $0xfffffffc,%eax
0x8057445 <SWL+277>:    mov    %eax,0x80e2320
0x805744a <SWL+282>:    shr    $0x10,%eax
0x805744d <SWL+285>:    mov    %ecx,0x9aefb88
0x8057453 <SWL+291>:    jmp    0x8057418 <SWL+232>
0x8057455 <SWL+293>:    movswl %bp,%ecx
0x8057458 <SWL+296>:    mov    %esp,0x90ed934
0x805745e <SWL+302>:    add    (%edi),%ecx
0x8057460 <SWL+304>:    and    $0xfffffffc,%ecx
---Type <return> to continue, or q <return> to quit---
0x8057463 <SWL+307>:    mov    %ecx,0x80e2320
0x8057469 <SWL+313>:    shr    $0x10,%ecx
0x805746c <SWL+316>:    call   *0x91afa40(,%ecx,4)
0x8057473 <SWL+323>:    mov    0x87ed780,%edx
0x8057479 <SWL+329>:    mov    0xffffffec(%edx),%esi
0x805747c <SWL+332>:    mov    (%esp,1),%edx
0x805747f <SWL+335>:    mov    (%esi),%eax
0x8057481 <SWL+337>:    and    $0xff000000,%edx
0x8057487 <SWL+343>:    shr    $0x8,%eax
0x805748a <SWL+346>:    jmp    0x805740a <SWL+218>
End of assembler dump.
(gdb)

Screenshot: Attached
Other: This error only occurs when using the SDL input plugin. When the basic keyboard plugin is used, all is well. If I use the pure core, the grafx freeze at the same point, but the audio continues and I am able to exit gracefully.

Thank you for your time,
Frank Russo
 
Last edited:

blight

New member
your version of zelda is not possibly a bad dump? because i find it very weird that my plugin causes it to crash in some SWL (shift word left?)
 

Zilla

&#22818;&#12434;&#35211;&#12425;&#12428;&#12383;
Does Mupen do any MD5/SHA1 hash checking of ROMS? My copy of MM doesn't crash at all, at least until the first dungeon boss is beaten.... =]
 
Last edited:

blight

New member
yes it does check MD5 or CRC and asks if you want to load the rom because it is a hack or bad dump and might give unexpected results
 
OP
R

russofris

New member
blight said:
your version of zelda is not possibly a bad dump? because i find it very weird that my plugin causes it to crash in some SWL (shift word left?)

The "Bad Dump" dialog does not appear when I open this game (it does for a few others). THe CRC on the game is "CRC: 5354631c 3a2def0", which you may wish to compare with your copy. Rumor is that there are two versions of this game (a 20fps and a 17fps?).

I will recompile all of my plugins with the -g flag to see if the results change. I have also compared the SWL implementation in Mupen with other emulators, and they all look about the same.


FROM 1964 ver 2002/09/22
(C) 1999-2002 Joel Middendorf, <[email protected]>

Code:
void r4300i_swl(uint32 Instruction)

{

	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

	uint32			LoadWord1 = 0;

	uint32			rt_ft = RT_FT;

	uint32			vAddr;

	STORE_TLB_FUN	vAddr = QuerAddr & 0xfffffffc;

	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/



	LoadWord1 = MEM_READ_UWORD(vAddr);

	switch(QuerAddr & 3)

	{

	case 0: LoadWord1 = (uint32) gHWS_GPR[rt_ft]; break;

	case 1: LoadWord1 = (uint32) (LoadWord1 & 0xff000000) | ((uint32) gHWS_GPR[rt_ft] >> 8); break;

	case 2: LoadWord1 = (uint32) (LoadWord1 & 0xffff0000) | ((uint32) gHWS_GPR[rt_ft] >> 16); break;

	case 3: LoadWord1 = (uint32) (LoadWord1 & 0xffffff00) | ((uint32) gHWS_GPR[rt_ft] >> 24); break;

	}

	{

		/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

		/*

		 * a little stupid, do I have to do such things? or can I take chances by just

		 * using £

		 * (PMEM_WRITE_UWORD(vAddr, rt_ft)) = LoadWord1; £

		 * first of all, I hope SWL/SWR/SDL/SDR opcode are not used so much, so speed is

		 * not a problem here

		 */

		uint32	temp = (uint32) gHWS_GPR[rt_ft];

		/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/



		*(uint32 *) &gHWS_GPR[rt_ft] = LoadWord1;

		*(PMEM_WRITE_UWORD(vAddr)) = LoadWord1;

		*(uint32 *) &gHWS_GPR[rt_ft] = temp;

	}

}

From Mupen

Code:
void SWL()
{
   unsigned long long int old_word = 0;
   PC++;
   switch ((lsaddr) & 3)
     {
      case 0:
	address = (lsaddr) & 0xFFFFFFFC;
	word = (unsigned long)lsrt;
	write_word_in_memory();
	invalid_code[address>>12] = 1;
	break;
      case 1:
	address = (lsaddr) & 0xFFFFFFFC;
	rdword = &old_word;
	read_word_in_memory();
	word = ((unsigned long)lsrt >> 8) | (old_word & 0xFF000000);
	write_word_in_memory();
	invalid_code[address>>12] = 1;
	break;
      case 2:
	address = (lsaddr) & 0xFFFFFFFC;
	rdword = &old_word;
	read_word_in_memory();
	word = ((unsigned long)lsrt >> 16) | (old_word & 0xFFFF0000);
	write_word_in_memory();
	invalid_code[address>>12] = 1;
	break;
      case 3:
	address = lsaddr;
	byte = (unsigned char)(lsrt >> 24);
	write_byte_in_memory();
	invalid_code[address>>12] = 1;
	break;
     }
}

Thank you for your time,
Frank Russo
 

Top