Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

Two unrelated issues: (1) backgroundog.exe randomly crashes with 0xC0000005 ACCESS_VIOLATION errors during Windows message processing, (2) wallpaper selection crashes when file paths contain non-ASCII characters (e.g., Chinese: D:\壁纸\风景.jpg).

Changes

Exception Handling (backgroundog crash)

  • Added AppDomain.UnhandledException and TaskScheduler.UnobservedTaskException global handlers
  • Wrapped main processing loop with try-catch to isolate iteration failures
  • Added IntPtr.Zero validation before native API calls (GetForegroundWindow, GetWindowThreadProcessId)
  • Added PID validation after GetWindowThreadProcessId calls

Files: App.cs, Windows.cs, Specification.cs

URI Creation (Unicode paths)

  • Changed local file path URI creation to use Path.GetFullPath() + UriKind.Absolute instead of UriKind.RelativeOrAbsolute
  • Added detection for absolute file paths in GetSource(string, string) overload to route through proper URI handling
  • Added fallback to preserve backward compatibility

File: Source.cs

// Before: fails with Chinese paths
return new Uri(Source, UriKind.RelativeOrAbsolute);

// After: normalizes and explicitly marks as absolute
string absolutePath = Path.GetFullPath(Source);
return new Uri(absolutePath, UriKind.Absolute);

All changes are defensive additions with no breaking changes to existing functionality.

Original prompt

This section details on the original issue you should resolve

<issue_title>Two Separate Issues - sucrose.backgroundog.exe Error Popup & Chinese Path Wallpaper Crash</issue_title>
<issue_description>Issue 1: sucrose.backgroundog.exe Error Popup
Description
The process sucrose.backgroundog.exe randomly displays a popup error with the message: exception processing message 0xcc0000005 - unexpected parameters.
Observed Behavior
The error popup appears randomly during app usage
No obvious functional crash of the entire app is caused, but the error interrupts usage.
The error is directly associated with the sucrose.backgroundog.exe process.
Issue 2: Wallpaper Customization Crash with Chinese Local Paths
Description
When using the app's custom wallpaper feature to select local images with Chinese characters in the file path (including Chinese folder names) or file names, the wallpaper function crashes immediately.
Steps to Reproduce
Open the app's wallpaper customization module and select the "Local Image" option.
Browse and choose a local image where the file path or file name contains Chinese characters (e.g., D:\壁纸\风景图\山水.jpg or E:\个人图片\桌面背景.png).
Click "Apply" – the wallpaper function crashes instantly, and the app automatically reverts to the default wallpaper.
Expected Behavior
The app should load and apply local wallpapers with Chinese paths/filenames normally without crashing.
Actual Behavior
The wallpaper function crashes immediately after selecting a local image with a Chinese path/filename, and the default wallpaper is applied automatically.
Additional Notes
The two issues are completely independent: the sucrose.backgroundog.exe error popup occurs randomly and is not triggered by the Chinese path wallpaper selection.
Local images with English paths/filenames can be applied normally via the custom wallpaper feature.
Online wallpapers and default wallpapers function without issues.</issue_description>

Comments on the Issue (you are @copilot in this section)

@Taiizor Which version of Sucrose are you using? Also, please follow the instructions below to send me the required file.

Log File (Important)
Share the diagnostic files by:
Right click on the system tray icon -> Report Issue -> Create Log File
or
Open Sucrose settings (Gear icon) top-right -> System -> Log Files -> Create
or
Navigate to the Appdata folder C:\Users\<UserName>\AppData\Roaming\Sucrose\Log</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 18, 2025 02:42
…roundog

Co-authored-by: Taiizor <41683699+Taiizor@users.noreply.github.com>
Co-authored-by: Taiizor <41683699+Taiizor@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix sucrose.backgroundog.exe error popup and wallpaper crash Fix backgroundog ACCESS_VIOLATION crash and Unicode file path URI handling Nov 18, 2025
Copilot AI requested a review from Taiizor November 18, 2025 02:47
Copilot finished work on behalf of Taiizor November 18, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two Separate Issues - sucrose.backgroundog.exe Error Popup & Chinese Path Wallpaper Crash

2 participants