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

Add another kernel test, fix small bugs #156

Merged
merged 9 commits into from
Dec 11, 2020
Merged

Conversation

water111
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented Dec 10, 2020

Pull Request Test Coverage Report for Build 414368845

  • 19 of 19 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 81.245%

Totals Coverage Status
Change from base Build 409669359: 0.01%
Covered Lines: 17795
Relevant Lines: 21903

💛 - Coveralls

@water111
Copy link
Collaborator Author

The windows test failures found a very real bug in the kernel implementation that the linux tests didn't catch:

(set! temp sp)   ;; store stack pointer in temp
(.sub temp off)  ;; subtract off GOAL pointer offset
;; incorrect code: 
 (set! (-> obj sp) (the int sp)) ;; store GOAL pointer to stack
;; correct code:
 (set! (-> obj sp) (the int temp)) ;; store x86-64 pointer to stack

This happened to work on Linux because (-> obj sp) is a 32-bit integer, and the location of the GOAL main memory happened to be one where you can just mask off the upper 32-bits of an x86-64 address to get the GOAL address. On windows this didn't work, because the offset wasn't all zeros in the lower 32 bits.

To make these bugs easier to find in the future, I've changed the address hint passed into mmap to one that will cause problems in these cases.

@water111
Copy link
Collaborator Author

looks like an identical bug in Debugger.cpp with the address used for breakpoints.

@water111 water111 merged commit ba919a0 into master Dec 11, 2020
@water111 water111 deleted the w/gkernel-more-tests branch December 11, 2020 01:26
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