Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
8db414a5
Commit
8db414a5
authored
Sep 04, 2019
by
Guillaume Quintard
Committed by
guillaume quintard
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Offer a configure --with-unwind switch
parent
ad731128
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
6 deletions
+80
-6
.travis.yml
.travis.yml
+4
-3
Makefile.am
bin/varnishd/Makefile.am
+5
-0
cache_panic.c
bin/varnishd/cache/cache_panic.c
+47
-0
configure.ac
configure.ac
+19
-3
changes.rst
doc/changes.rst
+5
-0
No files found.
.travis.yml
View file @
8db414a5
...
@@ -18,9 +18,10 @@ jobs:
...
@@ -18,9 +18,10 @@ jobs:
-
nghttp2
-
nghttp2
-
python3-docutils
-
python3-docutils
-
python3-sphinx
-
python3-sphinx
-
libunwind-dev
before_script
:
before_script
:
-
./autogen.sh
-
./autogen.sh
-
./configure
-
./configure
--with-unwind
script
:
&script-common
script
:
&script-common
-
|
-
|
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
...
@@ -51,7 +52,7 @@ jobs:
...
@@ -51,7 +52,7 @@ jobs:
export UBSAN_OPTIONS=halt_on_error=1,print_stacktrace=1,use_sigaltstack=0,suppressions=$(pwd)/tools/ubsan.suppr
export UBSAN_OPTIONS=halt_on_error=1,print_stacktrace=1,use_sigaltstack=0,suppressions=$(pwd)/tools/ubsan.suppr
export CC=clang-8
export CC=clang-8
-
./autogen.sh
-
./autogen.sh
-
./configure --enable-developer-warnings --enable-debugging-symbols --disable-stack-protector --with-persistent-storage --enable-asan --enable-ubsan
-
./configure --
with-unwind --
enable-developer-warnings --enable-debugging-symbols --disable-stack-protector --with-persistent-storage --enable-asan --enable-ubsan
-
stage
:
test
-
stage
:
test
os
:
osx
os
:
osx
osx_image
:
xcode10.2
osx_image
:
xcode10.2
...
@@ -80,7 +81,7 @@ jobs:
...
@@ -80,7 +81,7 @@ jobs:
-
export PATH=$PATH:$(echo $(pwd)/cov-analysis-*/bin)
-
export PATH=$PATH:$(echo $(pwd)/cov-analysis-*/bin)
script
:
script
:
-
./autogen.sh
-
./autogen.sh
-
./configure
-
./configure
--with-unwind
-
cov-build --dir cov-int make
-
cov-build --dir cov-int make
-
tar cfz varnish.tgz cov-int
-
tar cfz varnish.tgz cov-int
-
curl --form token="$COVTOKEN"
-
curl --form token="$COVTOKEN"
...
...
bin/varnishd/Makefile.am
View file @
8db414a5
...
@@ -177,6 +177,11 @@ varnishd_LDADD = \
...
@@ -177,6 +177,11 @@ varnishd_LDADD = \
@PCRE_LIBS@
\
@PCRE_LIBS@
\
${
DL_LIBS
}
${
PTHREAD_LIBS
}
${
NET_LIBS
}
${
RT_LIBS
}
${
LIBM
}
${
DL_LIBS
}
${
PTHREAD_LIBS
}
${
NET_LIBS
}
${
RT_LIBS
}
${
LIBM
}
if
WITH_UNWIND
varnishd_CFLAGS
+=
-DUNW_LOCAL_ONLY
varnishd_LDADD
+=
${
LIBUNWIND_LIBS
}
endif
noinst_PROGRAMS
=
vhp_gen_hufdec
noinst_PROGRAMS
=
vhp_gen_hufdec
vhp_gen_hufdec_SOURCES
=
hpack/vhp_gen_hufdec.c
vhp_gen_hufdec_SOURCES
=
hpack/vhp_gen_hufdec.c
vhp_gen_hufdec_CFLAGS
=
@SAN_CFLAGS@
\
vhp_gen_hufdec_CFLAGS
=
@SAN_CFLAGS@
\
...
...
bin/varnishd/cache/cache_panic.c
View file @
8db414a5
...
@@ -29,7 +29,11 @@
...
@@ -29,7 +29,11 @@
#include "config.h"
#include "config.h"
#ifdef WITH_UNWIND
#include <libunwind.h>
#else
#include <execinfo.h>
#include <execinfo.h>
#endif
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <signal.h>
#include <signal.h>
...
@@ -609,6 +613,47 @@ pan_sess(struct vsb *vsb, const struct sess *sp)
...
@@ -609,6 +613,47 @@ pan_sess(struct vsb *vsb, const struct sess *sp)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
#ifdef WITH_UNWIND
static
void
pan_backtrace
(
struct
vsb
*
vsb
)
{
unw_cursor_t
cursor
;
unw_context_t
uc
;
unw_word_t
ip
,
sp
;
unw_word_t
offp
;
char
fname
[
1024
];
int
ret
;
VSB_printf
(
vsb
,
"Backtrace:
\n
"
);
VSB_indent
(
vsb
,
2
);
ret
=
unw_getcontext
(
&
uc
);
if
(
ret
!=
0
)
{
VSB_printf
(
vsb
,
"Backtrace not available "
"(unw_getcontext returned %d)
\n
"
,
ret
);
return
;
}
unw_init_local
(
&
cursor
,
&
uc
);
if
(
ret
!=
0
)
{
VSB_printf
(
vsb
,
"Backtrace not available "
"(unw_init_local returned %d)
\n
"
,
ret
);
return
;
}
while
(
unw_step
(
&
cursor
)
>
0
)
{
fname
[
0
]
=
'\0'
;
ip
=
sp
=
0
;
unw_get_reg
(
&
cursor
,
UNW_REG_IP
,
&
ip
);
unw_get_reg
(
&
cursor
,
UNW_REG_SP
,
&
sp
);
unw_get_proc_name
(
&
cursor
,
fname
,
sizeof
(
fname
),
&
offp
);
VSB_printf
(
vsb
,
"ip=0x%lx, sp=0x%lx <%s+0x%lx>
\n
"
,
(
long
)
ip
,
(
long
)
sp
,
fname
[
0
]
?
fname
:
"???"
,
offp
);
}
VSB_indent
(
vsb
,
-
2
);
}
#else
/* WITH_UNWIND */
#define BACKTRACE_LEVELS 10
#define BACKTRACE_LEVELS 10
static
void
static
void
...
@@ -651,6 +696,8 @@ pan_backtrace(struct vsb *vsb)
...
@@ -651,6 +696,8 @@ pan_backtrace(struct vsb *vsb)
VSB_indent
(
vsb
,
-
2
);
VSB_indent
(
vsb
,
-
2
);
}
}
#endif
/* WITH_UNWIND */
#ifdef HAVE_PTHREAD_GETATTR_NP
#ifdef HAVE_PTHREAD_GETATTR_NP
static
void
static
void
pan_threadattr
(
struct
vsb
*
vsb
)
pan_threadattr
(
struct
vsb
*
vsb
)
...
...
configure.ac
View file @
8db414a5
...
@@ -342,9 +342,25 @@ esac
...
@@ -342,9 +342,25 @@ esac
AC_SUBST(JEMALLOC_LDADD)
AC_SUBST(JEMALLOC_LDADD)
AC_CHECK_FUNCS([setproctitle])
AC_CHECK_FUNCS([setproctitle])
AC_SEARCH_LIBS(backtrace, [execinfo], [], [
AC_MSG_ERROR([Could not find backtrace() support])
# if the default libexecinfo on alpine causes issues, you can use libunwind
])
AC_ARG_WITH([unwind],
[AS_HELP_STRING([--with-unwind],
[use libunwind to print stacktraces (use libexecinfo otherwise). Recommended on alpine linux. Defaults to no.])])
if test "$with_unwind" = yes; then
PKG_CHECK_MODULES([LIBUNWIND], [libunwind])
AC_DEFINE([WITH_UNWIND], [1],
[Define to 1 to use libunwind instead of libexecinfo])
else
AC_SEARCH_LIBS(backtrace, [execinfo], [], [
AC_MSG_ERROR([Could not find backtrace() support])
])
fi
AM_CONDITIONAL([WITH_UNWIND],
[test "$with_unwind" = yes])
# white lie - we don't actually test it
# white lie - we don't actually test it
AC_MSG_CHECKING([whether daemon() works])
AC_MSG_CHECKING([whether daemon() works])
case $target in
case $target in
...
...
doc/changes.rst
View file @
8db414a5
...
@@ -32,6 +32,11 @@ NEXT (2020-03-15)
...
@@ -32,6 +32,11 @@ NEXT (2020-03-15)
* The ``MAIN.sess_drop`` counter is gone.
* The ``MAIN.sess_drop`` counter is gone.
* New configure switch: --with-unwind. Alpine linux appears to offer a
`libexecinfo` implementation that crashes when called by Varnish, this
offers the alternative of using `libunwind` instead.
================================
================================
Varnish Cache 6.3.0 (2019-09-15)
Varnish Cache 6.3.0 (2019-09-15)
================================
================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment