SpartanJ / ecode

Lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance.
MIT License
938 stars 13 forks source link

Crashed #330

Closed Curculigo closed 3 weeks ago

Curculigo commented 2 months ago

This is the code of a Win32 program. There are .h files, .cpp files, mixed together with .rc files. I dragged them into the editor. Crashed.

ecode.exe caused an Access Violation at location 00007FFBDB4F8B36 in module ntdll.dll Writing to location 0000000000000024.

AddrPC           Params
00007FFBDB4F8B36 0000000000001CC0 0000000000000001 0000008901615610  ntdll.dll!RtlpWaitOnCriticalSection+0xb6
00007FFBDB4F7124 0000008901D7D020 000000897A12D5B0 0000000000000000  ntdll.dll!RtlpEnterCriticalSectionContended+0xa4
00007FFBCEA0CAA3 000000897A58F560 0000008901D7D0E8 682E746E65696C43  eepp.dll!EE::UI::Doc::TextDocument::notifySyntaxDefinitionChange+0x23
00007FFBCEA28621 0000000000000000 000000897A58F660 000000897A58F680  eepp.dll!EE::UI::Doc::TextDocument::resetSyntax+0x121
00007FFBCEA2A607 0000000000000001 0000000000000000 00000089786FEF00  eepp.dll!EE::UI::Doc::TextDocument::loadFromFile+0xf7
00007FFBCEA2A769 000000897A0CA6D0 00000089017BA2E8 0000000000000000  eepp.dll!EE::UI::Doc::TextDocument::loadFromFile+0x259
00007FFBCEA57410 000000897A0C0A10 0000000000000000 0000000000000000  eepp.dll!EE::System::ThreadPool::threadFunc+0xc0
00007FFBCEA56D7A 00007FFBDAFD28C0 0000000000000000 0000000000000000  eepp.dll!EE::System::Thread::getId+0x2a
00007FFBDAF50B13 000000897A0C0A10 000000897A0C0A10 0000000000000000  msvcrt.dll!_callthreadstartex+0x2b
00007FFBDAF50BCD 0000000000000000 0000000000000000 0000000000000000  msvcrt.dll!_threadstartex+0x7c
00007FFBD8B813D2 00007FFBD8B813B0 0000000000000000 0000000000000000  KERNEL32.DLL!BaseThreadInitThunk+0x22
00007FFBDB5303C4 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!RtlUserThreadStart+0x34
SpartanJ commented 2 months ago

You can replicate it if you repeat the actions? This one looks really weird, it's crashing on a lock right after the document loaded, I cannot reproduce it but it could be just anything.

Curculigo commented 2 months ago

There is a directory in the list of files I dragged into ecode. This is the result of a faulty Ctrl+A because I don't expect that there is a directory there. If I exclude the directory, then everything will be fine. Btw, the editor should silently ignore the directory.

Curculigo commented 2 months ago

314 is a new feature to me. Btw, it should only trigger when there are no files but only a directory being dragged into ecode.

SpartanJ commented 2 months ago

Oh, thanks, that helps a lot, I can see a possible invalid memory access for that case. I'll fix it later, also ignore directories when dropped files and directories. I couldn't reproduce it yet since you need to be memory constrained to reproduce it, same as the previous crash I just fixed this weekend, but I already spotted the bug.