-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: Caught unexpected exception while performing operation 'VirtualMachineOperation' #747
Comments
@arielramos Could you please post the entire log files? Line 116 as specified above cannot cause a NullReferenceException (under normal circumstances, we have seen weird stack traces under not-normal circumstances like VMs...), see https://github.com/SafeExamBrowser/seb-win-refactoring/blob/3.6.0/SafeExamBrowser.SystemComponents/VirtualMachineDetector.cs#L116. @Notselwyn Do you see anything that could fail or lead to a NullReferenceException in the code checking for historic virtual machine configurations? |
A NullReferenceException should only be possible when
The This means that probably the registry keys accessed here do not exist: seb-win-refactoring/SafeExamBrowser.SystemComponents/VirtualMachineDetector.cs Lines 151 to 152 in 40d2b6a
Said registry keys are:
However, the return values are checked for function calls to The return value indicating success only fails when an exception occurs. This gives me an idea: would it be possible that @dbuechel I suggest we implement this check: public bool TryRead(string key, string name, out object value)
{
var success = false;
value = default;
try
{
value = Microsoft.Win32.Registry.GetValue(key, name, default);
+ if (value != NULL)
success = true;
}
catch (Exception e)
{
logger.Error($"Failed to read value '{name}' from registry key '{key}'!", e);
}
return success;
} |
Hi, thank you for your reply, here you have the logs. |
@Notselwyn Yes, I think you're right, that is actually a bug in the code which we should fix. The current implementation will indeed return true with an output value of If there's no API, then we'd actually need to make the check a bit more elaborate: public bool TryRead(string key, string name, out object value)
{
+ var defaultValue = new object();
value = default;
try
{
value = Microsoft.Win32.Registry.GetValue(key, name, defaultValue);
}
catch (Exception e)
{
logger.Error($"Failed to read value '{name}' from registry key '{key}'!", e);
}
+ return value != default && value != defaultValue;
} I assumed that the actual value of a name can be Would you agree that the above change in fact eliminates the bug and ensures that if we return |
@arielramos I still cannot explain your stack trace, that particular line of code cannot cause a
Can you explain why there is no system information in the runtime log file resp. what computer you are using (manufacturer and model)?
|
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 public bool TryRead(string key, string name, out object value)
{
+ var raw_value = NULL; // set to NULL for fallback when exception happens
try
{
+ raw_value = Microsoft.Win32.Registry.GetValue(key, name, null);
}
catch (Exception e)
{
logger.Error($"Failed to read value '{name}' from registry key '{key}'!", e);
}
+ if (raw_value == NULL)
+ {
+ value = default;
+ return false;
+ }
+ value = raw_value;
+ return true;
} (I'm using a separate var here which could be NULL, so the |
Yes indeed, I think there is no way around actually trying out different approaches. I think |
Hi, these are the computer specs: Intel Core i7 2700K Windows, BIOS, Norton updates all current. |
Also I have these new log files: 2023-12-12_20h37m33s_Runtime.log |
Thanks a lot. I presume you have a custom build which could explain the missing manufacturer and model name in the system info. |
As the client log file shows, you were running a prohibited application and SEB was unable to terminate it automatically:
|
Thank you for all your help Does that mean that an improvement can be made to the code to take into account people who have computers they build themselves? I'll check the remoting_host.exe |
Yes, we'll definitely improve the code as outlined above. You'd need to test the beta build once the changes are implemented in order to see whether these indeed fixed the issue, as the stack trace you posted still seems inexplicable to me. But that last line might just be an aftereffect of an earlier |
Hi, I have an apps called LogMeIn as a remote desktop, but, I closed the app in the task manager and then use the SEB, but issue persists. I attach other logs. |
Yes, that is still the same issue and I'm afraid you won't get around it until we implemented a fix (which is currently planned for January). If it is possible, try to downgrade and use SEB 3.5.0 in the meantime. |
@arielramos Could you please test the latest beta build with the changes from @Notselwyn: https://sebdev-let.ethz.ch/api/buildjobs/c1928d85u6cyhqyn/artifacts/SEB_3.7.0.647_SetupBundle.exe. |
Hi @dbuechel , hope you are well, we downloaded the beta and now is working, thank you so much, we really appreciate your effords. Regards |
Excellent, thanks for testing and the timely feedback, much appreciated! |
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:
Expected Behavior
To start the quiz attempt with out any problems
Screenshots
Version Information
Additional Context
The text was updated successfully, but these errors were encountered: