tot dumps core

Dag-Erling Smørgrav des at linpro.no
Tue Jul 18 22:47:26 CEST 2006


"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> I've seen something like it here also now.
>
> Looks like pointer-fandango :-(

I thought the problem might be 64-bit-specific, so I tested on a VIA
Epia system, and I'm getting something completely different:

root at dd ~varnish/varnish-cache# ./bin/varnishd/varnishd -p 80 -b www.des.no:80 -w 1
zsh: segmentation fault (core dumped)  ./bin/varnishd/varnishd -p 80 -b www.des.no:80 -w 1
root at dd ~varnish/varnish-cache# gdb ./bin/varnishd/.libs/lt-varnishd lt-varnishd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `lt-varnishd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvarnish/.libs/libvarnish.so.0...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvarnish/.libs/libvarnish.so.0
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvcl/.libs/libvcl.so.0...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvcl/.libs/libvcl.so.0
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/contrib/libevent/.libs/libevent-1.2.so.1...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/contrib/libevent/.libs/libevent-1.2.so.1
Reading symbols from /lib/libpthread.so.2...done.
Loaded symbols for /lib/libpthread.so.2
Reading symbols from /lib/libmd.so.3...done.
Loaded symbols for /lib/libmd.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  VCC_T_render (f=0xbfbfe3b0, info=0xbfbfd0c0, args=0xbfbfcfec)
    at vcl_compile.c:1894
1894            return (fprintf(f, "%*.*s",
[New LWP 100098]
(gdb) where
#0  VCC_T_render (f=0xbfbfe3b0, info=0xbfbfd0c0, args=0xbfbfcfec)
    at vcl_compile.c:1894
#1  0x2817299c in __printf_out () from /lib/libc.so.7
#2  0x28172fe9 in __xvprintf () from /lib/libc.so.7
#3  0x281b3712 in __vfprintf () from /lib/libc.so.7
#4  0x28149e31 in vsnprintf () from /lib/libc.so.7
#5  0x08057d61 in sbuf_vprintf (s=0x8270180,
    fmt=0x2809d154 "#define VGC_backend_%T (VCL_conf.backend[%d])\n",
    ap=0xbfbfe47c "À\001'\b") at sbuf.c:311
#6  0x280974fa in Fh (tl=0xbfbfe8e0, indent=1,
    fmt=0x2809d154 "#define VGC_backend_%T (VCL_conf.backend[%d])\n")
    at vcl_compile.c:345
#7  0x28098bc6 in Backend (tl=0xbfbfe8e0) at vcl_compile.c:1257
#8  0x28099a1f in Parse (tl=0xbfbfe8e0) at vcl_compile.c:1378
#9  0x2809a7b6 in VCC_Compile (sb=0xbfbfcfec,
    b=0x8260180 "backend default {\n    set backend.host = \"         http\";\n    set backend.port = \"\a\";\n}\n", e=0x82601d8 "") at vcl_compile.c:1805
#10 0x08056a42 in vcl_default (bflag=0xbfbfeb79 "www.des.no:80")
    at varnishd.c:139
#11 0x080578b3 in main (argc=7, argv=0xbfbfe9e4) at varnishd.c:598
(gdb) p *f
$1 = {_p = 0x828017f "¥", _r = -1077943324, _w = 0, _flags = 520, _file = -1,
  _bf = {_base = 0x8280175 "#define VG¥", _size = 10}, _lbfsize = 671512823,
  _cookie = 0x28091080, _close = 0x280968bf <object.2+2483>,
  _read = 0x2808d000, _seek = 0x28086118 <__collate_load_error+144>,
  _write = 0x28086118 <__collate_load_error+144>, _ub = {
    _base = 0x2809f648 "\214\225", _size = 136774016}, _extra = 0xbfbfe310,
  _ur = 134577505, _ubuf = "a\001(", _nbuf = "\b", _lb = {
    _base = 0x1f <Address 0x1f out of bounds>, _size = 671729773},
  _blksize = -1077943224, _offset = 2884784259749380097}
(gdb) up 5
#5  0x08057d61 in sbuf_vprintf (s=0x8270180,
    fmt=0x2809d154 "#define VGC_backend_%T (VCL_conf.backend[%d])\n",
    ap=0xbfbfe47c "À\001'\b") at sbuf.c:311
311                     len = vsnprintf(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1,
(gdb) up
#6  0x280974fa in Fh (tl=0xbfbfe8e0, indent=1,
    fmt=0x2809d154 "#define VGC_backend_%T (VCL_conf.backend[%d])\n")
    at vcl_compile.c:345
345             sbuf_vprintf(tl->fh, fmt, ap);
(gdb) up
#7  0x28098bc6 in Backend (tl=0xbfbfe8e0) at vcl_compile.c:1257
1257            Fh(tl, 1, "#define VGC_backend_%T (VCL_conf.backend[%d])\n",
(gdb) l
1252            ExpectErr(tl, ID);
1253            t_be = tl->t;
1254            AddDef(tl, tl->t, R_BACKEND);
1255            if (tl->nbackend == 0)
1256                    AddRef(tl, tl->t, R_BACKEND);
1257            Fh(tl, 1, "#define VGC_backend_%T (VCL_conf.backend[%d])\n",
1258                tl->t, tl->nbackend);
1259            Fc(tl, 0, "static void\n");
1260            Fc(tl, 1, "VGC_init_backend_%T (void)\n", tl->t);
1261            Fc(tl, 1, "{\n");
(gdb) p tl->t
$2 = (struct token *) 0x82701c0
(gdb) p tl->nbackend
$3 = 0
(gdb) p *(tl->t)
$4 = {tok = 166,
  b = 0x8260188 "default {\n    set backend.host = \"         http\";\n    set backend.port = \"\a\";\n}\n",
  e = 0x826018f " {\n    set backend.host = \"         http\";\n    set backend.port = \"\a\";\n}\n", list = {tqe_next = 0x82701e0, tqe_prev = 0x82701ac},
  cnt = 0}

Note that the value assigned to backend.host is completely wrong.

However, I can't exclude the possibility that there may be something
wrong with the machine, since:

root at dd ~varnish/varnish-cache# ./bin/varnishd/varnishd -\?
zsh: segmentation fault (core dumped)  ./bin/varnishd/varnishd -\?
root at dd ~varnish/varnish-cache# !gd
gdb ./bin/varnishd/.libs/lt-varnishd lt-varnishd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `lt-varnishd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvarnish/.libs/libvarnish.so.0...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvarnish/.libs/libvarnish.so.0
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvcl/.libs/libvcl.so.0...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/lib/libvcl/.libs/libvcl.so.0
Reading symbols from /usr/scratch/des/varnish/trunk/varnish-cache/contrib/libevent/.libs/libevent-1.2.so.1...done.
Loaded symbols for /usr/scratch/des/varnish/trunk/varnish-cache/contrib/libevent/.libs/libevent-1.2.so.1
Reading symbols from /lib/libpthread.so.2...done.
Loaded symbols for /lib/libpthread.so.2
Reading symbols from /lib/libmd.so.3...done.
Loaded symbols for /lib/libmd.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x281ba145 in strlen () from /lib/libc.so.7
[New LWP 100098]
(gdb) where
#0  0x281ba145 in strlen () from /lib/libc.so.7
#1  0x2817059e in __printf_render_str () from /lib/libc.so.7
#2  0x28172a0f in __printf_out () from /lib/libc.so.7
#3  0x28172f75 in __xvprintf () from /lib/libc.so.7
#4  0x281b3712 in __vfprintf () from /lib/libc.so.7
#5  0x281b6942 in vfprintf () from /lib/libc.so.7
#6  0x281a558b in fprintf () from /lib/libc.so.7
#7  0x2810b5c2 in getopt () from /lib/libc.so.7
#8  0x08057845 in main (argc=673000184, argv=0xbfbfeb8a) at varnishd.c:577

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-dev mailing list