asiekierka / nitrotracker

A Fasttracker II style tracker for the Nintendo DS
71 stars 5 forks source link

Random crash during sample amplitude UI adjustment (memory corruption?) #19

Open deadpahn opened 1 year ago

deadpahn commented 1 year ago

Japanese DSi running off internal SD CARD, launching via Nocash Ulaunch (mapped to boot up hot hotkey).

Happens all the time for me in almost all scenarios. https://user-images.githubusercontent.com/1032331/227414722-45334fba-88cd-4308-9356-27ff91e08730.mp4

asiekierka commented 1 year ago

Not good...

void NumberSlider::penUp(u8 px, u8 py)
{
        btnstate = false;

        if(onPostChange!=0) {
                onPostChange(value);
        }

        draw();
}

The crash happens at the call to draw(), which implies a memory corruption situation going on.

deadpahn commented 1 year ago

The crash happens at the call to draw(), which implies a memory corruption situation going on.

Do you mean my DSi is broken or you mean in that block of code?

asiekierka commented 1 year ago

In that block of code.

deadpahn commented 1 year ago

Still able to reproduce the issue

On Fri, Apr 7, 2023 at 8:15 AM Adrian Siekierka @.***> wrote:

In that block of code.

— Reply to this email directly, view it on GitHub https://github.com/asiekierka/nitrotracker/issues/19#issuecomment-1500238051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH4BC7YFFNH2A4FZVQ64NTXAAAOZANCNFSM6AAAAAAWGATU54 . You are receiving this because you commented.Message ID: @.***>

deadpahn commented 1 year ago

Still a thing in 0.4.4

asiekierka commented 1 year ago

Oh, I know. I have no idea where to even start with this one, so it'll have to wait until I have time to debug it.

deadpahn commented 1 year ago

It seems a lot better than before though! Im able to increase the volume on stuff again haha

daniel-ferguson commented 1 year ago

Just a little update on this, I've managed to get the project building locally and I seem to be able to reproduce the same issue in an emulator (desmume 0.9.13). Recording two samples first before scrolling seems to reproduce reliably, where on my DS hardware a single recorded sample was enough.

Out of curiosity how did you identify the crash location in https://github.com/asiekierka/nitrotracker/issues/19#issuecomment-1483314699? I'm unfamiliar with both homebrew dev, and C++ so a bit out of my depth, but would be keen to have a dig and see where I get to :smile:

deadpahn commented 1 year ago

Just a little update on this, I've managed to get the project building locally and I seem to be able to reproduce the same issue in an emulator (desmume 0.9.13). Recording two samples first before scrolling seems to reproduce reliably, where on my DS hardware a single recorded sample was enough.

Out of curiosity how did you identify the crash location in #19 (comment)? I'm unfamiliar with both homebrew dev, and C++ so a bit out of my depth, but would be keen to have a dig and see where I get to smile

So I've been testing the new version. This isn't just related to the volume. It's everywhere. Its just a guess but I'm starting to think it has to do with the undo buffer. A lot of different "value" input areas cause the error. For example, I was able to crash NT while drawing a waveform like a maniac.

Which brings me to a temporary solution: make the arrow buttons on the side usable. So far, increasing volume is always a crash point and it's pretty annoying. Loading in samples that I need to increase the volume I realized is a common song writing task. If the buttons worked, or even if you could "type" the value of the volume (as well as slide) that would be great.

deadpahn commented 1 year ago

Tried again tonight. Moved the volume increase by 1 and a RSOD happened. The memory bar was tiny too. Not sure what is happening here. If I reboot i can sometimes avoid guru rsod.

deadpahn commented 10 months ago

Tested on 0.4.6 ... Still happens 😭

This video is a clean power on loading a sample. https://github.com/asiekierka/nitrotracker/assets/1032331/1b203199-2198-4c09-b33c-a2ccb6351702

LeviathaninWaves commented 9 months ago

I don't know if you have solved this yet but I ran into an issue with the undo buffer getting "trashed". My theory is that the undo buffer code doesn't handle bounds checking very well but I haven't looked to confirm as I'm busy implementing a large number of new features.

deadpahn commented 9 months ago

I don't know if you have solved this yet but I ran into an issue with the undo buffer getting "trashed". My theory is that the undo buffer code doesn't handle bounds checking very well but I haven't looked to confirm as I'm busy implementing a large number of new features.

I made a pull request that fixed the issue for me. I wasnt able to build it using blockds cause it was running into a lot of setup issues (even using the githubs docs).

deadpahn commented 6 months ago

This doesn't really happen anymore for me since the last build thankfully.