[Varnish] #1026: varnishd immediate segfault on armv7, seeminly strict-aliasing violations
Varnish
varnish-bugs at varnish-cache.org
Tue Oct 4 15:27:01 CEST 2011
#1026: varnishd immediate segfault on armv7, seeminly strict-aliasing violations
--------------------------------------+-------------------------------------
Reporter: hno | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 3.0.0 | Severity: normal
Keywords: strict-aliasing segfault |
--------------------------------------+-------------------------------------
varnish 1.2.5 and 3.0.1 both crashes on armv7 gcc 4.6.1 in early
initialization.
The crash is in bin/varnishd/cache_ban.c:BAN_Insert() when it uses the
VTAILQ_LAST macro.
405 be = VTAILQ_LAST(&ban_head, banhead_s);
and seen when code is compiled with -fstrict-aliasing -fschedule-insns
optimizations enabled on armv7 (default enabled by -O2).
Compiling with -Wstrict-aliasing=1 gives an strict-aliasing warning on the
same line and other places where this macro is used.
{{{
cache_ban.c: In function 'BAN_Insert':
cache_ban.c:330:19: warning: dereferencing type-punned pointer might break
strict-aliasing rules [-Wstrict-aliasing]
cache_ban.c: In function 'BAN_CheckLast':
cache_ban.c:381:18: warning: dereferencing type-punned pointer might break
strict-aliasing rules [-Wstrict-aliasing]
cache_ban.c: In function 'ban_lurker':
cache_ban.c:522:20: warning: dereferencing type-punned pointer might break
strict-aliasing rules [-Wstrict-aliasing]
cache_ban.c: In function 'BAN_TailRef':
cache_ban.c:573:18: warning: dereferencing type-punned pointer might break
strict-aliasing rules [-Wstrict-aliasing]
cache_ban.c: In function 'ccf_purge_list':
cache_ban.c:759:20: warning: dereferencing type-punned pointer might break
strict-aliasing rules [-Wstrict-aliasing]
}}}
VTAILQ_LAST is used on all the above lines.
Backtrace of the crash:
{{{
#0 0x0001d3b0 in BAN_Insert (b=0x40850448) at cache_ban.c:405
#1 0x0001f8a4 in BAN_Init () at cache_ban.c:970
#2 0x00045238 in child_main () at cache_main.c:122
#3 0x00062a60 in start_child (cli=0x408690a4) at mgt_child.c:345
#4 0x00063e30 in mcf_server_startstop (cli=0x408690a4, av=0x40805180,
priv=0x0) at mgt_child.c:620
#5 0x4005e84c in cls_dispatch (ac=1082560648, av=0x40072528, clp=0xa17c0,
cli=0x408690a4) at cli_serve.c:228
#6 cls_vlu2 (priv=0x40805180, av=0x40072528) at cli_serve.c:284
#7 0x4005edf8 in cls_vlu (priv=0x40869088, p=0x408aa000 "start") at
cli_serve.c:339
#8 0x400635d8 in LineUpProcess (l=0x40816d80) at vlu.c:154
#9 0x4005fc30 in VCLS_PollFd (cs=0x40817448, fd=<optimized out>,
timeout=0) at cli_serve.c:489
#10 0x00064e48 in mgt_cli_callback2 (e=0x4084c1f0, what=1) at
mgt_cli.c:370
#11 0x40062ac4 in vev_schedule_one (evb=0x40817420) at vev.c:498
#12 0x40062fbc in vev_schedule (evb=0x40817420) at vev.c:363
#13 0x00063d28 in MGT_Run () at mgt_child.c:602
#14 0x0007d19c in main (argc=0, argv=0xbeacbb34) at varnishd.c:650
}}}
A full backtrace is attached.
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1026>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list