Maruno17 / pokemon-essentials

A heavily modified RPG Maker XP game project that makes the game play like a Pokémon game. Not a full project in itself; this repo is to be added into an existing RMXP game project.
Other
199 stars 390 forks source link

Doesn't work under MKXP-Z (Part 1) #87

Closed Fuyukai closed 3 years ago

Fuyukai commented 3 years ago

Segfault when attempting to read the save game directory. I replaced it in my local copy with a ./Saves directory.

$ ./mkxp-z_essentials_debug.exe
RGSS version 1 (RPG Maker XP)
ALC_SOFT_pause_device present
GL Vendor    : NVIDIA Corporation
GL Renderer  : GeForce GTX 1050 Ti/PCIe/SSE2
GL Version   : 4.6.0 NVIDIA 456.71
GLSL Version : 4.60 NVIDIA
Warning: No soundfont specified, sound might be mute
Warning: No soundfont specified, sound might be mute
001_PSystem_Controls.rb:14: warning: already initialized constant Input::DOWN
001_PSystem_Controls.rb:15: warning: already initialized constant Input::LEFT
001_PSystem_Controls.rb:16: warning: already initialized constant Input::RIGHT
001_PSystem_Controls.rb:17: warning: already initialized constant Input::UP
001_PSystem_Controls.rb:19: warning: already initialized constant Input::A
001_PSystem_Controls.rb:20: warning: already initialized constant Input::B
001_PSystem_Controls.rb:21: warning: already initialized constant Input::C
001_PSystem_Controls.rb:22: warning: already initialized constant Input::X
001_PSystem_Controls.rb:23: warning: already initialized constant Input::Y
001_PSystem_Controls.rb:24: warning: already initialized constant Input::Z
001_PSystem_Controls.rb:25: warning: already initialized constant Input::L
001_PSystem_Controls.rb:26: warning: already initialized constant Input::R
001_PSystem_Controls.rb:29: warning: already initialized constant Input::SHIFT
001_PSystem_Controls.rb:30: warning: already initialized constant Input::CTRL
001_PSystem_Controls.rb:31: warning: already initialized constant Input::ALT
001_PSystem_Controls.rb:36: warning: already initialized constant Input::F5
001_PSystem_Controls.rb:38: warning: already initialized constant Input::F6
001_PSystem_Controls.rb:39: warning: already initialized constant Input::F7
001_PSystem_Controls.rb:40: warning: already initialized constant Input::F8
001_PSystem_Controls.rb:41: warning: already initialized constant Input::F9
001_FileTests.rb:92: [BUG] Segmentation fault
ruby 3.0.0p0 (2020-12-25 revision d14ca933c2) [x64-mingw32]

-- Control frame information -----------------------------------------------
c:0023 p:---- s:0122 e:000121 CFUNC  :call
c:0022 p:0038 s:0115 e:000114 BLOCK  001_FileTests.rb:92 [FINISH]
c:0021 p:---- s:0111 e:000110 CFUNC  :loop
c:0020 p:0065 s:0107 e:000106 METHOD 001_FileTests.rb:88
c:0019 p:0103 s:0098 e:000097 METHOD 001_FileTests.rb:154
c:0018 p:0015 s:0088 e:000087 METHOD 001_FileTests.rb:307
c:0017 p:0003 s:0081 e:000080 METHOD 001_FileTests.rb:298
c:0016 p:0038 s:0076 e:000074 METHOD 002_PSystem_System.rb:27
c:0015 p:0015 s:0066 e:000065 METHOD 999_Main.rb:53
c:0014 p:0015 s:0062 e:000061 METHOD 999_Main.rb:45
c:0013 p:0004 s:0058 e:000057 BLOCK  999_Main.rb:73 [FINISH]
c:0012 p:---- s:0054 e:000053 CFUNC  :loop
c:0011 p:0028 s:0050 e:000049 EVAL   999_Main.rb:72 [FINISH]
c:0010 p:---- s:0047 e:000046 CFUNC  :eval
c:0009 p:0036 s:0040 e:000039 BLOCK  000:Main:31 [FINISH]
c:0008 p:---- s:0035 e:000034 CFUNC  :each
c:0007 p:0034 s:0031 e:000030 METHOD 000:Main:28
c:0006 p:0014 s:0024 e:000023 BLOCK  000:Main:41 [FINISH]
c:0005 p:---- s:0020 e:000019 CFUNC  :each
c:0004 p:0046 s:0016 e:000015 METHOD 000:Main:40
c:0003 p:0014 s:0009 e:000008 EVAL   000:Main:45 [FINISH]
c:0002 p:---- s:0006 e:000005 CFUNC  :eval
c:0001 p:0000 s:0003 E:001770 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
ruby:0:in `eval'
000:Main:45:in `<main>'
000:Main:40:in `load_scripts_from_folder'
000:Main:40:in `each'
000:Main:41:in `block in load_scripts_from_folder'
000:Main:28:in `load_scripts_from_folder'
000:Main:28:in `each'
000:Main:31:in `block in load_scripts_from_folder'
000:Main:31:in `eval'
999_Main.rb:72:in `block in load_scripts_from_folder'
999_Main.rb:72:in `loop'
999_Main.rb:73:in `block (2 levels) in load_scripts_from_folder'
999_Main.rb:45:in `mainFunction'
999_Main.rb:53:in `mainFunctionDebug'
002_PSystem_System.rb:27:in `pbSetUpSystem'
001_FileTests.rb:298:in `getSaveFileName'
001_FileTests.rb:307:in `getSaveFolder'
001_FileTests.rb:154:in `getKnownFolder'
001_FileTests.rb:88:in `getUnicodeString'
001_FileTests.rb:88:in `loop'
001_FileTests.rb:92:in `block in getUnicodeString'
001_FileTests.rb:92:in `call'

-- C level backtrace information -------------------------------------------
C:\WINDOWS\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0x17) [0x00007fff2cc2c037]
C:\WINDOWS\System32\KERNELBASE.dll(WaitForSingleObjectEx+0x8e) [0x00007fff2a84a34e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_print_backtrace+0x50) [0x0000000063bb543e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_bugreport+0x8f) [0x0000000063bb54d4]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_bug_for_fatal_signal+0x85) [0x00000000639c44d3]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_get_next_signal+0x135) [0x0000000063b10433]
C:\WINDOWS\System32\msvcrt.dll(XcptFilter+0x19a) [0x00007fff2c797f0a]
C:\WINDOWS\System32\msvcrt.dll(memset+0xc58) [0x00007fff2c7e52d8]
C:\WINDOWS\System32\msvcrt.dll(_C_specific_handler+0x98) [0x00007fff2c797ff8]
C:\WINDOWS\SYSTEM32\ntdll.dll(_chkstk+0x11f) [0x00007fff2cc3130f]
C:\WINDOWS\SYSTEM32\ntdll.dll(RtlRaiseException+0x434) [0x00007fff2cbdb5e4]
C:\WINDOWS\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x00007fff2cc2fe3e]
C:\WINDOWS\SYSTEM32\ntdll.dll(RtlCopyMemory+0x63) [0x00007fff2cc32de3]
 [0x0000000000d5ab39]
 [0x0000000000d5a0f0]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x211e) [0x0000000063b8acbb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3891) [0x0000000063b96670]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x398) [0x0000000063ba76f6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x8ec) [0x0000000063ba7c4a]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0xb39) [0x0000000063ba7e97]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_send+0xcc) [0x0000000063ba2fdb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_block+0x7f) [0x0000000063ba330b]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vrescue2+0x13a) [0x00000000639ce6bb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_rescue2+0x47) [0x00000000639ce573]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_block+0x153) [0x0000000063ba33df]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x214d) [0x0000000063b8acea]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x303f) [0x0000000063b8bbdc]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x11f4) [0x0000000063b8d470]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x169c) [0x0000000063b8d918]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x16f2) [0x0000000063b8d96e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3734) [0x0000000063b96513]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x398) [0x0000000063ba76f6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x8ec) [0x0000000063ba7c4a]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0xb39) [0x0000000063ba7e97]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_send+0xcc) [0x0000000063ba2fdb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_block+0x7f) [0x0000000063ba330b]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vrescue2+0x13a) [0x00000000639ce6bb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_rescue2+0x47) [0x00000000639ce573]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_block+0x153) [0x0000000063ba33df]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x214d) [0x0000000063b8acea]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x303f) [0x0000000063b8bbdc]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x11f4) [0x0000000063b8d470]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x169c) [0x0000000063b8d918]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x16f2) [0x0000000063b8d96e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3734) [0x0000000063b96513]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_each+0x33e) [0x0000000063ba3ca6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_eval+0xdc) [0x0000000063ba3e6c]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x211e) [0x0000000063b8acbb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3891) [0x0000000063b96670]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x398) [0x0000000063ba76f6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x8ec) [0x0000000063ba7c4a]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0xb39) [0x0000000063ba7e97]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_send+0xcc) [0x0000000063ba2fdb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_1+0x1a) [0x0000000063ba2ffb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield+0x2d) [0x0000000063ba302e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_ary_each+0x67) [0x0000000063947496]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x214d) [0x0000000063b8acea]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3734) [0x0000000063b96513]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x398) [0x0000000063ba76f6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0x8ec) [0x0000000063ba7c4a]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_binding_add_dynavars+0xb39) [0x0000000063ba7e97]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_send+0xcc) [0x0000000063ba2fdb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield_1+0x1a) [0x0000000063ba2ffb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_yield+0x2d) [0x0000000063ba302e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_ary_each+0x67) [0x0000000063947496]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x214d) [0x0000000063b8acea]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x2e9b) [0x0000000063b8ba38]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_find_defined_class_by_owner+0x38c7) [0x0000000063b8fb43]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_lvar_exposed+0x3734) [0x0000000063b96513]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_exec+0x13a) [0x0000000063baa855]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_each+0x33e) [0x0000000063ba3ca6]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_f_eval+0xdc) [0x0000000063ba3e6c]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_splat_or_kwargs_p+0x211e) [0x0000000063b8acbb]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_call0+0x345) [0x0000000063ba0a2e]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_call0+0x454) [0x0000000063ba0b3d]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_call0+0x5e6) [0x0000000063ba0ccf]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_call0+0xe4) [0x0000000063ba07cd]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_vm_call_kw+0x4f) [0x0000000063ba11ca]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_current_receiver+0x1df) [0x0000000063ba1562]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_type_str+0x43a) [0x0000000063ba216b]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_funcallv+0x3d) [0x0000000063ba2868]
 [0x0000000000d3b7b9]
C:\Users\L\Documents\PokemonHack\x64-msvcrt-ruby300.dll(rb_protect+0x1c4) [0x00000000639cea40]
 [0x0000000000d3e4cd]
 [0x0000000000cce41e]
C:\Users\L\Documents\PokemonHack\mkxp-z_essentials_debug.exe(SDL_DYNAPI_entry+0x42ac2) [0x000000000103dace]
C:\Users\L\Documents\PokemonHack\mkxp-z_essentials_debug.exe(SDL_DYNAPI_entry+0x15ec87) [0x0000000001159c93]
C:\Users\L\Documents\PokemonHack\mkxp-z_essentials_debug.exe(SDL_DYNAPI_entry+0x15ecd4) [0x0000000001159ce0]
C:\WINDOWS\System32\msvcrt.dll(beginthreadex+0x12a) [0x00007fff2c7aaf5a]
C:\WINDOWS\System32\msvcrt.dll(endthreadex+0xac) [0x00007fff2c7ab02c]
C:\WINDOWS\System32\KERNEL32.DLL(BaseThreadInitThunk+0x14) [0x00007fff2c6c7034]

-- Other runtime information -----------------------------------------------

* Loaded script: ruby

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 ruby2_keywords.rb
    5 zlib.so
jonisavo commented 3 years ago

I'm fairly certain getUnicodeString relies on a 32-bit Win32API call, which fails because the latest mxkp-z is a 64-bit binary. However, that's not the root problem here. Methods like getUnicodeString and getKnownFolder will be unnecessary in the future, since we are planning on dropping support for vanilla RGSS completely. That means we can just use mkxp-z's System.data_directory for save files. I am currently working on this.

Maruno17 commented 3 years ago

Firstly, specify which branch you're using. Secondly, it looks like you may be using a different version of mkxp-z to the one that actually comes with Essentials, so you shouldn't be reporting errors with it because it has nothing to do with Essentials.

Fuyukai commented 3 years ago

I'm using the dev branch.

I am currently working on this.

That's good to hear!

Secondly, it looks like you may be using a different version of mkxp-z to the one that actually comes with Essentials, so you shouldn't be reporting errors with it because it has nothing to do with Essentials.

Yes, I'm using the latest version of MKXP-Z (2.0). I don't see how it's not relevant unless you plan to be deliberately incompatible with the newest versions.

Maruno17 commented 3 years ago

Yes, I'm using the latest version of MKXP-Z (2.0). I don't see how it's not relevant unless you plan to be deliberately incompatible with the newest versions.

It's irrelevant because it's not what is included in this repo. You shouldn't be reporting issues with something that isn't in this repo. If you want to talk about development and the efforts to upgrade to a newer version of mkxp-z, go to the Discord.

jonisavo commented 3 years ago

If you are interested in helping with getting Essentials to run on mxkp-z, our Discord server is here: https://discord.gg/ZFaunpVv. @Maruno17, I think we should add an invite link to the README.

jonisavo commented 3 years ago

The mxkp-z PR (#96) fixes this and #88, so both issues can be closed.