Skip to content
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

Issue 747 fix #777

Merged
merged 3 commits into from
Jan 15, 2024
Merged

Issue 747 fix #777

merged 3 commits into from
Jan 15, 2024

Conversation

Notselwyn
Copy link
Collaborator

@Notselwyn Notselwyn commented Dec 28, 2023

registry.TryRead() shall now return false when a registry value does not exist inside of a key. Previously this returned true and made the caller check if output_var != default to check if the value actually existed. This is a fix for #747 .

I have converted existing direct calls to TryRead() as you can see in the code. I have tested this and it seems like it works correctly. Additionally, I have tested the original bug by creating HKEY_LOCAL_MACHINE\SYSTEM\HardwareConfig\sebcrash without any values in it. In the old version, this caused a crash because the code didn't check if the value actually existed, and hence caused a nullptr deref exception. In the new version, the code checks if the registry value does not exist, and if so it does not continue with inspecting the value in the caller code.

One possible issue I have seen is that the StartMonitoring() and Timer_Elapsed() functions will now error if a value does not exist. Hence, we will need to think of a solution to monitor for registry value creations, since we cannot monitor for non-existing values in the current state.

@Notselwyn
Copy link
Collaborator Author

Currently experiencing crashes in SEB client. Do not merge, I will fix it.

Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (622df39) 55.25% compared to head (04571f5) 55.20%.

Files Patch % Lines
...er.Runtime/Operations/SessionIntegrityOperation.cs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #777      +/-   ##
==========================================
- Coverage   55.25%   55.20%   -0.06%     
==========================================
  Files         219      219              
  Lines       13294    13295       +1     
  Branches     1446     1446              
==========================================
- Hits         7346     7339       -7     
- Misses       5634     5640       +6     
- Partials      314      316       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Notselwyn
Copy link
Collaborator Author

Currently experiencing crashes in SEB client. Do not merge, I will fix it.

I'm unable to reproduce this crash from yesterday... LGTM :^)

I investigated logs and it seems like the client executable crashed out of no where, which it doesn't do now. When the crashes happened, these were the important logs:

Runtime.log:

2023-12-28 16:27:38.434 [03] - INFO: [ProcessFactory] Successfully started process 'C:\Users\dev\Documents\code\seb-win-refactoring\SafeExamBrowser.Runtime\bin\x64\Release\SafeExamBrowser.Client.exe' with ID = 21400.
2023-12-28 16:27:38.435 [03] - DEBUG: [Process 'SafeExamBrowser.Client.exe' (21400)] Initialized termination event.
2023-12-28 16:27:38.435 [03] - INFO: Waiting for client to complete initialization...
2023-12-28 16:27:43.698 [14] - DEBUG: [Process 'SafeExamBrowser.Client.exe' (21400)] Process has terminated.
2023-12-28 16:27:43.698 [03] - ERROR: Client instance terminated unexpectedly during initialization!
2023-12-28 16:27:43.699 [03] - ERROR: Failed to start new client instance! Aborting procedure...
2023-12-28 16:27:43.700 [03] - INFO: Reverting kiosk mode 'None'...

Service.log:

2023-12-28 16:27:43.347 [11] - DEBUG: [FeatureConfigurationMonitor] Checking 13 configurations...
2023-12-28 16:27:43.702 [14] - DEBUG: [ServiceHost] Received message 'SessionStopMessage', sending response 'SimpleResponse -> Acknowledged'.
2023-12-28 16:27:43.702 [15] - INFO: ### ------------------------------------- Session Stop Procedure ------------------------------------- ###

There are no client logs, which leads me to believe the right exe might not have been found? Perhaps the original SEB service interfering with the custom build from this PR or so...

@Notselwyn Notselwyn marked this pull request as ready for review December 29, 2023 18:46
@Notselwyn
Copy link
Collaborator Author

Marking the PR as ready for review (@dbuechel). Description of PR @ #777 (comment)

@dbuechel
Copy link
Member

Excellent work, I'll review and merge the pull request first thing next Monday.

Copy link
Member

@dbuechel dbuechel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, that looks perfect. I'll test it locally and try to fix the issue you described, I reckon it's a trivial thing that we'll need to adapt.

@dbuechel dbuechel merged commit ef267ef into SafeExamBrowser:master Jan 15, 2024
4 of 6 checks passed
dbuechel added a commit that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants