Fatal error when importing a text file into Tasklist

From SuperMemopedia
Jump to navigation Jump to search


From: Harvey R.
Country: UK
Sent: 03/02/2021
Subject: Fatal error when importing a text file into Tasklist

Question:

WARNING!

Do no attempt to reproduce this bug

I exported a bunch of tasks from Tasklist of Collection X, and imported them into another Tasklist in Collection Y. I returned to X, which resulted in SuperMemo giving me many scary errors (see below).

My collection seems to be unharmed (I executed a detailed collection repair, and no error came up).

Steps to reproduce the errors

  1. Export tasks as a text file
  2. Import the text file into a Tasklist (it could be the same one, or a different one. It doesn't really matter).
  3. Switch collections (sometimes I got the errors straight after trying to close the Tasklist window). In fact, you don't need to switch collections. I have managed to get the errors after trying to close SuperMemo.
  4. You will get the errors (SuperMemo may also just shut down, giving you an error when re-start the last used collection).

You will also notice that you will get MANY Access violation at address XYZ in module sm18.exe dialogue boxes, where XYZ is just a bunch of random letters and numbers.

Sample errors

I tried to capture as many as possible:

Error reading tasklist title pointers
Cannot close c:\supermemo\systems\Collection.Kno
Access violation at address 0040A7A8 in module 'sm18.exe'. Read of address FFFFFFFC
Cannot get use time for day #7704
Access violation at address 007B802F in module 'sm18.exe'. Read of address 00000005
Optimization memory must be allocated before calling FreeOptimizationRecord
Database not closed in CreateAbsent
Error adding new task

Access violation at address 0096452C in module 'sm18.exe'. Read of address 00000005
Fatal error!

Cannot read task data for task #3
Read beyond end of file

Choose Abort to halt SuperMemo

IMPORTANT! To prevent data loss do the following:

1. Back up your collection (e.g. with Ctrl+Shift+C)

2. Run File : Repair collection (Ctrl+F12)!!!
Error locating priority position
Cannot fill out task parameters
Error removing the queue element #3
Access violation at address 009650A8 in module 'sm18.exe'. Read of address 00000005
Error deleting task #3
Read beyond end of file
Task position beyond the end of taskinfo file
Position: #3
File size: 2

Answer:

This should be fixed in updates to SM18.exe dated Mar 3, 2021 or later. If you close SuperMemo, after the error occurs, it would probably be harmless. If you persist (e.g. after getting Fatal Error), further operations might be unpredictable.

Technical Explanation

In a sweep for memory leaks, memory management was "too good" in tasklist imports. The same memory was to be freed at the end of the procedure and at closing the tasklist. This means that memory override errors could occur as soon as another tasklist was to be chosen (or SuperMemo closed). Memory errors have unpredictable side effect. With a bit of bad luck, they can even result in data loss if a chain of errors invades a data-critical procedure. None of the errors listed could be reproduce, however, a good guess is that they are all the consequence of the unpredictable "memory mess" at closing the tasklist. In case of error volleys like this, it is recommended to close SuperMemo (backup and Repair collection are also recommended).