seb-win-refactoring: ERROR: Caught unexpected exception while performing operation 'VirtualMachineOperation'
IMPORTANT Please always consult the documentation first before creating a bug report! https://safeexambrowser.org/windows/win_usermanual_en.html
Describe the Bug When I try to execute SEB in Windows 10, the app does not start correctly, older versions work fine, but latest 3.6.0 not.
Steps to Reproduce Steps to reproduce the behavior:
- Go to Moodle and start a new quiz attempt
- The SEB will crash
Expected Behavior To start the quiz attempt with out any problems
Screenshots
Version Information
- Windows 10 Professional
- SEB-Version 3.6.0
Additional Context
2023-12-06 21:09:10.587 [09] - INFO: Validating virtual machine policy...
2023-12-06 21:09:10.603 [09] - ERROR: Caught unexpected exception while performing operation 'VirtualMachineOperation'!
Exception Message: Object reference not set to an instance of an object.
Exception Type: System.NullReferenceException
at SafeExamBrowser.SystemComponents.VirtualMachineDetector.IsVirtualSystem(String biosInfo, String manufacturer, String model) in C:\Users\appveyor\projects\seb-win-refactoring-phv3mbelx16fm9ou\SafeExamBrowser.SystemComponents\VirtualMachineDetector.cs:line 116
at SafeExamBrowser.SystemComponents.VirtualMachineDetector.HasHistoricVirtualMachineHardwareConfiguration() in C:\Users\appveyor\projects\seb-win-refactoring-phv3mbelx16fm9ou\SafeExamBrowser.SystemComponents\VirtualMachineDetector.cs:line 158
at SafeExamBrowser.SystemComponents.VirtualMachineDetector.IsVirtualMachine() in C:\Users\appveyor\projects\seb-win-refactoring-phv3mbelx16fm9ou\SafeExamBrowser.SystemComponents\VirtualMachineDetector.cs:line 60
at SafeExamBrowser.Runtime.Operations.VirtualMachineOperation.ValidatePolicy() in C:\Users\appveyor\projects\seb-win-refactoring-phv3mbelx16fm9ou\SafeExamBrowser.Runtime\Operations\VirtualMachineOperation.cs:line 54
at SafeExamBrowser.Core.OperationModel.OperationSequence.Perform() in C:\Users\appveyor\projects\seb-win-refactoring-phv3mbelx16fm9ou\SafeExamBrowser.Core\OperationModel\OperationSequence.cs:line 108
2023-12-06 21:09:10.606 [09] - INFO: ### -------------------------------------- Session Start Failed -------------------------------------- ###
2023-12-06 21:11:21.342 [09] - INFO: Initiating shutdown procedure...
2023-12-06 21:11:21.344 [09] - INFO: Stopping communication host...
About this issue
- Original URL
- State: open
- Created 7 months ago
- Comments: 15 (10 by maintainers)
Yes indeed, I think there is no way around actually trying out different approaches. I think
value != defaultshould work, asvalueis defined as an object reference and not a value type like e.g.int, but here again, I think the best would be to try it out and see what works (best). I shall take this up in our internal planning and tackle it next year.That is indeed the best approach. I haven’t looked into the semantics but perhaps open a registry key, use RegistryKey.GetValueNames(), validate the value name, and then get the value? The obvious problem with this is that there’s quite a bit of overhead, so the approach depends on how frequent the TryRead() function is called in the codebase.
I believe this would interfere when registry values overlap with default values for types. I.e. if a registry value type is
intand the registry value is0, then the return value may indicate failure considering registry value0is the default value. If we take this approach I recommend using the fact that an existing registry value should not be NULL:(I’m using a separate var here which could be NULL, so the
valueout arg will never be set to NULL considering I don’t know out of the top of my head if it can be )