cloudius-systems / capstan

Capstan, a tool for packaging and running your application on OSv. http://osv.io/capstan
Other
367 stars 82 forks source link

Assertion failed - for 'capstan run cloudius/osv' #75

Closed lalyos closed 10 years ago

lalyos commented 10 years ago

I've just installed capstan, and tried to run my first instance:

> capstan run cloudius/osv
Created instance: i1398088258
OSv v0.07
Assertion failed: !(reinterpret_cast<uintptr_t>(ret) & (align - 1)) (/home/penberg/osv/core/mempool.cc: alloc_phys_contiguous_aligned: 1378)

[backtrace]
0x398316 <memory::alloc_phys_contiguous_aligned(unsigned long, unsigned long)+214>
0x3542bb <ahci::port::setup()+283>
0x3549ae <ahci::port::port(unsigned int, ahci::hba*)+142>
0x354a5f <ahci::hba::scan()+111>
0x354d34 <ahci::hba::hba(pci::device&)+148>
0x354e07 <ahci::hba::probe(hw::hw_device*)+119>
0x33e65c <hw::driver_manager::register_driver(std::function<hw::hw_driver* (hw::hw_device*)>)+188>
0x33c8c3 <hw::device_manager::for_each_device(std::function<void (hw::hw_device*)>)+51>
0x33e3de <hw::driver_manager::load_all()+78>
0x20edf5 <do_main_thread(void*)+629>
0x3ff0a5 <sync+69>
0x3a3eaa <thread_main_c+26>
0x361585 <thread_main+7>

Environment

nyh commented 10 years ago

I think the problem is that ahci::port::setup() tries to get a small but 1024-byte aligned area, and that doesn't work (see https://github.com/cloudius-systems/osv/issues/271). It's easy to fix this bug in a not-very-efficient way by increasing the size of the allocation - I'll provide a test case and a patch. I'm surprised to see we have such alignment requirement, and if we do, that this never crashed before.

asias commented 10 years ago

Hello lalyos,

Thanks for reporting.

This patch fixes the issue for me.

[PATCH] ahci: Relax _cmd_table and _recv_fis alignment

penberg commented 10 years ago

I'm closing this as fixed.