xuantl / open-hardware-monitor

Automatically exported from code.google.com/p/open-hardware-monitor
0 stars 0 forks source link

Excecption comes up when using as a service at system start #350

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

Normal behaviour when using the OpenHardwareMonitorLib

What version of the product are you using? On what operating system?
Windows XP, i am using a program with the openHardwareMonitirLib

Please provide any additional information below.

This error only happens when the pc is started. The Programm is running as a 
service, so i think something hardware related is not ready yet. But this 
should be catched by the library

I get this excecption 

"System.NullReferenceException: Der Objektverweis wurde nicht auf eine 
Objektinstanz festgelegt.
   bei OpenHardwareMonitor.Hardware.Ring0.WaitIsaBusMutex(Int32 millisecondsTimeout)
   bei OpenHardwareMonitor.Hardware.LPC.LPCIO..ctor()
   bei OpenHardwareMonitor.Hardware.Mainboard.Mainboard..ctor(ISettings settings)
   bei OpenHardwareMonitor.Hardware.Mainboard.MainboardGroup..ctor(ISettings settings)
   bei OpenHardwareMonitor.Hardware.Computer.Open()

Original issue reported on code.google.com by i...@server-eye.de on 23 May 2012 at 8:03

GoogleCodeExporter commented 9 years ago
Are you using the latest version (0.4.0 Beta) of the OpenHardwareMonitorLib?

Your report says the exception is thrown here:

    public static bool WaitIsaBusMutex(int millisecondsTimeout) {
      if (isaBusMutex == null)
        return true;
      try {
        return isaBusMutex.WaitOne(millisecondsTimeout, false);
      } catch (AbandonedMutexException) { return false; } 
        catch (InvalidOperationException) { return false; }
    }

As far as I can see, the only way to get a NullReferenceException would be when 
a second thread changes the isaBusMutex to null just before the 
isaBusMutex.WaitOne call is made. 

Are you accessing the OpenHardwareMonitorLib from multiple threads (this is no 
supported atm)?

Original comment by moel.mich on 24 May 2012 at 9:23

GoogleCodeExporter commented 9 years ago
No not the latest but i will update it now :)

Yeah youre suggestion is right. Multiple Threads accessing this function the 
same time. 

I seem thank you for your Feedback!!

Original comment by i...@server-eye.de on 24 May 2012 at 10:57

GoogleCodeExporter commented 9 years ago

Original comment by moel.mich on 1 Jul 2012 at 3:14