Skip to content

Calling Dispose twice on a RocksDb instance throws an AccessViolationException #76

@devhawk

Description

@devhawk

Repro Code:

class Program
{
    static void Main(string[] args)
    {
        var options = new RocksDbSharp.DbOptions()
            .SetCreateIfMissing(true)
            .SetCreateMissingColumnFamilies(true);

        using(var db = RocksDbSharp.RocksDb.Open(options, "database"))
        {
            db.Dispose();
        }
    }
}

RocksDbSharp Version: 6.2.2
Expected Behavior: process terminates normally
Actual Behavior: process terminates with Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

From IDispose Remarks:

If an object's Dispose method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its Dispose method is called multiple times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions