prpr
Well-Known Member
Consider this trivial code:
compiled using "gcc -o testdb testdb.cpp -lsqlite3"
When I run it, I just get "Opening" printed and it hangs.
Running under strace I see the last few lines as:
Presumably this futex is what's blocking everything, but why, where does it come from and how do I stop it?
Comparing e.g. /mod/boot/xinit.d/chandel, there is no futex and it just goes on to open chandel.conf as expected.
Code:
#include "sqlite3.h"
#include <stdio.h>
int main(void)
{
const char *filename = "test.db";
sqlite3 *db = NULL;
printf("Opening\n");
if (sqlite3_open_v2(filename, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, NULL) == SQLITE_OK)
{
printf("Opened\n");
}
printf("Closing\n");
sqlite3_close(db);
printf("Closed\n");
return 0;
}
When I run it, I just get "Opening" printed and it hangs.
Running under strace I see the last few lines as:
Code:
write(1, "Opening\n", 8Opening
) = 8
brk(0) = 0x411000
brk(0x412000) = 0x412000
futex(0x411010, FUTEX_WAIT, 2, NULL <unfinished ...>
Comparing e.g. /mod/boot/xinit.d/chandel, there is no futex and it just goes on to open chandel.conf as expected.