One perhaps problematic issue I can see in this code would apply if you are compiling the SQLite library (the sqlite3.c amalgamation) with a default calling convention other than _cdecl. As you can see from the documented function signature and in sqlite3.h, the calling convention is not specified as far as the library is concerned, and so it follows the default for that compilation. Yet you are making your callback conform to the _cdecl (or old, C-style) calling convention. As I mentioned earlier, this differing calling convention can lead to problems. I would expect this problem to have shown up at compilation time, unless you used a cast of some kind to tell the compiler to pretend the function pointer you give to sqlite3_progress_handler() is just what it expects. Given that I see no other reason your (extremely simple) callback should cause trouble, I would be inclined to see your call to sqlite3_progress_handler() and the compilation options used when compiling sqlite3.c.