サムネイルキャッシュ有効時、終了すると `Database is not open` エラーになる

Issue #1237 closed
htsign created an issue

「全般」→「サムネイル」→「サムネイル キャッシュ」→「サムネイルキャッシュを使用する」を有効にした状態で終了すると以下のエラーが発生します。

---------------------------
アサートに失敗しました: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
App.Terminate: 2022/08/03 19:06:56: System.InvalidOperationException: Database is not open
   場所 System.Data.SQLite.SQLiteCommand.InitializeForReader()
   場所 System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   場所 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
   場所 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   場所 NeeView.ThumbnailCache.Delete(TimeSpan limitTime)
   場所 NeeView.ThumbnailCache.Dispose(Boolean disposing)
   場所 NeeView.App.Terminate()


   場所 NeeView.App.Terminate()
   場所 NeeView.App.Application_Exit(Object sender, ExitEventArgs e)
   場所 System.Windows.Application.OnExit(ExitEventArgs e)
   場所 System.Windows.Application.DoShutdown()
   場所 System.Windows.Application.ShutdownImpl()
   場所 System.Windows.Application.ShutdownCallback(Object arg)
   場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   場所 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   場所 System.Windows.Threading.DispatcherOperation.InvokeImpl()
   場所 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   場所 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   場所 System.Windows.Threading.DispatcherOperation.Invoke()
   場所 System.Windows.Threading.Dispatcher.ProcessQueue()
   場所 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   場所 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   場所 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   場所 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   場所 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   場所 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   場所 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   場所 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   場所 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   場所 System.Windows.Application.RunDispatcher(Object ignore)
   場所 System.Windows.Application.RunInternal(Window window)
   場所 NeeView.App.Main()

Windows 10 Pro、 ver 39.4 で動作を確認しています。また、Zip版です。
アップデートする前は 38.3 でしたが、その時点ではエラーは起こりませんでした。


条件不明ですが、以下のエラーになることもあるようです。(設定ファイルを全て削除した上で終了したらこのパターンでした)

---------------------------
アサートに失敗しました: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
App.Terminate: 2022/08/03 19:15:40: System.EntryPointNotFoundException: DLL 'SQLite.Interop.dll'  'SI7fca2652f71267db' というエントリ ポイントが見つかりません。
   場所 System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
   場所 System.Data.SQLite.SQLite3.StaticIsInitialized()
   場所 System.Data.SQLite.SQLiteLog.PrivateInitialize(String className)
   場所 System.Data.SQLite.SQLiteLog.Initialize(String className)
   場所 System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   場所 System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
   場所 NeeView.ThumbnailCache.<Open>g__OpenInner|21_0()
   場所 NeeView.ThumbnailCache.Open()
   場所 NeeView.ThumbnailCache.Delete(TimeSpan limitTime)
   場所 NeeView.ThumbnailCache.Dispose(Boolean disposing)
   場所 NeeView.App.Terminate()


   場所 NeeView.App.Terminate()
   場所 NeeView.App.Application_Exit(Object sender, ExitEventArgs e)
   場所 System.Windows.Application.OnExit(ExitEventArgs e)
   場所 System.Windows.Application.DoShutdown()
   場所 System.Windows.Application.ShutdownImpl()
   場所 System.Windows.Application.ShutdownCallback(Object arg)
   場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   場所 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   場所 System.Windows.Threading.DispatcherOperation.InvokeImpl()
   場所 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   場所 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   場所 System.Windows.Threading.DispatcherOperation.Invoke()
   場所 System.Windows.Threading.Dispatcher.ProcessQueue()
   場所 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   場所 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   場所 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   場所 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   場所 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   場所 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   場所 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   場所 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   場所 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   場所 System.Windows.Application.RunDispatcher(Object ignore)
   場所 System.Windows.Application.RunInternal(Window window)
   場所 NeeView.App.Main()

Comments (4)

  1. Ito Mitsuhiro repo owner

    ご報告ありがとうございます。他の方からも似た報告をいただいているので、なにかありそうです。

    この現象の再現率は100%でしょうか。

    ひとまず、 System.Data.SQLite を 39.3 で使用していたものに戻したCanarry版をアップしましたのでこちらで症状が改善するかお試しいただけますでしょうか。問題の発生している環境のキャッシュ(Cache.db)が残っていればこのバージョンのフォルダーにコピーしてお試しください。

    https://bitbucket.org/neelabo/neeview/downloads/NeeViewCanary0804.zip

  2. htsign reporter

    ご返信ありがとうございます。

    上記の件については 100% 発生しておりました。
    ただし、

    条件不明ですが、以下のエラーになることもあるようです。

    と記載した通り、2つ目のスタックトレースになることも稀にありました。
    なにか特別な操作をした結果かもしれませんが、申し訳ありません。思い当たる点はありません。

    ご提供いただいた Canary版で確認したところ問題なく終了することができました。キャッシュも正しく効いており、2度目以降の表示はとても軽快です。

  3. Ito Mitsuhiro repo owner

    ご確認ありがとうございます。

    一定期間確認後、正式版に反映予定です。

  4. Log in to comment