cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vijay (Created) (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-4111) Serializing cache can cause Segfault in 1.1
Date Mon, 02 Apr 2012 23:31:21 GMT
Serializing cache can cause Segfault in 1.1

                 Key: CASSANDRA-4111
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.0
            Reporter: Vijay
            Assignee: Vijay
             Fix For: 1.1.0

Rare but this can happen per sure, looks like this issue is after CASSANDRA-3862 hence affectes
only 1.1

        FreeableMemory old = map.get(key);
        if (old == null)
            return false;

        // see if the old value matches the one we want to replace
        FreeableMemory mem = serialize(value);
        if (mem == null)
            return false; // out of memory.  never mind.
        V oldValue = deserialize(old);
        boolean success = oldValue.equals(oldToReplace) && map.replace(key, old, mem);

        if (success)
        return success;

in the above code block we deserialize(old) without taking reference to the old memory, this
can case seg faults when the old is reclaimed (free is called)
Fix is to get the reference just for deserialization

        V oldValue;
        // reference old guy before de-serializing
             oldValue = deserialize(old);

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message