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
64b3e63b
Commit
64b3e63b
authored
Jun 09, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use setrlimit(2) to disable core dumps.
VTC's change because the exit-instead-of-abort-hack goes away.
parent
d5c62621
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
20 deletions
+26
-20
cache_panic.c
bin/varnishd/cache/cache_panic.c
+1
-4
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+11
-4
c00057.vtc
bin/varnishtest/tests/c00057.vtc
+2
-2
p00007.vtc
bin/varnishtest/tests/p00007.vtc
+1
-1
t02004.vtc
bin/varnishtest/tests/t02004.vtc
+5
-5
v00010.vtc
bin/varnishtest/tests/v00010.vtc
+5
-3
v00063.vtc
bin/varnishtest/tests/v00063.vtc
+1
-1
No files found.
bin/varnishd/cache/cache_panic.c
View file @
64b3e63b
...
...
@@ -811,10 +811,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_cat
(
pan_vsb
,
"
\n
"
);
VSB_putc
(
pan_vsb
,
'\0'
);
/* NUL termination */
if
(
FEATURE
(
FEATURE_NO_COREDUMP
))
exit
(
4
);
else
abort
();
abort
();
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/mgt/mgt_child.c
View file @
64b3e63b
...
...
@@ -43,6 +43,9 @@
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "mgt.h"
...
...
@@ -295,6 +298,7 @@ mgt_launch_child(struct cli *cli)
char
*
p
;
struct
vev
*
e
;
int
i
,
cp
[
2
];
struct
rlimit
rl
[
1
];
if
(
child_state
!=
CH_STOPPED
&&
child_state
!=
CH_DIED
)
return
;
...
...
@@ -335,6 +339,12 @@ mgt_launch_child(struct cli *cli)
}
if
(
pid
==
0
)
{
if
(
MGT_FEATURE
(
FEATURE_NO_COREDUMP
))
{
memset
(
rl
,
0
,
sizeof
*
rl
);
rl
->
rlim_cur
=
0
;
AZ
(
setrlimit
(
RLIMIT_CORE
,
rl
));
}
/* Redirect stdin/out/err */
VFIL_null_fd
(
STDIN_FILENO
);
assert
(
dup2
(
heritage
.
std_fd
,
STDOUT_FILENO
)
==
STDOUT_FILENO
);
...
...
@@ -463,10 +473,7 @@ kill_child(void)
int
i
,
error
;
VJ_master
(
JAIL_MASTER_KILL
);
if
(
MGT_FEATURE
(
FEATURE_NO_COREDUMP
))
i
=
kill
(
child_pid
,
SIGKILL
);
else
i
=
kill
(
child_pid
,
SIGQUIT
);
i
=
kill
(
child_pid
,
SIGQUIT
);
error
=
errno
;
VJ_master
(
JAIL_MASTER_LOW
);
errno
=
error
;
...
...
bin/varnishtest/tests/c00057.vtc
View file @
64b3e63b
...
...
@@ -60,7 +60,7 @@ client c1 {
rxresp
} -run
varnish v1 -expectexit 0x
2
0
varnish v1 -expectexit 0x
4
0
####################
...
...
@@ -91,4 +91,4 @@ varnish v2 -clijson "panic.show -j"
varnish v2 -cliok "panic.clear"
varnish v2 -expectexit 0x
2
0
varnish v2 -expectexit 0x
4
0
bin/varnishtest/tests/p00007.vtc
View file @
64b3e63b
...
...
@@ -80,4 +80,4 @@ client c1 {
expect resp.bodylen == 48
} -run
varnish v1 -expectexit 0x
2
0
varnish v1 -expectexit 0x
4
0
bin/varnishtest/tests/t02004.vtc
View file @
64b3e63b
...
...
@@ -5,6 +5,10 @@ server s1 {
txresp
} -start
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set feature +no_coredump"
varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -vcl+backend {
import vtc;
...
...
@@ -13,10 +17,6 @@ varnish v1 -vcl+backend {
}
} -start
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set feature +no_coredump"
varnish v1 -cliok "param.set debug +syncvsl"
client c1 {
stream 1 {
txreq -hdr :authority foo.bar -pad cotton
...
...
@@ -28,4 +28,4 @@ delay 2
varnish v1 -cliok "panic.clear"
varnish v1 -expectexit 0x
2
0
varnish v1 -expectexit 0x
4
0
bin/varnishtest/tests/v00010.vtc
View file @
64b3e63b
...
...
@@ -24,7 +24,10 @@ server s1 {
txresp -hdr "Foo: foo" -body "abcdef\n"
} -start
varnish v1 -arg "-sdefault,1m" -vcl+backend {
varnish v1 -arg "-sdefault,1m"
varnish v1 -cliok "param.set feature +no_coredump"
varnish v1 -vcl+backend {
import vtc;
import debug;
...
...
@@ -49,7 +52,6 @@ varnish v1 -cliok "stop"
varnish v1 -cliok "start"
varnish v1 -wait-running
varnish v1 -expect MGT.child_panic == 0
varnish v1 -cliok "param.set feature +no_coredump"
client c1 {
txreq -url "/"
...
...
@@ -92,4 +94,4 @@ client c1 {
} -run
varnish v1 -cliok "panic.clear -z"
varnish v1 -expectexit 0x
2
0
varnish v1 -expectexit 0x
4
0
bin/varnishtest/tests/v00063.vtc
View file @
64b3e63b
...
...
@@ -3,7 +3,7 @@ varnishtest "Create a backend after a COLD event"
server s1 -start
varnish v1 -cliok "param.set feature +no_coredump"
varnish v1 -expectexit 0x
2
0
varnish v1 -expectexit 0x
4
0
varnish v1 -vcl+backend {
import debug;
sub vcl_init {
...
...
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