FAQ
Trying out 2.8.0 RC2 on an IPv6-only host (FreeBSD 9.1).
The redis server binds to ::1 only and seems to be in good health:

   $ lsof -p 23930
   COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
   redis-ser 23930 root 5u IPv6 0xfffffe0007d757a0 0t0 TCP localhost:6379 (LISTEN)

The 'make test' (unsurprisingly) fails, assuming the host supports INET:

   cd src && gmake test
   gmake[1]: Entering directory `/usr/home/mark/git/redis/src'
   Cleanup: may take some time... OK
   Starting test server at port 11111
   couldn't open socket: protocol not supported
       while executing
   "socket -server accept_test_clients -myaddr 127.0.0.1 $port"
       (procedure "test_server_main" line 10)
       invoked from within
   "test_server_main "
   gmake[1]: *** [test] Error 1
   gmake[1]: Leaving directory `/usr/home/mark/git/redis/src'
   gmake: *** [test] Error 2

although the server when installed works fine and responds normally
to commands over telnet.


But the redis-cli seems to be in trouble:

$ redis-cli -h ::1 info
Segmentation fault: 11

Trying with a debugger:

$ gdb redis-cli
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 "amd64-marcel-freebsd"...
(gdb) set args -h ::1 info
(gdb) run
Starting program: /usr/home/mark/git/redis/src/redis-cli -h ::1 info
[New LWP 100382]

gdb redis-cli
[New Thread 801007400 (LWP 100382/redis-cli)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 801007400 (LWP 100382/redis-cli)]
redisReaderGetReply (r=0x801064300, reply=0x7fffffff5200) at sds.h:47
47 static inline size_t sdslen(const sds s) {
Current language: auto; currently minimal
(gdb)
(gdb) bt
#0 redisReaderGetReply (r=0x801064300, reply=0x7fffffff5200) at sds.h:47
#1 0x000000000040cce9 in redisGetReplyFromReader (c=0x8010610c0, reply=0x6d4) at hiredis.c:1139
#2 0x000000000040ce08 in redisGetReply (c=0x8010610c0, reply=0x7fffffff5250) at hiredis.c:1166
#3 0x000000000040704b in cliReadReply (output_raw_strings=1) at redis-cli.c:505
#4 0x0000000000407db2 in cliSendCommand (argc=1, argv=0x80105e8f8, repeat=1) at redis-cli.c:621
#5 0x000000000040885d in noninteractive (argc=1, argv=<value optimized out>) at redis-cli.c:926
#6 0x0000000000409764 in main (argc=1, argv=0x7fffffffd948) at redis-cli.c:1582
(gdb) p reply
$1 = (void **) 0x7fffffff5200
(gdb) p *reply
$2 = (void *) 0x0
(gdb) p r
$3 = (redisReader *) 0x801064300
(gdb) p *r
$4 = {err = 0, errstr = '\0' <repeats 127 times>,
   buf = 0xda8 <Error reading address 0xda8: Bad address>, pos = 0, len = 1748, maxbuf = 16384,
   rstack = {{type = 1, elements = -1, idx = -1, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0,
       elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
       idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0,
       parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0,
       privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {
       type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0,
       elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
       idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}}, ridx = -1, reply = 0x80105d250,
   fn = 0x617b98, privdata = 0x0}


Mark

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Mark Martinec at Jul 31, 2013 at 10:34 am

    But the redis-cli seems to be in trouble:

    $ redis-cli -h ::1 info
    Segmentation fault: 11
    I was too specific. Trying it on a dual-stack host the redis-cli fails
    as well, this is not specific to IPv6.
    (gdb) p *r
    $4 = {err = 0, errstr = '\0' <repeats 127 times>,
    buf = 0xda8 <Error reading address 0xda8: Bad address>, pos = 0, len =
    1748, maxbuf = 16384, ...
    The clobbered buffer address 0xda8 corresponds to sh->free as set by the
    end of sdsrange():

    $ gdb ./redis-cli
    (gdb) set args -h ::1 info

    (gdb) b hiredis.c:653
    Breakpoint 1 at 0x40b7f7: file hiredis.c, line 653.
    (gdb) run
    Starting program: /usr/home/mark/git/redis/src/redis-cli -h ::1 info
    Breakpoint 1, redisReaderGetReply (r=0x801064300, reply=0x7fffffff5200) at hiredis.c:653
    653 sdsrange(r->buf,r->pos,-1);

    (gdb) p *r
    $1 = {err = 0, errstr = '\0' <repeats 127 times>,
       buf = 0x801095e10 "$1745\r\n#
    Server\r\nredis_version:2.7.102\r\nredis_git_sha1:cc946972\r\nredis_git_dirty:0\r\nredis_build_id:2c6a3cf62d8f674a\r\nredis_mode:standalone\r\nos:FreeBSD
    9.1-STABLE amd64\r\narch_bits:64\r\nmultiplexing_api:"..., pos = 1754, len = 1754, maxbuf = 16384, rstack = {{type = 1,
           elements = -1, idx = -1, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
           idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0,
           parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0,
           privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {
           type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0,
           elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
           idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0,
           parent = 0x0, privdata = 0x0}}, ridx = -1, reply = 0x80105d250, fn = 0x617b98, privdata = 0x0}

    (gdb) s
    sdsrange (
         s=0x801095e10 "$1745\r\n#
    Server\r\nredis_version:2.7.102\r\nredis_git_sha1:cc946972\r\nredis_git_dirty:0\r\nredis_build_id:2c6a3cf62d8f674a\r\nredis_mode:standalone\r\nos:FreeBSD
    9.1-STABLE amd64\r\narch_bits:64\r\nmultiplexing_api:"..., start=1754, end=-1) at sds.c:388
    388 void sdsrange(sds s, int start, int end) {

    (gdb) b 415
    Breakpoint 2 at 0x405da6: file sds.c, line 415.
    (gdb) c
    Breakpoint 2, sdsrange (s=<value optimized out>, start=1754, end=<value optimized out>) at sds.c:415

    415 sh->len = newlen;
    (gdb) s
    414 sh->free = sh->free+(sh->len-newlen);
    (gdb)
    416 }

    (gdb) p *sh
    $2 = {len = 0, free = 3508, buf = 0x801095e10 ""}

    (gdb) s
    redisReaderGetReply (r=0x801064300, reply=0x7fffffff5200) at hiredis.c:654
    654 r->pos = 0;
    (gdb) p *r
    $3 = {err = 0, errstr = '\0' <repeats 127 times>,
       buf = 0xdb4 <Error reading address 0xdb4: Bad address>, pos = 1754, len = 1754, maxbuf = 16384,
       rstack = {{type = 1, elements = -1, idx = -1, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0,
           elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
           idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0,
           parent = 0x0, privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0,
           privdata = 0x0}, {type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {
           type = 0, elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0,
           elements = 0, idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}, {type = 0, elements = 0,
           idx = 0, obj = 0x0, parent = 0x0, privdata = 0x0}}, ridx = -1, reply = 0x80105d250,
       fn = 0x617b98, privdata = 0x0}

    Note that the clobbered buffer address 0xdb4 equals 3508, which was set in sdsrange sh->free

    Don't know what to make of this.

       Mark

    --
    You received this message because you are subscribed to the Google Groups "Redis DB" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
    To post to this group, send email to redis-db@googlegroups.com.
    Visit this group at http://groups.google.com/group/redis-db.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Martinec at Aug 2, 2013 at 10:17 am

    On Wednesday 31 July 2013 12:34:42 Mark Martinec wrote:
    But the redis-cli seems to be in trouble:

    $ redis-cli info
    Segmentation fault: 11
    Apparently it was a compilation/build issue.
    A git pull && make did not notice that deps/hiredis has changed,
    so it was building redis-cli with an incompatible hiredis library.

    The solution was to: cd deps/hiredis; make clean; make
    then repeat the make at the top level.

    Sorry for distraction.

       Mark

    --
    You received this message because you are subscribed to the Google Groups "Redis DB" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
    To post to this group, send email to redis-db@googlegroups.com.
    Visit this group at http://groups.google.com/group/redis-db.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Salvatore Sanfilippo at Aug 2, 2013 at 12:24 pm
    Thanks Mark, actually it is Redis fault in some way as currently no
    recompilation is triggered after changes under /deps, that's a bad idea...
    We need to fix the build system.

    Cheers,
    Salvatore

    On Fri, Aug 2, 2013 at 12:17 PM, Mark Martinec wrote:
    On Wednesday 31 July 2013 12:34:42 Mark Martinec wrote:
    But the redis-cli seems to be in trouble:

    $ redis-cli info
    Segmentation fault: 11
    Apparently it was a compilation/build issue.
    A git pull && make did not notice that deps/hiredis has changed,
    so it was building redis-cli with an incompatible hiredis library.

    The solution was to: cd deps/hiredis; make clean; make
    then repeat the make at the top level.

    Sorry for distraction.

    Mark

    --
    You received this message because you are subscribed to the Google Groups
    "Redis DB" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to redis-db+unsubscribe@googlegroups.com.
    To post to this group, send email to redis-db@googlegroups.com.
    Visit this group at http://groups.google.com/group/redis-db.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Salvatore 'antirez' Sanfilippo
    open source developer - GoPivotal
    http://invece.org

    Beauty is more important in computing than anywhere else in technology
    because software is so complicated. Beauty is the ultimate defence against
    complexity.
            — David Gelernter

    --
    You received this message because you are subscribed to the Google Groups "Redis DB" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
    To post to this group, send email to redis-db@googlegroups.com.
    Visit this group at http://groups.google.com/group/redis-db.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupredis-db @
categoriesredis
postedJul 31, '13 at 12:44a
activeAug 2, '13 at 12:24p
posts4
users2
websiteredis.io
irc#redis

People

Translate

site design / logo © 2022 Grokbase