CUAHSI / CUAHSI/HydroDesktop

Download Manager Logging Crashes on Mono

Open
#103 1 comment 0 reactions 0 assignees View on GitHub
CodePlex
Dominant language
C#
Stars
76
Forks
21
PR merge metrics
No merged PRs in 30d

Description

shieldst[CodePlex]

Problem
The Download Manager has a log feature that displays information about the status of the various downloads it is making. Something about this log feature causes HydroDesktop to crash on Mono (I know for sure it crashes on Mac OS; I can't remember if it crashes
on Linux). You can replicate this by removing the condition below and attempting to download data from one or more data sites; as soon as the Download Manager window appears, the program will crash.
Temporary Solution
I have added a condition in DownloadManagerUI.cs to update the log only if we are not running on Mono, which at least fixes the crashing issue, but removes a fairly important piece of functionality from HydroDesktop when running on Mono.
private void ThreadSafeAddItemToLog(ListBox listBox, object value)
{
if (!DotSpatial.Mono.Mono.IsRunningOnMono())
{
listBox.UIThread
(delegate
{
try
{
listBox.Items.Add(value);

// scroll to last item if need
if (IsAutoScrollDetailsLog)
{
listBox.SelectedIndex = listBox.Items.Count - 1;
}
}
catch (Exception e)
{
Debug.WriteLine(quotException: quot + e.Message);
Debug.WriteLine(e.StackTrace);
}
}
);
}
}
My guess is that something about the threads updating the listBox that displays the log is not handled correctly by Mono, thus causing the crash. Regardless, we need to fix this so that the same information available on Windows is available on Mono.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in DownloadManagerUI.cs at ThreadSafeAddItemToLog and reproduce the crash by downloading data from one or more data sites on Mono, especially macOS. Trace the UI-thread update of the log ListBox and compare it with the temporary Mono condition; done means the Download Manager remains stable and shows the same log information on Mono as on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.