Skip to content
  • Karthik Kamath's avatar
    75271e51
    BUG#24566529: BACKPORT BUG#23575445 TO 5.6 · 75271e51
    Karthik Kamath authored
    Stack traces were not printed by our signal handler on FreeBSD
    since we didn't find backtrace(). However, since FreeBSD 10.0
    backtrace() is available, but it requires the execinfo library.
    
    This patch fixes the problem by adding -lexecinfo when
    doing CMake configure checks and when linking the server
    (if execinfo exists). Note that the number of stack frames
    returned by backtrace() seems very limited - at least on
    FreeBSD 10.2.
    
    Also, the PTR_SANE macro which tries to check if a pointer
    is invalid (used when printing pointer values in stack traces)
    gave false negatives on OSX/FreeBSD. On these platforms we
    now simply check if the pointer is non-null. This also removes
    a sbrk() deprecation warning when building on OS X. (It was
    before only disabled with building using XCode).
    75271e51
    BUG#24566529: BACKPORT BUG#23575445 TO 5.6
    Karthik Kamath authored
    Stack traces were not printed by our signal handler on FreeBSD
    since we didn't find backtrace(). However, since FreeBSD 10.0
    backtrace() is available, but it requires the execinfo library.
    
    This patch fixes the problem by adding -lexecinfo when
    doing CMake configure checks and when linking the server
    (if execinfo exists). Note that the number of stack frames
    returned by backtrace() seems very limited - at least on
    FreeBSD 10.2.
    
    Also, the PTR_SANE macro which tries to check if a pointer
    is invalid (used when printing pointer values in stack traces)
    gave false negatives on OSX/FreeBSD. On these platforms we
    now simply check if the pointer is non-null. This also removes
    a sbrk() deprecation warning when building on OS X. (It was
    before only disabled with building using XCode).
Loading