#1773 Accessing certain pane properties crashes SciTE

Bug
closed-fixed
4
2016-12-30
2015-10-25
felix
No

Executing any of the following lines of Lua crashes SciTE.

print(editor.DirectFunction)
print(editor.DirectPointer)
print(editor.DocPointer)
print(editor.CharacterPointer)

Discussion

  • Neil Hodgson

    Neil Hodgson - 2015-10-25

    They show an error message and terminate SciTE since these functions should not be called by the part of the interface code to Scintilla which is used by scripts. The error message is shown on Windows but doesn't currently appear on GTK+ which doesn't handle fatal panics well.

     
    • felix

      felix - 2016-05-03

      If they should not be called, why are they exposed at all?! Why couldn't these accesses just return nil instead of crashing loudly? Even an error box is wrong here; it's supposed to be a programmatic interface. Doing the equivalent of

      for key, value in pairs(editor) do
          print(key, value)
      end
      

      (which I had to monkeypatch in anyway) should neither crash nor inconvenience the user in any way.

       
      • Neil Hodgson

        Neil Hodgson - 2016-05-03

        They are exposed by some generic code that doesn't understand that the call it uses is dropping bits from (64-bit when on 64-bit platforms) pointers returned through a 32-bit interface.

        If its important to you then handle the ScintillaFailure exception in the scripting layer.

         
  • Neil Hodgson

    Neil Hodgson - 2015-10-25
    • labels: --> scite
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 4
     
  • Neil Hodgson

    Neil Hodgson - 2016-12-13
    • labels: scite --> scite, lua
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2016-12-30
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks