Ken & Deb Allen <[EMAIL PROTECTED]> wrote: > Yes, the unixLock() routine is defined in the 3.3.0 source, but not > in the 3.2.8 code. > > Nor can I find the #define for this anywhere in the 3.3.0 source (nor > can I find any definition for the sqlite3OsLock (other than a > function prototype) in either the 3.2.8 or 3.3.0 source. > > When I attempt to debug the 3.3.0 source and step into the > sqlite3OsLock call, it simply drops me into some assembler and > declares the bad instruction signal. >
The whole OS-backend was reworked for version 3.3.0. So do not expect to find the same functions in 3.3.0 that you had in 3.2.8. unixLock() is actually a virtual method on the OsFile object. Since SQLite is written in C not C++, we have to explicitly code the virtual method table. You can find it defined as the IoMethod structure in os.h. When you open a file, (using, for example, the sqlite3UnixOpenReadWrite() routine) you get back an object called OsFile which has as its first field a pointer to the IoMethod structure. sqlite3OsLock() is really a macro that resolves to OsFile->pMethod.xLock which should point to the unixLock() function. (It points to winLock() if you are running on windows, obviously.) Probably what is happening is that OsFile is not getting initialized correctly or a stray pointer is clobbering the OsFile->pMethod table. -- D. Richard Hipp <[EMAIL PROTECTED]>