Hi, again,
I did recompile everything with /MDd and I did fix couple of issues.
However the crash is back and below is the (full) stack trace:

     00000000()
>    sqlite.dll!sqlite3_mutex_enter(sqlite3_mutex * p)  Line 19996 + 0xc bytes  
>   C
     sqlite.dll!sqlite3Close(sqlite3 * db, int forceZombie)  Line 726
+ 0xc bytes    C
     sqlite.dll!sqlite3_close(sqlite3 * db)  Line 772 + 0xe bytes    C
     
sqlite.dll!SQLiteDatabase::Disconnect(std::vector<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
>,std::allocator<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > > & errorMsg)  Line 59 + 0xc bytes    C++
     dialogs.dll!DisconnectFromDb(Database * db)  Line 118 + 0x13 bytes    C++
     docview.exe!MainFrame::~MainFrame()  Line 80 + 0x12 bytes    C++
     docview.exe!MainFrame::`scalar deleting destructor'()  + 0x16 bytes    C++
     docview.exe!wxAppConsoleBase::DeletePendingObjects()  Line 637 +
0x23 bytes    C++
     docview.exe!wxAppConsoleBase::ProcessIdle()  Line 445    C++
     docview.exe!wxAppBase::ProcessIdle()  Line 373 + 0x8 bytes    C++
     docview.exe!wxEventLoopBase::ProcessIdle()  Line 98 + 0x23 bytes    C++
     docview.exe!wxEventLoopManual::DoRun()  Line 263 + 0x3b bytes    C++
     docview.exe!wxEventLoopBase::Run()  Line 76 + 0xf bytes    C++
     docview.exe!wxAppConsoleBase::MainLoop()  Line 380 + 0x27 bytes    C++
     docview.exe!wxAppConsoleBase::OnRun()  Line 301 + 0x12 bytes    C++
     docview.exe!wxAppBase::OnRun()  Line 312    C++
     docview.exe!wxEntryReal(int & argc, wchar_t * * argv)  Line 503 +
0x1d bytes    C++
     docview.exe!wxEntry(int & argc, wchar_t * * argv)  Line 181 + 0xd
bytes    C++
     docview.exe!wxEntry(HINSTANCE__ * hInstance, HINSTANCE__ *
__formal, HINSTANCE__ * __formal, int nCmdShow)  Line 289 + 0x10 bytes
   C++
     docview.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ *
hPrevInstance, char * __formal, int nCmdShow)  Line 76 + 0x16 bytes
C++
     docview.exe!__tmainCRTStartup()  Line 547 + 0x2c bytes    C
     docview.exe!WinMainCRTStartup()  Line 371    C
     kernel32.dll!76f57c04()
     [Frames below may be incorrect and/or missing, no symbols loaded
for kernel32.dll]
     ntdll.dll!771aad6f()
     ntdll.dll!771aad3a()

The weird thing is that if I put the Disconnect() call in another
function, it works OK - no crash.
Only when I exit the application.

MSVC 2012 shows that the crash happens on following line:

SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
  if( p ){
    assert( sqlite3GlobalConfig.mutex.xMutexEnter );   <------- here
    sqlite3GlobalConfig.mutex.xMutexEnter(p);
  }

I'm running on Windows 8.1. SQLite is compiled into my application and
the source is from couple of days ago.

What are the conditions when the application will not be able to
acquire the global file lock?

Thank you.

On Sun, Jan 31, 2016 at 1:11 PM, Olivier Mascia <om at integral.be> wrote:
>> Le 31 janv. 2016 ? 18:06, Igor Korot <ikorot01 at gmail.com> a ?crit :
>>
>> Ok, I did try to recompile everything with /MDd.
>> The crash again happens only on the main frame destruction.
>> Everything worked after the pointer had been assigned to the main frame 
>> member.
>> I don't understand this at all.
>>
>> Thank you.
>
> Looking at the stack trace you posted, it is not SQLite code which crash, but 
> some C++ code (which happen to be inside a dll named 'sqlite.dll') probably 
> wrapping SQLite3 code itself.  It tries to delete some data, and some 
> integrity checks reveal the pointer is invalid, by that time at least.
>
>> Here is the stack trace of the crash:
>>     ntdll.dll!77b973a6()
>>     [Frames below may be incorrect and/or missing, no symbols loaded
>> for ntdll.dll]
>>     ntdll.dll!77b5164f()
>>     ntdll.dll!77b20f01()
>>     KernelBase.dll!762b2844()
>>>   sqlite.dll!_CrtIsValidHeapPointer(const void * pUserData)  Line 2036    
>>> C++
>>     sqlite.dll!_free_dbg_nolock(void * pUserData, int nBlockUse)
>> Line 1322 + 0x9 bytes    C++
>>     sqlite.dll!_free_dbg(void * pUserData, int nBlockUse)  Line 1265
>> + 0xd bytes    C++
>>     sqlite.dll!operator delete(void * pUserData)  Line 54 + 0x10 bytes    C++
>>     sqlite.dll!SQLiteDatabase::`vector deleting destructor'()  + 0x65
>> bytes    C++
>
> --
> Meilleures salutations, Met vriendelijke groeten, Best Regards,
> Olivier Mascia, integral.be/om
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to