Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to extract vanilla Minecraft sounds can cause NBS to crash #507

Open
CreeperPookie opened this issue Jan 25, 2025 · 3 comments
Open
Labels
C: Bug Something isn't working

Comments

@CreeperPookie
Copy link

CreeperPookie commented Jan 25, 2025

Describe the bug
I didn't notice this until recently when I needed to re-extract my Minecraft sounds after a PC reset; however, when I tried to extract my MC sounds into Minecraft, it caused NBS to crash instantly. I'm still not 100% sure, but I really think this is most likely a permission issue; if its installation folder is protected (like if it was installed in Program Files), writing the sound files to its directory might cause a crash (since it wouldn't have permission to write there)

To Reproduce
Steps to reproduce the behavior (though, unlike my usual issues I don't know if this will be easily reproducible):
0: (using a VM may help with this to not conflict with your main NBS installation)

  1. Install NBS to a folder with limited system permissions (such as Program Files or Program Files (x86))
  2. Once it has been installed, make sure to unselect Launch Note Block Studio (since the installer runs as admin, using the auto launch option might also make NBS run as admin)
  3. Open NBS (:D) normally as a user application (aka not run as administrator) and create a new song
  4. Open the settings navigation bar drop-down and open the Minecraft sounds importer
  5. Set the version to the newest version (which right now is 1.21.4, which was auto-selected for me)
  6. Click the get sounds button and (hopefully) observe how NBS crashes
    Expected behavior
    well, I would hopefully expect NBS to copy all the sound files into the right folder without crashing :D

Screenshots
Image

Additional context
One major thing that I find interesting is that NBS didn't crash like it usually does most of the time; usually, when NBS crashes, it shows a window referencing the line of GameMaker code that likely caused the problem (like this image from one of my previous GitHub issues)
Image
instead, it seems like the bug was deep enough that Visual C++ threw an error; I'm not entirely sure though, so I will include the NBS log it generated on opening (though it doesn't indicate to me that there were any issues loading anything)
log.txt

@OctoFlareDev
Copy link
Collaborator

Hi, thank you for reporting the bug! Can you run nbs from the Launch Debug. bat file from its installation folder and post the debug.txt in the same folder after the crash for more logs from the runner? thanks!

@CreeperPookie
Copy link
Author

CreeperPookie commented Jan 25, 2025

this is interesting..
firstly, the Launch Debug option causes this popup on startup, I wonder if NBS might be trying to internally read -debugoutput debug.log as a .nbs file path lol
Image
I did manage to get the debug log and I will include it here:
debug.txt
however, this is the weird thing though.. after running it in debug, exporting works perfectly lol
after playing around with the files a bit (to make sure it wasn't a one-time bug) I think I might know why

I always install all of my programs (including NBS) in a protected folder (usually the Program Files's folder), as it makes it a lot easier to manage my apps compared to being in my user folder; since NBS's installer runs as an admin, it makes it possible to easily install there. However, NBS itself runs as a user application, and might not even have full access directly to its own folder; I bet that when it tries to copy the sounds into its own folder, it runs into permission issues and likely can't recover, and as such crashes.
what especially makes me think this is true as well is that if I run NBS as an administrator or manually give myself full permissions to the installation directory of its files, importing all Minecraft sounds also works fine.

tl;dr: I have NBS installed in the Program Files folder, and since NBS generally runs as a user application exporting likely causes it to crash (since it doesn't have permission to write to its directory)
this also explains why the error is coming from Visual C++, as a no permission error would be a deeper-level problem and not something with the code directly

I'm not going to close this myself just yet (as ofc NBS still can crash), but definitely a very important detail to keep in mind :D

@OctoFlareDev OctoFlareDev added the C: Bug Something isn't working label Jan 25, 2025
@CreeperPookie CreeperPookie changed the title Attempting to extract vanilla Minecraft sounds causes NBS to crash Attempting to extract vanilla Minecraft sounds can NBS to crash Jan 25, 2025
@CreeperPookie CreeperPookie changed the title Attempting to extract vanilla Minecraft sounds can NBS to crash Attempting to extract vanilla Minecraft sounds can cause NBS to crash Jan 25, 2025
@CreeperPookie
Copy link
Author

I've also run into this crash from trying to open the default songs stored in NBS's installation folder, but after realizing this is a permissions issue it makes perfect sense (read and open the NBS file in a protected directory, then save (and fail to write) when NBS tries to initially save it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants