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 with memory larger than 4GB doesn't boot #1048

Closed
Pusnow opened this issue Aug 20, 2019 · 3 comments
Closed

VM with memory larger than 4GB doesn't boot #1048

Pusnow opened this issue Aug 20, 2019 · 3 comments

Comments

@Pusnow
Copy link
Contributor

Pusnow commented Aug 20, 2019

If I give memory larger than 4GB, VM fails to boot due to page fault outside application, addr: 0xffff800100000000.

~/osv-origin$ ./scripts/build -j24 image=native-example
...
~/osv-origin$ ./scripts/run.py -m 3G
OSv v0.53.0-87-gf7b6bee5
eth0: 192.168.122.15
Booted up in 342.09 ms
Hello from C code
~/osv-origin$ ./scripts/run.py -m 4G
OSv v0.53.0-87-gf7b6bee5
page fault outside application, addr: 0xffff800100000000
[registers]
RIP: 0x000000004033d320 <boost::intrusive::bstree_algorithms_base<boost::intrusive::rbtree_node_traits<void*, false> >::prev_node(boost::intrusive::rbtree_node<void*>* const&)+112>
RFL: 0x0000000000010246  CS:  0x0000000000000008  SS:  0x0000000000000010
RAX: 0x0000000040988300  RBX: 0x0000000000000040  RCX: 0xffff8000009d6008  RDX: 0xffff8000009d6008
RSI: 0xffff800100000008  RDI: 0xffff8000001f89e8  RBP: 0xffff8000001f89d0  R8:  0x0000000000000010
R9:  0x0000000000000000  R10: 0x00000000403e5ff1  R11: 0x0000000000001002  R12: 0x0000000040988300
R13: 0x0000000000000000  R14: 0x00000000403e5ff1  R15: 0x0000000000001002  RSP: 0xffff8000001f89d0
Aborted

[backtrace]
0x0000000040334325 <???+1077101349>
0x0000000040335a9c <mmu::vm_fault(unsigned long, exception_frame*)+172>
0x000000004039a090 <page_fault+144>
0x0000000040398ed6 <???+1077513942>
0x00000000403e8d1c <memory::page_range* memory::page_range_allocator::alloc<true>(unsigned long)+364>
0x00000000403e5dd5 <???+1077829077>
0x00000000403e60b7 <???+1077829815>
0x00000000403e63f6 <malloc+70>
0x000000004049fdd7 <operator new(unsigned long)+23>
0x0000000040214de8 <main_cont(int, char**)+200>
0x00000000403f9fb6 <thread_main_c+38>
0x0000000040399e52 <???+1077517906>
@wkozaczuk
Copy link
Collaborator

Thanks for reporting this bug. This feels like a regression. Have you tried against the older 0.53 kernel? I guess you could use newest capstan.

In any case regardless what I pass as memory size I always get this info when I debug print from mmu::free_initial_memory_range():

OSv v0.53.0-88-g11cc683b
free_initial_memory_range: 000000000093faf4
free_initial_memory_range: 000000003f6c050c
free_initial_memory_range: 0000000000000000
free_initial_memory_range: 000000000009fc00
free_initial_memory_range: 0000000000100000
free_initial_memory_range: 0000000000100000
eth0: 192.168.122.15
Booted up in 146.71 ms

It seems that our memory detection code disregards anything above 1GB, unless I am misreading something.

Also there is same address reported by page fault 0xffff800100000000'

@nyh
Copy link
Contributor

nyh commented Aug 20, 2019

Unfortunately, I can see the same bug (I did scripts/build; scripts/run.py -m4G).
Other large sizes result in other strange results, for example: 8G:

OSv v0.53.0-84-gad1eda6a
OSv v0.53.0-84-gad1eda6a
Error reading disk (real mode): 00000000000000e7
OSv v0.53.0-84-gad1eda6a
Error reading disk (real mode): 00000000000000e7
OSv v0.53.0-84-gad1eda6a
Error reading disk (real mode): 00000000000000e7
OSv v0.53.0-84-gad1eda6a

Note the reboot loop and the strange error message.
We could do a "git bisect" to find exactly the patch which broke it (like you, I suspect this is a regression).

@wkozaczuk
Copy link
Collaborator

This is the commit that broke it - 97fe8aa. It is the second bug this small patch introduced. The previous one I fixed - ef56fde - was really fixing what that commit exposed. This time it probably is a genuine bug or maybe not.

@nyh nyh closed this as completed in 5377a50 Aug 21, 2019
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

3 participants