You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lua code: local rocksdb = require 'rocksdb' local opts = rocksdb.options({ create_if_missing = true }) local rocksdbTest = rocksdb.open(opts, "rocks.db")
The test found that segfault occurred when the program ran to “rocksdb_t *db = rocksdb_open(o->options, path, &err);”, causing the process to crash. But strangely, there are occasional cases where Rocksdb is successfully opened and data is written, and it is uncertain whether it is due to incorrect binding or a bug
The text was updated successfully, but these errors were encountered:
I tried using Lua binding Rocksdb to call the C API in Rocksdb:
lua binding code:
`LUALIB_API int lrocksdb_open(lua_State *L) {
lrocksdb_options_t *o = lrocksdb_get_options(L, 1);
const char *path = luaL_checkstring(L, 2);
char *err = NULL;
rocksdb_t *db = rocksdb_open(o->options, path, &err);
if(err) {
luaL_error(L, err);
free(err);
return 0;
}
lrocksdb_t *d = (lrocksdb_t *) lua_newuserdata(L, sizeof(lrocksdb_t));
d->db = db;
d->options = o;
d->open = 1;
lrocksdb_setmeta(L, "db");
return 1;
}`
lua code:
local rocksdb = require 'rocksdb' local opts = rocksdb.options({ create_if_missing = true }) local rocksdbTest = rocksdb.open(opts, "rocks.db")
The test found that segfault occurred when the program ran to “rocksdb_t *db = rocksdb_open(o->options, path, &err);”, causing the process to crash. But strangely, there are occasional cases where Rocksdb is successfully opened and data is written, and it is uncertain whether it is due to incorrect binding or a bug
The text was updated successfully, but these errors were encountered: