Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 727924 - >=dev-db/redis-6.0.3 redis-cli crashes in interactive mode
Summary: >=dev-db/redis-6.0.3 redis-cli crashes in interactive mode
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-06-11 09:41 UTC by Guillaume Ayoub
Modified: 2020-06-12 14:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Ayoub 2020-06-11 09:41:08 UTC
Since version 6.0.3 (at least), redis-cli crashes when used in interactive mode. There’s no problem if the Redis command is directly put in the command line.

$redis-cli ping
PONG
$redis-cli
[…] SIGSEGV

The crash sometimes happens as soon as the command line is launched, sometimes after typing the first command.

Here is the traceback:
#0  rtree_szind_slab_read (r_slab=<synthetic pointer>, r_szind=<synthetic pointer>, dependent=true, key=18446744073261295976, rtree_ctx=0x7f6ae5865768, rtree=<optimized out>, tsdn=<optimized out>)
    at /var/tmp/portage/dev-libs/jemalloc-5.2.1/work/jemalloc-5.2.1/include/jemalloc/internal/rtree.h:500
#1  ifree (slow_path=false, tcache=0x7f6ae5865928, ptr=0xffffffffe5482968, tsd=<optimized out>) at /var/tmp/portage/dev-libs/jemalloc-5.2.1/work/jemalloc-5.2.1/src/jemalloc.c:2570
#2  je_free_default (ptr=0xffffffffe5482968) at /var/tmp/portage/dev-libs/jemalloc-5.2.1/work/jemalloc-5.2.1/src/jemalloc.c:2790
#3  0x00007f6ae6048d93 in free (ptr=<optimized out>) at /var/tmp/portage/dev-libs/jemalloc-5.2.1/work/jemalloc-5.2.1/src/jemalloc.c:2867
#4  0x000055b28d16e77d in linenoiseEdit (stdin_fd=0, stdout_fd=1, buflen=4096, prompt=<optimized out>, buf=0x7ffc725882b0 "ping") at linenoise.c:843
#5  linenoiseRaw (buflen=4096, prompt=<optimized out>, buf=0x7ffc725882b0 "ping") at linenoise.c:1017
#6  linenoise (prompt=<optimized out>) at linenoise.c:1085
#7  0x000055b28d160413 in repl () at redis-cli.c:1946
#8  0x000055b28d14c1ef in main (argc=<optimized out>, argv=0x7ffc725895d0) at redis-cli.c:8112

The same problem happens with libc instead of libjemalloc. I’ve also tried to compile without the ebuild patches, it doesn’t fix the problem. I’ve also tried with two different servers.

Reproducible: Always

Steps to Reproduce:
1. Launch redis-cli with no command
2. Type a command (if it didn’t already crash)
Comment 1 Jonas Stein gentoo-dev 2020-06-11 22:30:04 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* paste the emerge info 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.
Comment 2 Tomáš Mózes 2020-06-12 02:53:56 UTC
Confirmed on my ~amd64 box with redis 6.0.5, meanwhile a possible workaround: telnet localhost 6379
Comment 3 Tomáš Mózes 2020-06-12 03:54:38 UTC
Sorry, my bad. Accidentally removed a workaround fixed in https://bugs.gentoo.org/451164. The PR fixes the problem, redis-cli works again.

In case you want to test locally:
--- redis-6.0.4.ebuild  2020-05-31 04:39:09.000000000 +0000
+++ redis-6.0.5.ebuild  2020-06-12 03:47:06.319901473 +0000
@@ -109,6 +109,10 @@
 
 src_configure() {
        econf $(use_with luajit)
+
+       # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+       # also, don't define ANSI/c99 for lua twice
+       sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
 }
Comment 4 Guillaume Ayoub 2020-06-12 09:07:53 UTC
(In reply to Tomáš Mózes from comment #3)
> Sorry, my bad. Accidentally removed a workaround fixed in
> https://bugs.gentoo.org/451164. The PR fixes the problem, redis-cli works
> again.
> 
> In case you want to test locally:
> […]

Thank you, it works!
Comment 5 Larry the Git Cow gentoo-dev 2020-06-12 14:33:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d944d1c3b80a0924529a12a0d56fb6d4abe8ef0c

commit d944d1c3b80a0924529a12a0d56fb6d4abe8ef0c
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2020-06-12 03:47:19 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-06-12 14:32:03 +0000

    dev-db/redis: bump to 6.0.5, drop broken
    
    Closes: https://bugs.gentoo.org/727924
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-db/redis/Manifest                                   | 2 +-
 dev-db/redis/{redis-6.0.4.ebuild => redis-6.0.5.ebuild} | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)