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

VM Synchronization Bug #147

Open
omegaphoenix opened this issue Mar 11, 2017 · 3 comments
Open

VM Synchronization Bug #147

omegaphoenix opened this issue Mar 11, 2017 · 3 comments

Comments

@omegaphoenix
Copy link
Owner

omegaphoenix commented Mar 11, 2017

I think the bug that sometimes breaks the parallel tests which test eviction has to do with accessing a frame while it is being deleted.

Currently the tests are failing with exit(-1) because !user_vaddr(fault_addr) is true in the exception.c page_fault() handler. This is caused by a fault within the kernel code. The kernel code that is being called is fetch_data_to_frame(). Here is the backtrace right before it fails:

#0 page_fault (f=0xc0132e64) at ../../userprog/exception.c:149
#1 0xc0022817 in intr_handler (frame=0xc0132e64) at ../../threads/interrupt.c:330
#2 0xc0022a1f in intr_entry () at ../../threads/intr-stubs.S:37
#3 0xc0132e64 in ?? ()
#4 0xffffffff in ?? ()
#5 0x00000008 in ?? ()
#6 0x00000282 in ?? ()
#7 0xc0111000 in ?? ()
#8 0xc003024d in fetch_data_to_frame (page=page@entry=0xc0136b8c) at ../../vm/page.c:227
#9 0xc002c919 in page_fault (f=0xc0132fb0) at ../../userprog/exception.c:160
#10 0xc0022817 in intr_handler (frame=0xc0132fb0) at ../../threads/interrupt.c:330
#11 0xc0022a1f in intr_entry () at ../../threads/intr-stubs.S:37
#12 0xc0132fb0 in ?? ()
#13 0x08048141 in ?? ()

The line in page.c that it is failing on is provided below:
struct frame_table_entry *fte = get_frame();

@omegaphoenix
Copy link
Owner Author

The issue can be reproduced by running the page-parallel test multiple times on qemu.

@omegaphoenix
Copy link
Owner Author

I think the bug is being caused by the frame being pinned for use after it is chosen for eviction but before it is evicted.

@omegaphoenix
Copy link
Owner Author

Kernel PANIC at ../../vm/frame.c:244 in free_frame(): assertion `fte->pin_count == 0' failed.

0xc002984c: debug_panic (.../../lib/kernel/debug.c:38)
0xc003016d: free_frame (...uild/../../vm/frame.c:246)
0xc0030447: evict (...uild/../../vm/frame.c:162)
0xc0030ba5: fetch_data_to_frame (...build/../../vm/page.c:227)
0xc002d4ca: sys_read (...../userprog/syscall.c:369)
0xc002da29: syscall_handler (...../userprog/syscall.c:124)
0xc0022817: intr_handler (..../threads/interrupt.c:330)
0xc0022a1f: intr_entry (threads/intr-stubs.S:38)
0x0804a22c: (unknown)
0x08048105: (unknown)
0x08048768: (unknown

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

No branches or pull requests

1 participant