[Boost-bugs] [Boost C++ Libraries] #12400: libunwind fails to detect end-of-stack with boost::context

Subject: [Boost-bugs] [Boost C++ Libraries] #12400: libunwind fails to detect end-of-stack with boost::context
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-08-18 12:17:15


#12400: libunwind fails to detect end-of-stack with boost::context
-------------------------------------+---------------------
 Reporter: mmayorga@… | Owner: olli
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: context
  Version: Boost Development Trunk | Severity: Problem
 Keywords: libunwind context |
-------------------------------------+---------------------
 make_fcontext initialises a new stack, but it is making libunwind not to
 find its termination, presumably because it is initialising it by pointing
 to a call to program exit.

 Problematic source:
 https://github.com/boostorg/context/blob/develop/src/asm/make_x86_64_sysv_elf_gas.S

 leaq -0x40(%rax), %rax moves the stack pointer down 64 bytes
 The top thing on the stack at the highest address is what the comment
 calls EXIT, and is a pointer to the finish label.
 There is nothing after that
 No frame where RBP is null or an undefine dIP
 Boost does not put anything after that at all

 From libunwind sources:
 file Gstep.c, end-of stack detection algorithm:

 /* x86_64 ABI specifies that end of call-chain is marked with a NULL RBP
 or undefined return address */
         if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP])
             || DWARF_IS_NULL_LOC(c->dwarf.loc[c->dwarf.ret_addr_column]))
           {
             c->dwarf.ip = 0;
             ret = 0;
           }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12400>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC