-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fix a stack overflow in non-writable working directories #129
Conversation
By using the running application's directory as the base path, the package won't access possibly non-writable working directories
Thanks for the PR! It appears that the problem occurs in combination with the default registered configuration provider. |
It looks good to have ContentRoot in the same directory as the executable file. |
Sure thing! Here are the specs of the system I could reproduce the issue on:
The issue also occurs on the Ubuntu Live CD as well - although the stack doesn't overflow there, the app still runs with a delay under previously mentioned directories (including the root path). If you'd like to try reproducing the issue on the Ubuntu Live CD, this is a script I use to install .NET 8 under a live environment: #!/bin/bash
# Resources:
# https://learn.microsoft.com/en-gb/dotnet/core/install/linux
# https://learn.microsoft.com/en-gb/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository
sudo apt update
sudo apt install wget -y
# Get Ubuntu version
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
# Download Microsoft signing key and repository
wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O ~/Downloads/packages-microsoft-prod.deb
# Install Microsoft signing key and repository
sudo dpkg -i ~/Downloads/packages-microsoft-prod.deb
# Clean up
rm ~/Downloads/packages-microsoft-prod.deb
# Update packages
sudo apt update
# Install .NET 8.0 SDK
sudo apt install dotnet-sdk-8.0 -y What I haven't accounted for is a scenario where the application could be installed and run from a read-only directory - that would mean the application's startup time would still be slow if the it were to be run from its installed path. Maybe a check for read-write permissions in the working directory (and changing the ContentRoot to a read-writable one if the current one is not) could solve the problem! |
There's one thing I've completely missed - I wasn't really aware what the According to #132, the So, what my fix essentially does, is it always makes the Are there any changes I should make before the PR could be considered ready? Thank you! |
Apologies for the delay, but I have merged it. Thanks! |
Fixes #128. By using the running application's directory as the base path, the package won't access possibly non-writable working directories.
Video_2024-02-26_16-36-59.mp4