focus-editor / focus

A simple and fast text editor
GNU General Public License v3.0
1.82k stars 99 forks source link

Assertion failed in file W:focus/src/buffer.jai at line 180, char 5: buffer is dirty, can't calculate line of offset #336

Closed JesseRMeyer closed 7 months ago

JesseRMeyer commented 7 months ago

Hi, on the latest 0.3.4-2, running the build command crashes focus with the message in the title. This did not occur on the dropbox version you provided from Discussions the other day.

focus-editor commented 7 months ago

Does this always happen? Can you give more details please?

On Tue, Apr 9, 2024, 10:11 AM Jesse Meyer @.***> wrote:

Hi, on the latest 0.3.4-2, running the build command crashes focus with the message in the title. This did not occur on the dropbox version you provided from Discussions the other day.

— Reply to this email directly, view it on GitHub https://github.com/focus-editor/focus/issues/336, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4OX77RNQZWSAMAZYDYS7STY4MIZPAVCNFSM6AAAAABF5PDFFSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTEMJXGU2TMNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JesseRMeyer commented 7 months ago

Sorry for the rush. No it doesn't occur everytime. Seems to only happen when there is a regex match for an error when a build fails. In that case, it is failing every time for me.

focus-editor commented 7 months ago

Please disable the error regex and send here the build output that would crash the editor, together with the regex. I won't be able to look at it right away but will do first thing when I can

On Tue, Apr 9, 2024, 10:27 AM Jesse Meyer @.***> wrote:

Sorry for the rush. No it doesn't occur everytime. Seems to only happen when there is a regex match for an error when a build fails. In that case, it is failing every time for me.

— Reply to this email directly, view it on GitHub https://github.com/focus-editor/focus/issues/336#issuecomment-2043743279, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4OX77XP775XSMRBFXNQGITY4MKU7AVCNFSM6AAAAABF5PDFFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTG42DGMRXHE . You are receiving this because you commented.Message ID: @.***>

JesseRMeyer commented 7 months ago
F:/Play/server/src/main_windows.odin(18:3) Syntax Error: #partial can only be applied to a switch statement
    #partial switch err := win32.System_Error(win32.WSAGetLastError( ...
    ^
F:/Play/server/src/main_windows.odin(18:12) Syntax Error: You cannot use a switch statement in the file scope
    ... partial switch err := win32.System_Error(win32.WSAGetLastError() ...
                ^
F:/Play/server/src/main_windows.odin(18:12) Syntax Error: You cannot use a switch statement in the file scope
    ... partial switch err := win32.System_Error(win32.WSAGetLastError() ...
                ^
ERROR: exit code 1  [Elapsed: 0.037s]

^(?P<file>.*)[(](?P<line>\d+)[:](?P<col>\d+)[)] (?P<type>Syntax Error|Syntax Warning|Error|Warning): (?P<msg>.*)

focus-editor commented 7 months ago

Thanks. Other people have reported crashes which indicate there's a memory allocator issue. Please revert to the previous version until it's fixed

On Tue, Apr 9, 2024, 12:10 PM Jesse Meyer @.***> wrote:

F:/Play/server/src/main_windows.odin(18:3) Syntax Error: #partial can only be applied to a switch statement

partial switch err := win32.System_Error(win32.WSAGetLastError( ...

^ F:/Play/server/src/main_windows.odin(18:12) Syntax Error: You cannot use a switch statement in the file scope ... partial switch err := win32.System_Error(win32.WSAGetLastError() ... ^ F:/Play/server/src/main_windows.odin(18:12) Syntax Error: You cannot use a switch statement in the file scope ... partial switch err := win32.System_Error(win32.WSAGetLastError() ... ^ ERROR: exit code 1 [Elapsed: 0.037s]

^(?P.)(:[)] (?PSyntax Error|Syntax Warning|Error|Warning): (?P.)

— Reply to this email directly, view it on GitHub https://github.com/focus-editor/focus/issues/336#issuecomment-2043915755, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4OX77WZ3NJ5YLJCXZCDQ5DY4MWVVAVCNFSM6AAAAABF5PDFFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTHEYTKNZVGU . You are receiving this because you commented.Message ID: @.***>

focus-editor commented 7 months ago

Unfortunately I can't reproduce it no matter how hard I'm trying, which is bad. I might have to send you a couple more builds to test later.

focus-editor commented 7 months ago

@JesseRMeyer please can you try a debug build here and tell me if you're seeing the error there https://drive.google.com/drive/folders/16akMNqEJmfuY2FX6KrbmFLhieMdxzetv?usp=sharing

JesseRMeyer commented 7 months ago

Sure, and yes, I still am.

Also I note a crash-report.txt in the focus directory that is a stack dump which may help.

Assertion failed in file W:/focus/src/buffer.jai at line 180, char 5: 
buffer is dirty, can't calculate line from offset

Stack trace:
W:/focus/modules/Runtime_Support.jai:816: report_error_in_yer_face
W:/focus/modules/Runtime_Support.jai:791: report_failed_assertion_more_visibly
W:/focus/modules/Runtime_Support.jai:108: runtime_support_assertion_failed
C:/jai/modules/Basic/module.jai:87: assert_helper
W:/focus/src/buffer.jai:180: offset_to_real_line
W:/focus/src/editors.jai:1217: select_line
W:/focus/src/build_system.jai:729: go_to_current_build_error
W:/focus/src/build_system.jai:367: go_to_next_build_error
W:/focus/src/build_system.jai:232: build_system_update
W:/focus/src/main.jai:309: main
focus-editor commented 7 months ago

Thanks, that's helpful. I think this one fixes it https://drive.google.com/drive/folders/16akMNqEJmfuY2FX6KrbmFLhieMdxzetv

JesseRMeyer commented 7 months ago

That seemed to fix it! I toyed around a bit and could not recreate the crash anymore.