On Jun 30, 2008, at 5:41 PM, Andrew de los Reyes wrote: > > I added some logging to investigate how this happens, and found > that sqlite3FaultBeginBenign() and sqlite3FaultEndBenign() are being > called > with -1 as the only argument by many threads simultaneously. > > I added code to log entrances and exits to these functions with a > negative > argument is passed, and to occasionally sleep() in > sqlite3FaultEndBenign() > and to dump the last 20 log messages to console occasionally. I > found this > contiguous sequence of events: > > — thread id 12803 enters sqlite3FaultEndBenign() > — thread id 12803 exits sqlite3FaultEndBenign() > — thread id 13059 exits sqlite3FaultEndBenign() > > This is a bug, because one thread (id 13059) is > inside sqlite3FaultEndBenign() while another thread (id 12803) calls > the > same function. Inside sqlite3FaultEndBenign(), a static variable, > aFault, is > accessed (operator--, which i believe is read,modify,write) without > the > protection of a mutex.
It is not a bug because sqlite3FaultEndBenign() is used during testing only. And the tests in which this function are used only run a single thread. D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users