Editing enemies in (specific) old rpg files causes segfault?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
cammySashimi
Slime
Posts: 4
Joined: Fri Jul 19, 2019 7:37 am
Location: Santa Cruz, CA
Contact:

Editing enemies in (specific) old rpg files causes segfault?

Post by cammySashimi »

Hey y'all! Used to have an account on here years ago, locked myself out of it recently, now I've got a new username (who could I be ooo spooky) blah blah blah

Anyways, I stumbled upon a bug when trying to work on a slightly older game of mine (early 2018? i think?) in the latest nightly.

When I try to edit any enemy, custom segfaults with no other information :/ It doesn't happen in new rpg files, and it only happens in certain old ones.

I've uploaded some examples of ones that crash here: https://drive.google.com/open?id=1iNDFM ... 3yvij5lsIx
and some that don't crash here: https://drive.google.com/open?id=1jri5k ... SAXpqMCtsK
(tried to find small ones because my internet speed is bad :[ editing a blank enemy still triggers it, as does adding an enemy)

Also, I'm editing this on Debian Sid, for what its worth :p

Thank you so much, take care y'all ~
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Nothing is compatible between two different versions! Never ever! With this modern stuff, it's always like that. I would recommend to use the OHR version with that you have started your project until it is finished.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

No that is only half right.

An old engine version is never compatible with newer games, but old games should always be upgradable to newer versions of the engine.

That being said, bugs happen!

Let's see if we can get a stack trace that will shed some light on the crash.

I would like to try and reproduce the crash myself. I won't have time this morning, but I will try when I can.

Thank you for reporting it!
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Alright!

I am definitely able to reproduce. In antediluvian.rpg I can go into the enemy editor. I see only enemy 0, and it seems blank. When I try to edit it crashes.

I got the crash message:
crash wrote: Aborting due to runtime error 6 (out of bounds array access) at line 113 of enemyedit.bas::ENEMY_EDITOR
I can definitely fix this-- however, what I really want to know is how many enemies were in this rpg file before? Did it have none? or were there some that may have been corrupted or deleted somehow?
User avatar
cammySashimi
Slime
Posts: 4
Joined: Fri Jul 19, 2019 7:37 am
Location: Santa Cruz, CA
Contact:

Post by cammySashimi »

There was no enemies in that RPG file before, I just picked the smallest ones I could find on my hard drive :v

As far as I can tell, there's no enemies missing from any of the files that break
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Aha! This is almost exactly the same as a bug that TMC fixed last week in the item editor. It only happens to games that have less than 8 elementals enabled, which is why it only affected some of your games and not others.

I'll work on the fix, and you can test it out tomorrow with tonight's nightly build

EDIT: Done! Try re-downloading a nightly build tomorrow, and thank you again for reporting the bug!
Last edited by Bob the Hamster on Sat Jul 20, 2019 8:05 pm, edited 1 time in total.
User avatar
cammySashimi
Slime
Posts: 4
Joined: Fri Jul 19, 2019 7:37 am
Location: Santa Cruz, CA
Contact:

Post by cammySashimi »

Oh awesome! I would have never guessed that was causing it.

Thank you so much :))
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Oops, I should have thought to check whether that crash happened anywhere else when I fixed the first case. I just had a look and found a 3rd instance, but only in a debug menu. (Also, I'm to blame for introducing that bug in the first place)
Post Reply