BdR76 / CSVLint

CSV Lint plug-in for Notepad++ for syntax highlighting, csv validation, automatic column and datatype detecting, fixed width datasets, change datetime format, decimal separator, sort data, count unique values, convert to xml, json, sql etc. A plugin for data cleaning and working with messy data files.
GNU General Public License v3.0
151 stars 8 forks source link

When Transparant cursor true, Notepad++ crash at startup in certain circumstances #69

Closed BdR76 closed 1 year ago

BdR76 commented 1 year ago

With CSV Lint v0.4.6.4 (or earlier) setting TransparantCursor to true can cause a crash at startup of Notepad++ in some unexplained circumstances. The root cause is calling the API function SetCaretLineBackAlpha but what triggers it exactly is unknown.

I was able to reproduce the crash by opening two tabs with csv files and then get specific circumstances in sessions.xml, The first tabfile has to have firstVisibleLine="222" (or at least not line 0) which would cause the lexer to set the transparent cursor line only when examining the second file. Combined that with two files one UTF8 and one ANSI file, so different encodings. The second file is a Chinese ANSI file, with a specific fileame, or maybe a certain folder name this would trigger the crash.

But even then, renaming the ANSI file by one character (both the filename and the filename in sessions.xml) and then it wouldn't crash anymore, and just open the two files normally.

I was able to reproduce it with the following steps, see the files in attachement:

  1. open file ERROR_ON_LINE_INCORRECT_test123.csv as first tab
  2. open file ANSI_NO_SYNTAX_COLS_test123.csv as second tab
  3. In first tab scroll cursor line for example to line 222
  4. Select the second tab and set cursor at start of file
  5. Close Notepad++
  6. Restart Notepad++
  7. Notepad++ immediately freezes

So Notepad++ would starts and immediately freeze, it shows an empty white window, then closes. Deleting the sessions.xml solves the problem.

Tested on Windows 10, CSV Lint v0.4.6.4 and with different Notepad++ x64 versions Notepad++ v8.5.3, Notepad++ v8.5, Notepad++ v8.4 all with the same result.

csvlint_v0464_startup_error.zip

BdR76 commented 1 year ago

This issue is fixed in the latest version v0.4.6.5, see the releases page.