Control: tags -1 confirmed

Thanks for the bug report Emilio. Seems to be an issue in either the
redis or jemalloc packages on powerpc rather than a bug in the hiredis
package itself. It was very easy to reproduce the redis-server
crashes, but all attempts to narrow it down to a specific line of code
in redis-server proved fruitless. Saw lots of strange memory
corruption going on. The crashes seemed more likely to happen near a
zfree(...) -- example crash below, with some of my own diagnostic
checks + a non-stripped build of redis-server.

If I reverse the patch in 03-use-system-jemalloc.diff in the redis
package & link redis-server against the vendored jemalloc code the
crashes stop, so I'm inclined to believe this may be an issue with
Debian's jemalloc package.

Oddly if I rebuild Debian jemalloc package manually (unmodified) & run
redis-server against that, everything works great. I'll raise a bug
against the jemalloc package to see if we can get to the bottom of
this.

Cheers,
Tom

Program received signal SIGSEGV, Segmentation fault.
0x20482850 in raise (sig=11) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
37      ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
(gdb) bt
#0  0x20482850 in raise (sig=11) at
../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x2066ec48 in _redisAssert (estr=0x206e43c0 "c->querybuf != NULL",
file=0x206e4398 "networking.c", line=1044)
    at debug.c:400
#2  0x2062efac in processMultibulkBuffer (c=0xf751c000) at networking.c:1044
#3  0x2062f6fc in processInputBuffer (c=0xf751c000) at networking.c:1176
#4  0x2062fbd4 in readQueryFromClient (el=0xf7410250, fd=6,
privdata=0xf751c000, mask=1) at networking.c:1258
#5  0x2060f44c in aeProcessEvents (eventLoop=0xf7410250, flags=3) at ae.c:412
#6  0x2060f74c in aeMain (eventLoop=0xf7410250) at ae.c:455
#7  0x2061fad8 in main (argc=2, argv=0xfffef6b4) at redis.c:3685
(gdb) up
#1  0x2066ec48 in _redisAssert (estr=0x206e43c0 "c->querybuf != NULL",
file=0x206e4398 "networking.c", line=1044)
    at debug.c:400
400         raise(SIGSEGV);
(gdb)
#2  0x2062efac in processMultibulkBuffer (c=0xf751c000) at networking.c:1044
1044            redisAssert(c->querybuf != NULL);
(gdb) list
1039            redisAssert(c->querybuf != NULL);
1040            redisClient cpy;
1041            memcpy(&cpy, c, sizeof(cpy));
1042            /* Setup argv array on client structure */
1043            if (c->argv) zfree(c->argv);
1044            redisAssert(c->querybuf != NULL);
1045            c->argv = zmalloc(sizeof(robj*)*c->multibulklen);
1046            redisAssert(c->querybuf != NULL);
1047        }
1048
(gdb) p cpy  # BEFORE
$1 = {id = 2, fd = 6, db = 0xf74c71e8, dictid = 0, name = 0x0,
querybuf = 0xf7521008 "*1\r\n$4\r\nPING\r\n",
  querybuf_peak = 0, argc = 0, argv = 0xf740d090, cmd = 0x0, lastcmd =
0x207116b0 <redisCommandTable+5768>,
  reqtype = 2, multibulklen = 1, bulklen = -1, reply = 0xf74fff00,
reply_bytes = 0, sentlen = 0, ctime = 1435027829,
  lastinteraction = 1435027829, obuf_soft_limit_reached_time = 0,
flags = 0, authenticated = 0, replstate = 0,
  repl_put_online_on_ack = 0, repldbfd = 0, repldboff = 0, repldbsize
= 0, replpreamble = 0x0, reploff = 0,
  repl_ack_off = 0, repl_ack_time = 0, replrunid = '\000' <repeats 40
times>, slave_listening_port = 0, mstate = {
    commands = 0x0, count = 0, minreplicas = 0, minreplicas_timeout =
0}, btype = 0, bpop = {timeout = 0,
    keys = 0xf74cf850, target = 0x0, numreplicas = 0, reploffset = 0},
woff = 0, watched_keys = 0xf74fff20,
  pubsub_channels = 0xf74cf880, pubsub_patterns = 0xf74fff40, peerid =
0x0, bufpos = 0,
  buf = "+PONG\r\n", '\000' <repeats 16376 times>}
(gdb) p *c # AFTER
$2 = {id = 0, fd = 0, db = 0x0, dictid = 0, name = 0x0, querybuf =
0x0, querybuf_peak = 0, argc = 0, argv = 0x0,
  cmd = 0x0, lastcmd = 0x0, reqtype = 0, multibulklen = 0, bulklen =
0, reply = 0x0, reply_bytes = 0, sentlen = 0,
  ctime = 0, lastinteraction = 0, obuf_soft_limit_reached_time = 0,
flags = 0, authenticated = 0, replstate = 0,
  repl_put_online_on_ack = 0, repldbfd = 0, repldboff = 0, repldbsize
= 0, replpreamble = 0x0, reploff = 0,
  repl_ack_off = 0, repl_ack_time = 0, replrunid = '\000' <repeats 40
times>, slave_listening_port = 0, mstate = {
    commands = 0x0, count = 0, minreplicas = 0, minreplicas_timeout =
0}, btype = 0, bpop = {timeout = 0, keys = 0x0,
    target = 0x0, numreplicas = 0, reploffset = 0}, woff = 0,
watched_keys = 0x0, pubsub_channels = 0x0,
  pubsub_patterns = 0x0, peerid = 0x0, bufpos = 0, buf = '\000'
<repeats 16383 times>}

On Fri, Jun 12, 2015 at 5:21 PM, Emilio Pozuelo Monfort
<po...@debian.org> wrote:
> Source: hiredis
> Version: 0.13.1-1
> Severity: serious
> Control: block 785349 by -1
>
> Hi,
>
> Your package failed to build on powerpc:
>
> The problem seems to be:
>
> ../hiredis-test -h 127.0.0.1 -p 56379 -s /tmp/hiredis-test-redis.sock || \
>                 ( kill `cat /tmp/hiredis-test-redis.pid` && false )
> hiredis-test: test.c:625: test_throughput: Assertion `redisGetReply(c, 
> (void*)&replies[i]) == 0' failed.
>
> See 
> https://buildd.debian.org/status/fetch.php?pkg=hiredis&arch=powerpc&ver=0.13.1-2&stamp=1434137918
> for a full log.
>
> Emilio



-- 
Tom Lee / http://tomlee.co / @tglee


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to