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
ceaf73d7
Commit
ceaf73d7
authored
Nov 16, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the panicstr a VSM allocation
parent
54e7eb52
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
29 deletions
+21
-29
cache_panic.c
bin/varnishd/cache/cache_panic.c
+9
-17
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+0
-1
common.h
bin/varnishd/common/common.h
+3
-0
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+3
-4
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+0
-3
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+6
-0
configure.ac
configure.ac
+0
-1
vsm_int.h
include/vapi/vsm_int.h
+0
-3
No files found.
bin/varnishd/cache/cache_panic.c
View file @
ceaf73d7
...
...
@@ -40,8 +40,6 @@
#include "cache.h"
#include "vapi/vsm_int.h"
#include "cache_backend.h"
#include "waiter/cache_waiter.h"
#include "vcl.h"
...
...
@@ -58,6 +56,10 @@
static
struct
vsb
vsps
,
*
vsp
;
static
pthread_mutex_t
panicstr_mtx
=
PTHREAD_MUTEX_INITIALIZER
;
/* Initialized in mgt_shmem.c, points into VSM */
char
*
PAN_panicstr
;
unsigned
PAN_panicstr_len
;
/*--------------------------------------------------------------------*/
static
void
...
...
@@ -354,20 +356,8 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_bcat
(
vsp
,
""
,
1
);
/* NUL termination */
if
(
cache_param
->
diag_bitmap
&
0x4000
)
(
void
)
fputs
(
VSM_head
->
panicstr
,
stderr
);
#ifdef HAVE_ABORT2
if
(
cache_param
->
diag_bitmap
&
0x8000
)
{
void
*
arg
[
1
];
char
*
p
;
for
(
p
=
VSM_head
->
panicstr
;
*
p
;
p
++
)
if
(
*
p
==
'\n'
)
*
p
=
' '
;
arg
[
0
]
=
VSM_head
->
panicstr
;
abort2
(
VSM_head
->
panicstr
,
1
,
arg
);
}
#endif
(
void
)
fputs
(
PAN_panicstr
,
stderr
);
if
(
cache_param
->
diag_bitmap
&
0x1000
)
exit
(
4
);
else
...
...
@@ -382,6 +372,8 @@ PAN_Init(void)
VAS_Fail
=
pan_ic
;
vsp
=
&
vsps
;
AN
(
VSB_new
(
vsp
,
VSM_head
->
panicstr
,
sizeof
VSM_head
->
panicstr
,
AN
(
PAN_panicstr
);
AN
(
PAN_panicstr_len
);
AN
(
VSB_new
(
vsp
,
PAN_panicstr
,
PAN_panicstr_len
,
VSB_FIXEDLEN
));
}
bin/varnishd/cache/cache_shmlog.c
View file @
ceaf73d7
...
...
@@ -317,7 +317,6 @@ VSL_Init(void)
vsl_wrap
();
VSM_head
->
starttime
=
(
intmax_t
)
VTIM_real
();
memset
(
VSM_head
->
panicstr
,
'\0'
,
sizeof
*
VSM_head
->
panicstr
);
memset
(
VSC_C_main
,
0
,
sizeof
*
VSC_C_main
);
VSM_head
->
child_pid
=
getpid
();
}
...
...
bin/varnishd/common/common.h
View file @
ceaf73d7
...
...
@@ -50,6 +50,9 @@ extern pid_t mgt_pid;
/* mgt_shmem.c */
extern
struct
VSC_C_main
*
VSC_C_main
;
#define PAN_CLASS "Panic"
extern
char
*
PAN_panicstr
;
extern
unsigned
PAN_panicstr_len
;
/* varnishd.c */
struct
vsb
;
...
...
bin/varnishd/mgt/mgt_child.c
View file @
ceaf73d7
...
...
@@ -47,7 +47,6 @@
#include "common/heritage.h"
#include "common/params.h"
#include "vapi/vsm_int.h"
#include "vbm.h"
#include "vcli.h"
#include "vcli_priv.h"
...
...
@@ -428,10 +427,10 @@ mgt_handle_panicstr(pid_t r)
{
char
time_str
[
30
];
if
(
VSM_head
->
panicstr
[
0
]
==
'\0'
)
if
(
PAN_
panicstr
[
0
]
==
'\0'
)
return
;
REPORT
(
LOG_ERR
,
"Child (%jd) Panic message: %s"
,
(
intmax_t
)
r
,
VSM_head
->
panicstr
);
(
intmax_t
)
r
,
PAN_
panicstr
);
if
(
child_panic
)
VSB_delete
(
child_panic
);
...
...
@@ -439,7 +438,7 @@ mgt_handle_panicstr(pid_t r)
XXXAN
(
child_panic
);
VTIM_format
(
VTIM_real
(),
time_str
);
VSB_printf
(
child_panic
,
"Last panic at: %s
\n
"
,
time_str
);
VSB_cat
(
child_panic
,
VSM_head
->
panicstr
);
VSB_cat
(
child_panic
,
PAN_
panicstr
);
AZ
(
VSB_finish
(
child_panic
));
}
...
...
bin/varnishd/mgt/mgt_param.c
View file @
ceaf73d7
...
...
@@ -843,9 +843,6 @@ static const struct parspec input_parspec[] = {
" 0x00001000 - do not core-dump child process.
\n
"
" 0x00002000 - only short panic message.
\n
"
" 0x00004000 - panic to stderr.
\n
"
#ifdef HAVE_ABORT2
" 0x00008000 - panic to abort2().
\n
"
#endif
" 0x00010000 - synchronize shmlog.
\n
"
" 0x00020000 - synchronous start of persistence.
\n
"
" 0x00040000 - release VCL early.
\n
"
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
ceaf73d7
...
...
@@ -331,6 +331,12 @@ mgt_SHM_Init(const char *l_arg)
vsl_log_start
[
1
]
=
VSL_ENDMARKER
;
VWMB
();
PAN_panicstr_len
=
64
*
1024
;
PAN_panicstr
=
VSM_Alloc
(
PAN_panicstr_len
,
PAN_CLASS
,
""
,
""
);
AN
(
PAN_panicstr
);
/* XXX: shouldn't VSM_Alloc zero ? */
memset
(
PAN_panicstr
,
'\0'
,
PAN_panicstr_len
);
do
*
vsl_log_start
=
random
()
&
0xffff
;
while
(
*
vsl_log_start
==
0
);
...
...
configure.ac
View file @
ceaf73d7
...
...
@@ -187,7 +187,6 @@ AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strptime])
AC_CHECK_FUNCS([fmtcheck])
AC_CHECK_FUNCS([getdtablesize])
AC_CHECK_FUNCS([abort2])
AC_CHECK_FUNCS([timegm])
AC_CHECK_FUNCS([nanosleep])
AC_CHECK_FUNCS([setppriv])
...
...
include/vapi/vsm_int.h
View file @
ceaf73d7
...
...
@@ -65,9 +65,6 @@ struct VSM_head {
unsigned
shm_size
;
/* Panic message buffer */
char
panicstr
[
64
*
1024
];
unsigned
alloc_seq
;
/* Must be last element */
struct
VSM_chunk
head
;
...
...
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