Skip to content

Print error, instead of crash, when running non-PIE executable #463

Closed
@nyh

Description

@nyh

Trying to run a position-dependent (non-PIE) shared exectuable in OSv, I got a crash with the following backtrace.

I don't expect this to work (see issue #190), but I would prefer to get an error message saying this is not supported, and not a crash.

#7  0x000000000038980a in page_fault (ef=0xffff800002c36088)
    at /home/nyh/osv/arch/x64/mmu.cc:38
#8  <signal handler called>
#9  0x00000000004aeba7 in std::string::_Rep::_M_dispose(std::allocator<char> const&) [clone .part.12] ()
#10 0x00000000004005ef in ~basic_string (this=0x2000001ff960,  __in_chrg=<optimized out>)
    at /home/nyh/osv/external/x64/gcc.bin/usr/include/c++/4.8.2/bits/basic_string.h:539
#11 ~basic_stringbuf (this=0x2000001ff918, __in_chrg=<optimized out>)
    at /home/nyh/osv/external/x64/gcc.bin/usr/include/c++/4.8.2/sstream:64
#12 ~basic_ostringstream (this=0x1, __in_chrg=<optimized out>,  __vtt_parm=<optimized out>)
    at /home/nyh/osv/external/x64/gcc.bin/usr/include/c++/4.8.2/sstream:453
#13 osv::sprintf<char const*, int> (fmt=<optimized out>)
    at /home/nyh/osv/include/osv/printf.hh:50
#14 0x0000000000340a49 in elf::program::get_library (this=0xffff9000015e8000, 
    name="a.out", extra_path=std::vector of length 0, capacity 0)
    at /home/nyh/osv/core/elf.cc:1057
#15 0x00000000003fc02b in osv::application::application (
    this=0xffffa000013c3118, command="a.out", args=...)
    at /home/nyh/osv/core/app.cc:83
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions