[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: LMDB and HP-UX Itanium
- To: Howard Chu <hyc@symas.com>, openldap-technical@openldap.org
- Subject: Re: LMDB and HP-UX Itanium
- From: Kristian Amlie <kristian.amlie@cfengine.com>
- Date: Fri, 20 Mar 2015 10:38:56 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cfengine.com; s=google; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=XJx/hSWB1LMBQ8JKOIVyHMxKiwYVRXMlleSaVcfuo28=; b=p5JqGMfWY0v09r8ixuIeyqhKR6bEv2Gye4GsBMpFrAf9mrlo1nNDEgUWQX7s//tYEv KpO8bFSAGUxWGp3ur2JGAYDlIBnroCimXp4lUKM7FiOsZP6LbKUHowlWxw6nqvtJc4Gd Q9afUdNtna/E+MS2//IAIyau01alOioVVQi58=
- In-reply-to: <54E6F4FC.2080303@cfengine.com>
- References: <54E59B0B.1070401@cfengine.com> <54E6021C.2000003@symas.com> <54E6F4FC.2080303@cfengine.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
This took some time, but I've finally been able to make a reproducible
test case. The attached test case fails on HP-UX on Itanium every time,
but passes on Linux. As far as I can tell, it is a minimal test case, I
cannot remove anything and still have it fail, yet I don't see any wrong
API usage in it. The database should be removed before each run.
How is it best to proceed? Should I submit ticket in the bug tracker?
--
Kristian
#define HAVE_MEMALIGN 1
#include "mdb.c"
#include "midl.c"
#define NEXT_PUT_VALUE(x, y) mkey.mv_data = (x); mkey.mv_size = strlen(x) + 1; data.mv_data = (y); data.mv_size = strlen(y) + 1
int main() {
MDB_env *env;
MDB_dbi dbi;
MDB_txn *txn;
const char *dbpath = "test.lmdb";
MDB_val mkey, data;
mdb_env_create(&env);
mdb_env_open(env, dbpath, MDB_NOSUBDIR|MDB_NOSYNC, 0644);
mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
mdb_open(txn, NULL, 0, &dbi);
mdb_txn_commit(txn);
mdb_txn_begin(env, NULL, 0, &txn);
NEXT_PUT_VALUE("key", "value1");
mdb_put(txn, dbi, &mkey, &data, 0);
mdb_txn_commit(txn);
mdb_env_close(env);
mdb_env_create(&env);
mdb_env_open(env, dbpath, MDB_NOSUBDIR|MDB_NOSYNC, 0644);
mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
mdb_open(txn, NULL, 0, &dbi);
mdb_txn_commit(txn);
mdb_txn_begin(env, NULL, 0, &txn);
NEXT_PUT_VALUE("key", "value2");
mdb_put(txn, dbi, &mkey, &data, 0);
mdb_txn_commit(txn);
mdb_env_close(env);
mdb_env_create(&env);
mdb_env_open(env, dbpath, MDB_NOSUBDIR|MDB_NOSYNC, 0644);
mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
mdb_open(txn, NULL, 0, &dbi);
mdb_txn_commit(txn);
mdb_env_close(env);
mdb_env_create(&env);
mdb_env_open(env, dbpath, MDB_NOSUBDIR|MDB_NOSYNC, 0644);
mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
mdb_open(txn, NULL, 0, &dbi);
mdb_txn_commit(txn);
mdb_txn_begin(env, NULL, 0, &txn);
NEXT_PUT_VALUE("key", "value3");
mdb_put(txn, dbi, &mkey, &data, 0);
mdb_txn_commit(txn);
mdb_txn_begin(env, NULL, 0, &txn);
NEXT_PUT_VALUE("key", "value4");
mdb_put(txn, dbi, &mkey, &data, 0);
mdb_txn_commit(txn);
mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
mdb_get(txn, dbi, &mkey, &data);
printf("data should be 'value4', on HP-UX it is 'value1'\n");
printf("mkey = '%s', data = '%s'\n", mkey.mv_data, data.mv_data);
return 0;
}