Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
523 stars 135 forks source link

Cannot load Scripts.rxdata #19

Closed dogtopus closed 10 years ago

dogtopus commented 10 years ago

The first script can be successfully read, but when it tries to read the next one, it has 2 situations (both not good):

  1. Crashes on the rb_ary_entry() func. call
  2. No crash, but the data seems corrupt and will be ignored by the program

Thus, the program only executes the script that on the top of the script pack and quits immediately (w/ or w/o SIGSEGV)

The script pack can be read successfully by the following programs:

also, a simple test was done using MRI 2.0's irb...

irb(main):001:0> Marshal.load(IO.binread('Scripts.rxdata')).each { |scr| puts scr.class }
Array
Array
...
Ancurio commented 10 years ago

I think you have two options to prevent the SIGSEGV:

  1. Use MRI 2.1
  2. git revert 7f4e58fd6ea548983b9d2fd3aaa797784011bef3
dogtopus commented 10 years ago

So the problem is related to MRI 2.0's GC? Interesting... I think you can post a commit that let the program memcpy() the data when MRI 2.0 is used for compiling. (currently debian sid doesn't have 2.1 in its repository, most distribution may not have it either) Anyway, thanks for your help

Ancurio commented 10 years ago

So the problem is related to MRI 2.0's GC? Interesting...

Yeah, I think it wrongfully swipes the ruby values on my C stack. Not sure though, I'm not a Ruby expert =)

I think you can post a commit that let the program memcpy() the data when MRI 2.0 is used for compiling. (currently debian sid doesn't have 2.1 in its repository, most distribution may not have it either)

I'll think about it.

Anyway, thanks for your help

No problem. Are you able to execute scripts now?

dogtopus commented 10 years ago

Are you able to execute scripts now?

Of course :D Now it can run the default empty project perfectly

Ancurio commented 10 years ago

Great =)