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

mkdir not working in Ubuntu 15.10 #691

Closed
srinat999 opened this issue Dec 2, 2015 · 2 comments
Closed

mkdir not working in Ubuntu 15.10 #691

srinat999 opened this issue Dec 2, 2015 · 2 comments

Comments

@srinat999
Copy link

In Ubuntu 15.10 mkdir command from the cli module is not working. The image has been compiled with just the cli module using the command ./scripts/build image=cli Here is the error:

/# mkdir foo
[registers]
RIP: 0x0000100001c0ed60 <???+29420896>
RFL: 0x0000000000010206  CS:  0x0000000000000008  SS:  0x0000000000000010
RAX: 0x01002000006e6f69  RBX: 0x00002000002fe3f0  RCX: 0x00002000002fe570  RDX: 0x0000000000000002
RSI: 0x00002000002fe560  RDI: 0x00002000002fe560  RBP: 0x0000000000000000  R8:  0xffff80000b596500
R9:  0x0000000000f427e8  R10: 0xffffa00004cdb810  R11: 0x0000000000000050  R12: 0x00002000002fe560
R13: 0x0000000000f427e8  R14: 0xffffa00004cdb810  R15: 0x0000000000000050  RSP: 0x00002000002fe360
general protection fault

[backtrace]
0x0000000000386a69 <general_protection+137>
0x00000000003847a2 <???+3688354>

The system just hangs at this point and the user is forced to kill the program. Rest of the commands seem to work fine.

OS version: Ubuntu 15.10
GCC version: 5.2.1 20151010

@nyh nyh mentioned this issue Jan 14, 2016
@nyh
Copy link
Contributor

nyh commented Apr 3, 2016

I can reproduce this issue, compiling on Fedora 23 with gcc 5.3.1, although I see a different type of crash, not a GPF:

Stack trace from gdb:

#4  0x00000000002257f0 in abort () at runtime.cc:98
#5  0x000000000043fab5 in osv::generate_signal (siginfo=..., 
    ef=0xffff800004198088) at libc/signal.cc:124
#6  0x000000000043fadb in osv::handle_mmap_fault (addr=<optimized out>, 
    sig=<optimized out>, ef=<optimized out>) at libc/signal.cc:139
#7  0x000000000032a54c in mmu::vm_fault (addr=<optimized out>, 
    addr@entry=35184381417016, ef=ef@entry=0xffff800004198088)
    at core/mmu.cc:1337
#8  0x00000000003881d9 in page_fault (ef=0xffff800004198088)
    at arch/x64/mmu.cc:38
#9  <signal handler called>
#10 0x0000100001c0ed60 in boost::filesystem::path::m_parent_path_end() const ()
#11 0x0000100001c10d5c in boost::filesystem::path::parent_path() const ()
#12 0x0000100001c096cd in boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*) ()
#13 0x0000100000c97d0c in boost::filesystem::create_directories (p=...)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/filesystem/operations.hpp:399
#14 httpserver::api::file::put_file_handler::handle (this=<optimized out>, 
    path=..., params=<optimized out>, req=..., rep=...) at api/file.cc:413
#15 0x0000100000c6433c in httpserver::routes::handle (this=<optimized out>, 
    path="/file/foo", req=..., rep=...) at routes.cc:48
#16 0x0000100000c5f012 in http::server::request_handler::handle_request (
    this=0xffffa000038ae2c8, req=..., rep=...) at request_handler.cc:113
#17 0x0000100000c8dcca in http::server::connection::<lambda(boost::system::error_code, std::size_t)>::operator() (__closure=0xffffa0000559a2c0, 
    bytes_transferred=<optimized out>, ec=...) at connection.cc:278
#18 std::_Function_handler<void(boost::system::error_code, long unsigned int), http::server::connection::do_read()::<lambda(boost::system::error_code, std::size_t)> >::_M_invoke(const std::_Any_data &, <unknown type in /home/nyh/osv/modules/httpserver/libhttpserver.so, CU 0x43190d, DIE 0x466952>, <unknown type in /home/nyh/osv/modules/httpserver/libhttpserver.so, CU 0x43190d, DIE 0x466957>) (
    __functor=..., __args#0=<optimized out>, __args#1=<optimized out>)
    at /usr/include/c++/5.3.1/functional:1871
#19 0x0000100000c89343 in std::function<void (boost::system::error_code, unsigned long)>::operator()(boost::system::error_code, unsigned long) const (
    __args#1=156, __args#0=..., this=0x2000001ff4c0)
    at /usr/include/c++/5.3.1/functional:2271
#20 boost::asio::detail::binder2<std::function<void (boost::system::error_code, unsigned long)>, boost::system::error_code, unsigned long>::operator()() (
    this=0x2000001ff4c0)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/bind_handler.hpp:127
#21 boost::asio::asio_handler_invoke<boost::asio::detail::binder2<std::function<void (boost::system::error_code, unsigned long)>, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<std::function<void (boost::system::error_code, unsigned long)>, boost::system::error_code, unsigned long>&, ...) (
    function=...)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/handler_invoke_hook.hpp:69
#22 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<std::function<void (boost::system::error_code, unsigned long)>, boost::system::error_code, unsigned long>, std::function<void (boost::system::error_code, unsigned long)> >(boost::asio::detail::binder2<std::function<void (boost::system::error_code, unsigned long)>, boost::system::error_code, unsigned long>&, std::function<void (boost::system::error_code, unsigned long)>&) (context=..., function=...)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#23 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, std::function<void (boost::system::error_code, unsigned long)> >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) (
    owner=0xffffa0000394e500, base=<optimized out>)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/reactive_socket_recv_op.hpp:110
#24 0x0000100000c7a5e7 in boost::asio::detail::task_io_service_operation::complete (bytes_transferred=0, ec=..., owner=..., this=0xffffa0000373f700)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/task_io_service_operation.hpp:38
#25 boost::asio::detail::task_io_service::do_run_one (ec=..., this_thread=..., 
    lock=..., this=0xffffa0000394e500)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/impl/task_io_service.ipp:384
#26 boost::asio::detail::task_io_service::run (ec=..., this=0xffffa0000394e500)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/detail/impl/task_io_service.ipp:153
#27 boost::asio::io_service::run (this=<optimized out>)
    at /home/nyh/osv/external/x64/misc.bin/usr/include/boost/asio/impl/io_service.ipp:59
#28 http::server::server::run (this=<optimized out>) at server.cc:100
#29 0x0000100000c84023 in httpserver::global_server::run (_config=...)
    at global_server.cc:92
#30 0x0000100000c54218 in main (argc=<optimized out>, argv=<optimized out>)
    at main.cc:48
#31 0x000000000040dc93 in osv::application::run_main (
    this=this@entry=0xffffa00002c81f10, path="/libhttpserver.so", 
    argc=argc@entry=1, argv=argv@entry=0xffffa00001f91180) at core/app.cc:293
#32 0x0000000000410563 in osv::application::run_main (
    this=this@entry=0xffffa00002c81f10) at core/app.cc:310
#33 0x000000000020c0bf in osv::application::main (this=0xffffa00002c81f10)
    at core/app.cc:238
#34 0x0000000000410859 in osv::application::<lambda(void*)>::operator() (
    __closure=0x0, app=<optimized out>) at core/app.cc:188
#35 osv::application::<lambda(void*)>::_FUN(void *) () at core/app.cc:190
#36 0x000000000043b206 in pthread_private::pthread::<lambda()>::operator() (
    __closure=0xffffa00003a5fc00) at libc/pthread.cc:101
#37 std::_Function_handler<void(), pthread_private::pthread::pthread(void* (*)(void*), void*, sigset_t, const pthread_private::thread_attr*)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/5.3.1/functional:1871
#38 0x00000000003e3ec7 in sched::thread_main_c (t=0xffff800004193050)
    at arch/x64/arch-switch.hh:164
#39 0x0000000000388076 in thread_main () at arch/x64/entry.S:113

At frame 14, we have in api/file.cc a call to boost::filesystem::create_directories("/foo"), which we see in frame 13 as a call to create_directories(const path& p) with

$1 = (const boost::filesystem::path &) @0x2000001fe6c0: {
  static preferred_separator = 47 '/', m_pathname = "/foo"}

But this crashes in a call to boost::filesystem::path::parent_path()..

If this is not a straighforward Boost bug, could we have yet again a bug where we take parts of different versions of Boost?

When I debug with gdb, it tells me about "/home/nyh/osv/external/x64/misc.bin/usr/include/boost/filesystem/operations.hpp:399" yet I thought I compiled with the system boost, not the one from external/.

My guess is that the cli module is compiled with the wrong Boost....

@nyh
Copy link
Contributor

nyh commented Apr 4, 2016

I confirmed that this is a symptom of #687 - I modified module/httpserver to compile httpserver with the host's Boost instead of trying to use the one in external/, and mkdir started working correctly.

@nyh nyh closed this as completed in f64563a Apr 4, 2016
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

2 participants