Assert for error handling sucks

Marcus Rueckert darix at web.de
Mon Jul 23 15:52:03 CEST 2007


hi,

as the subject says. While i was testing my 1.1 rpms for suse I ran into
a "crash" with varnish. I wondered as the error message want really
helpful.

[[[
$ /usr/sbin/varnishd -f /etc/varnish/vcl.conf -T127.0.0.1:6082 -s file,/var/cache/varnish/
file /var/cache/varnish//varnish.fTZLF4 (unlinked) size 46919348723712
bytes (11454919122 fs-blocks, 11454919122 pages)
Assert error in smf_initfile(), storage_file.c line 239:
  Condition((ftruncate(sc->fd, sc->filesize)) == 0) not true.
    errno = 27 (File too large)
]]]

Can this not be handled more gracefully?

For testing i did:
[[[
$/usr/sbin/varnishd -f /etc/varnish/vcl.conf -T127.0.0.1:6082 -s file,/var/cache/varnish/,1024 
Error: size too small, at least 524288 needed
]]]

now i wonder if 524288 is a good default value?
what would you suggest for a package default config?

with kind regards,

    darix

-- 
           openSUSE - SUSE Linux is my linux
               openSUSE is good for you
                   www.opensuse.org
-------------- next part --------------
(gdb) r
Starting program: /usr/sbin/varnishd -f /etc/varnish/vcl.conf -T127.0.0.1:6082 -s file,/var/cache/varnish
[Thread debugging using libthread_db enabled]
[New Thread 47252503396816 (LWP 25764)]
Error while mapping shared library sections:
./bin.XX8mRPjT: No such file or directory.
Error while reading shared library symbols:
./bin.XX8mRPjT: No such file or directory.
Error while reading shared library symbols:
./bin.XX8mRPjT: No such file or directory.
file /var/cache/varnish/varnish.8wVIfz (unlinked) size 47252501147648 bytes (11536255163 fs-blocks, 11536255163 pages)
Assert error in smf_initfile(), storage_file.c line 239:
  Condition((ftruncate(sc->fd, sc->filesize)) == 0) not true.
  errno = 27 (File too large)

Program received signal SIGABRT, Aborted.
[Switching to Thread 47252503396816 (LWP 25764)]
0x00002af9d48deaa5 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00002af9d48deaa5 in raise () from /lib64/libc.so.6
#1  0x00002af9d48dfe60 in abort () from /lib64/libc.so.6
#2  0x00002af9d43717fa in lbv_assert (func=0x4303c3 "smf_initfile", file=0x4301b7 "storage_file.c", line=239, cond=0x4303d0 "(ftruncate(sc->fd, sc->filesize)) == 0", err=27)
    at assert.c:58
#3  0x0000000000424f2c in smf_initfile (sc=0x53d790, size=0x53d0f3 "", newfile=1) at storage_file.c:239
#4  0x0000000000425414 in smf_init (parent=0x53cf80, spec=0x7fffd685659f "/var/cache/varnish") at storage_file.c:334
#5  0x000000000042789a in setup_storage (s_arg=0x7fffd685659a "file,/var/cache/varnish") at varnishd.c:158
#6  0x0000000000428dba in main (argc=0, argv=0x7fffd6854aa8) at varnishd.c:573
(gdb) bt full
#0  0x00002af9d48deaa5 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00002af9d48dfe60 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00002af9d43717fa in lbv_assert (func=0x4303c3 "smf_initfile", file=0x4301b7 "storage_file.c", line=239, cond=0x4303d0 "(ftruncate(sc->fd, sc->filesize)) == 0", err=27)
    at assert.c:58
No locals.
#3  0x0000000000424f2c in smf_initfile (sc=0x53d790, size=0x53d0f3 "", newfile=1) at storage_file.c:239
        __func__ = "smf_initfile"
#4  0x0000000000425414 in smf_init (parent=0x53cf80, spec=0x7fffd685659f "/var/cache/varnish") at storage_file.c:334
        size = 0x53d0f3 ""
        p = 0x53d0e0 "/var/cache/varnish"
        q = 0x53d2d0 ""
        st = {st_dev = 2304, st_ino = 9979057, st_nlink = 3, st_mode = 16872, st_uid = 134, st_gid = 129, pad0 = 0, st_rdev = 0, st_size = 4096, st_blksize = 4096, st_blocks = 8,
  st_atim = {tv_sec = 1185132340, tv_nsec = 0}, st_mtim = {tv_sec = 1185132397, tv_nsec = 0}, st_ctim = {tv_sec = 1185132397, tv_nsec = 0}, __unused = {0, 0, 0}}
        sc = (struct smf_sc *) 0x53d790
        u = 33
        __func__ = "smf_init"
#5  0x000000000042789a in setup_storage (s_arg=0x7fffd685659a "file,/var/cache/varnish") at varnishd.c:158
        p = 0x7fffd685659e ",/var/cache/varnish"
        q = 0x7fffd685659f "/var/cache/varnish"
        stp = (struct stevedore *) 0x536920
        __func__ = "setup_storage"
#6  0x0000000000428dba in main (argc=0, argv=0x7fffd6854aa8) at varnishd.c:573
        o = -1
        C_flag = 0
        d_flag = 0
        F_flag = 0
        b_arg = 0x0
        f_arg = 0x7fffd6856570 "/etc/varnish/vcl.conf"
        f_fd = 6
        h_arg = 0x430f41 "classic"
        n_arg = 0x0
        P_arg = 0x0
        s_arg = 0x7fffd685659a "file,/var/cache/varnish"
        T_arg = 0x7fffd6856588 "127.0.0.1:6082"
        p = 0x2af900000001 <Address 0x2af900000001 out of bounds>
        cli = {{sb = 0x53a010, result = CLIS_OK}}
        pfh = (struct pidfh *) 0x0
        dirname = "/var/cache//varnish/zen\000?Gi??*\000\000pF\205??\177\000\000?Di??*\000\000?y??*\000\000s?%??*\000\001??\213??*\000\000 at Ii??*\000\000?F\205?\000\000\000\000(?6??*\000\000\000 %??*\000\000(?6??*\000\000\a\000\000\000\000\000\000\000&?\226??*\000\000?{\213??*\000\000 at Ii??*\000\000\000\000\000\000\000\000\000\000?\021\021\000\000\000\000\000?H\205??\177\000\000?J\205??\177\000\000xJ\205??\177\000\000\006\000\000\000\000\000\000\000\000\220y??*\000\000"...
        __func__ = "main"


#2  0x00002ac263c957fa in lbv_assert (func=0x4303c3 "smf_initfile", file=0x4301b7 "storage_file.c", line=239, cond=0x4303d0 "(ftruncate(sc->fd, sc->filesize)) == 0", err=27)
    at assert.c:58
#3  0x0000000000424f2c in smf_initfile (sc=0x53d790, size=0x53d2ec "", newfile=1) at storage_file.c:239
#4  0x0000000000425165 in smf_init (parent=0x53cf80, spec=0x7fff46f32596 "/var/cache/varnish/somefile") at storage_file.c:280
#5  0x000000000042789a in setup_storage (s_arg=0x7fff46f32591 "file,/var/cache/varnish/somefile") at varnishd.c:158
#6  0x0000000000428dba in main (argc=0, argv=0x7fff46f31178) at varnishd.c:573



More information about the varnish-dev mailing list