Skip to content

redis-cache segfault in single server dogfood instance

Created by: uwedeportivo

see https://github.com/sourcegraph/infrastructure/pull/2053

we experienced it today with sourcegraph.sgdev.org.

switching back to 3.18 fixes it.

things i tried:

/* Returns an array of robj pointers, and populates *argc with the number
 * of items, by parsing the format specifier "fmt" as described for
 * the RM_Call(), RM_Replicate() and other module APIs.
 *
 * The integer pointed by 'flags' is populated with flags according
 * to special modifiers in "fmt". For now only one exists:
 *
 *     "!" -> REDISMODULE_ARGV_REPLICATE
 *     "A" -> REDISMODULE_ARGV_NO_AOF
 *     "R" -> REDISMODULE_ARGV_NO_REPLICAS
 *
 * On error (format specifier error) NULL is returned and nothing is
 * allocated. On success the argument vector is returned. */
robj **moduleCreateArgvFromUserFormat(const char *cmdname, const char *fmt, int *argcp, int *flags, va_list ap) {
    int argc = 0, argv_size, j;
    robj **argv = NULL;
    /* As a first guess to avoid useless reallocations, size argv to
     * hold one argument for each char specifier in 'fmt'. */
    argv_size = strlen(fmt)+1; /* +1 because of the command name. */
    argv = zrealloc(argv,sizeof(robj*)*argv_size);
    /* Build the arguments vector based on the format specifier. */
    argv[0] = createStringObject(cmdname,strlen(cmdname));
    argc++;

as far as i can tell it segfaults somewhere around createStringObject (i don't have debug symbols in the core dump so it's all disassembler).

to reproduce just change back to the insiders image mentioned in https://github.com/sourcegraph/infrastructure/pull/2053

there's also a couple of uwe-dev-insiders-1,2,3,4 images with mods mentioned above. uwe-dev-insiders-4 has gdb in it