gacopl / NiceHashMiner

NiceHash easy to use CPU&GPU Miner - gaco mod with lots of enhancements
11 stars 2 forks source link

Unhandled exception when miner changes to more profitable #1

Closed kpereira closed 7 years ago

kpereira commented 7 years ago

First of all, thank you for this release.

The issue is as follows:

When a miner is changed, from a less profitable to a more profitable miner, an un-handled exception occurs. The un-handled exception presents itself in a popup and gives the options [Details] [Continue] [Quit]. It does not affect the operation of the application nor miners. I have pasted and attached a file (link at end) with what the [Details] option gives.

I cannot recall exactly which miners were involved. It occured multiple times, each time when a miner was changed so it might not be specific to any miners. (my memory recalls the following miners involved: lbry, lyra, equihash, and maybe daggerhashimoto)

(https://github.com/gacopl/NiceHashMiner/files/1079787/unhandled.exception.occured._options_.continue-quit-details.txt)

==============================================================

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at NiceHashMiner.Form_Main.AddRateInfo(String groupName, String deviceStringInfo, APIData iAPIData, Double paying, List`1 devNames, Boolean isApiGetException)
   at NiceHashMiner.Miners.MiningSession.MinerStatsCheck(Dictionary`2 NiceHashData)
   at NiceHashMiner.Miners.MiningSession.SwichMostProfitableGroupUpMethod(Dictionary`2 NiceHashData, Boolean log)
   at NiceHashMiner.Miners.MinersManager.SwichMostProfitableGroupUpMethod(Dictionary`2 NiceHashData)
   at NiceHashMiner.Form_Main.SMAMinerCheck_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
NiceHashMiner
    Assembly Version: 1.7.5.13
    Win32 Version: 1.7.5.13
    CodeBase: file:///C:/Users/[REDACTED DIR]/NiceHashMiner.exe
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8793 (WinRelRS2.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 7.0.0.0
    Win32 Version: 7.0.1.18622
    CodeBase: file:///C:/Users/[REDACTED DIR]/Newtonsoft.Json.DLL
----------------------------------------
System.Management
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8794 (WinRelRS2.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
log4net
    Assembly Version: 1.2.15.0
    Win32 Version: 1.2.15.0
    CodeBase: file:///C:/Users/[REDACTED DIR]/log4net.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8784 (WinRel.050727-8700)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
MessageBoxManager
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/[REDACTED DIR]/MessageBoxManager.DLL
----------------------------------------
MiniHttpd
    Assembly Version: 1.2.0.32072
    Win32 Version: 1.2.0.32072
    CodeBase: file:///C:/[REDACTED DIR]/MiniHttpd.DLL
----------------------------------------
LinqBridge
    Assembly Version: 1.3.0.0
    Win32 Version: 1.3.14717.2012
    CodeBase: file:///C:/[REDACTED DIR]/LinqBridge.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

==============================================================

gacopl commented 7 years ago

Thanks, on it :)

gacopl commented 7 years ago

Ok nailed it, updated release please re-download thanks

kpereira commented 7 years ago

Thanks, I'll check it out now.

kpereira commented 7 years ago

Have you updated the link here: https://github.com/gacopl/NiceHashMiner/releases ?

gacopl commented 7 years ago

Yup

kpereira commented 7 years ago

One small thing while you're here, the profit table is not sorted by profit. Should I create a new issue for that?

I am also testing the new version now.

gacopl commented 7 years ago

No, the one in logs ? tell me does it sort properly in the original? as i honestly see switching working correctly or the best profit

kpereira commented 7 years ago

Yeah in the logs/debug window. Switching works fine it's just the display. In the original it is sorted by profit. Low to High.

untitled

gacopl commented 7 years ago

I just checked the original it behaves the same way, it sorts by algorithm name like in the UI. Sorry but i will not change it i want to stay as close to original as possible for future merges image

kpereira commented 7 years ago

My apologies, I was using a different modded version and with it was the first time I used the debug log. I assumed it was the same.

gacopl commented 7 years ago

cool keep on hashing and spread the word i want my couple days of work mean something :)

kpereira commented 7 years ago

No problem, thank you again for this release.

In regards to the fix for this issue, I've only had it change once and there was no error.