skyjake / lagrange

A Beautiful Gemini Client
https://gmi.skyjake.fi/lagrange/
BSD 2-Clause "Simplified" License
1.22k stars 65 forks source link

Specific midnight.pub post is crashing lagrange 1.17.6 #681

Closed mycrobe closed 2 months ago

mycrobe commented 2 months ago

I'm running Lagrange 1.17.6 on macOS 14.6.1.

I noticed that navigating to this URL causes Lagrange to immediately crash: gemini://midnight.pub/posts/2179

This page works fine on commandline in bombadillo, and in Lagrange / iOS 1.17 (13). The page looks like it's doing interesting things with special characters.

Here's a stacktrace from the crash. It looks like it might have some useful info in it:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes:       0x0000000000000001, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [96177]

VM Region Info: 0 is not in any region.  Bytes before following region: 4342153216
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      102d00000-102e6c000    [ 1456K] r-x/r-x SM=COW  /Applications/Lagrange.app/Contents/MacOS/Lagrange

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib               0x19d7b22ac _platform_memmove + 268
1   Lagrange                               0x102df5cb4 cstr_Rangecc + 48
2   Lagrange                               0x102d2fb38 find_Lang_ + 400
3   Lagrange                               0x102d2fea4 translate_Lang + 164
4   Lagrange                               0x102dc2d0c replaceVariables_LabelWidget_ + 28
5   Lagrange                               0x102dc2eec updateText_LabelWidget + 48
6   Lagrange                               0x102d47564 updateWindowTitle_DocumentWidget_ + 976
7   Lagrange                               0x102d44048 documentWasChanged_DocumentWidget_ + 92
8   Lagrange                               0x102d48d24 updateDocument_DocumentWidget_ + 3916
9   Lagrange                               0x102d4e7b0 checkResponse_DocumentWidget_ + 1332
10  Lagrange                               0x102d4afc4 handleCommand_DocumentWidget_ + 2932
11  Lagrange                               0x102d457d0 processEvent_DocumentWidget_ + 1592
12  Lagrange                               0x102db839c dispatchEvent_Widget + 812
13  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
14  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
15  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
16  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
17  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
18  Lagrange                               0x102db8314 dispatchEvent_Widget + 676
19  Lagrange                               0x102d8ee0c dispatchEvent_Window + 460
20  Lagrange                               0x102d8e708 processEvent_Window + 1044
21  Lagrange                               0x102d06e74 processEvents_App + 1372
22  Lagrange                               0x102d0d998 run_App + 4368
23  Lagrange                               0x102d05408 main + 256
24  dyld                                   0x19d3f7154 start + 2476
skyjake commented 2 months ago

This is most likely already fixed for the upcoming v1.18. I've disabled translation of window title text (updateWindowTitle_DocumentWidget_).

mycrobe commented 2 months ago

Confirming this is fixed in my hands on 0.18