Author Topic: Fun corner case in Options -> App Colors.  (Read 2262 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
Fun corner case in Options -> App Colors.
« on: September 02, 2016, 08:05:53 pm »
Right click in the SampleCode box.


You can set breakpoints :-)
And code annotations (though, the annotations get set on whatever buffer most recently had focus.




Bookmarks work better here -- then when you goto the bookmark it opens buffer with the same code in it!
(Bookmarks work in the beautifier settings too - cool).


Oops - after closing Options, trying to delete the bookmarks:

---------------------------
Slick-C Error
---------------------------


file=bookmark.ex offset=13799
---------------------------
OK   
---------------------------

stack[2016-09-02T13:01:38Z] Slick-C STACK TRACE ******************************
stack[2016-09-02T13:01:38Z] Created on 9/2/2016 at 13:1:38 (805 ms)
stack[2016-09-02T13:01:38Z] SlickEdit Pro Version 21.0.0.5 Copyright 1988-2016 SlickEdit Inc.
stack[2016-09-02T13:01:38Z] Edit module and type "st -f <offset>" to get the
stack[2016-09-02T13:01:38Z] run-time error position
stack[2016-09-02T13:01:38Z]
stack[2016-09-02T13:01:38Z] error code=-3009
stack[2016-09-02T13:01:38Z] Invalid number argument
stack[2016-09-02T13:01:38Z]

Then Slick crashes and is terminated by Windows :-(
(I can upload a minidump if you need it).

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #1 on: September 02, 2016, 09:56:18 pm »
I tried to reproduce this but no luck. Minidump won't be useful since this is really a Slick-C bug.

I added a bookmark by using the context menu "Toggle Bookmark". Then I displayed the bookmarks tool window and deleted it but nothing happened. I tried some other things too.

Can you post steps to reproduce this?

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
Re: Fun corner case in Options -> App Colors.
« Reply #2 on: September 02, 2016, 10:38:20 pm »
The minidump was for the access violation crash, not the slick stack.

Repro:
Open a CPP File.
Document-> C/C++ Options.
Select the bookmarks tool window (my is docked on the bottom of slick main window).
In Options click Tools > Options > Languages > Application Languages > C/C++ > Formatting
Right click in the CodePreview.
Select ToggleBookmark


In the bookmarks toolwindow a new bookmark shows up "Something::getStorage():15"
Dismiss options.
Double-click on the bookmark -- nothing happens.
RightClick->Delete that bookmark.
SlickC error and Slick Stack appear.

Dismiss the error and now Slick crashes and is terminated by Windows.


When I start slick again, my workspace and buffers get restored, but no buffer windows are restored. The tool windows show up the way they ought to.


When I try to add a bookmark on an <Untitled> buffer, it failed "buffer has no name"

Same stack and crash doing Alt+F2 to toggle bookmark in RegExEvaluator tool and calculator.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #3 on: September 02, 2016, 10:49:02 pm »
The toggle_bookmark command should be disabled here.

I think the new_annotations command should be disabled here too.

I managed to get a crash after a Slick-C stack but I don't know what the trick was. I was deleting a bookmark for an untitled buffer that I closed but not the one that was in the options dialog. I don't know if was related or not. It could just have to do with bookmarks in untitled files.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #4 on: September 02, 2016, 10:55:56 pm »
Crash has nothing to do with setting a bookmark in the options dialog. I getting close to reproducible steps.

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
Re: Fun corner case in Options -> App Colors.
« Reply #5 on: September 02, 2016, 10:57:35 pm »
Weird - since for me it clearly is related to deleting the bookmark - since it happens with options, RegEx and Calculator.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #6 on: September 02, 2016, 11:34:08 pm »
Setting a bookmark in an Untitled buffer causes a similar problem to what you're seeing.

I've fixed the crash. The crash is a down stream error handling problem due to setting a bookmark in an Untitled buffer, closing it, then deleting the bookmark. There's a little other hocus pocus needed to get the crash but not much.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #7 on: September 02, 2016, 11:40:41 pm »
Weird - since for me it clearly is related to deleting the bookmark - since it happens with options, RegEx and Calculator.

Since toggle_bookmark will be disabled for these scenarios, I probably won't bother looking into it further. I think the problem here has to be with certain callbacks not being called to notify the bookmark handling.

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
Re: Fun corner case in Options -> App Colors.
« Reply #8 on: September 14, 2016, 05:58:21 pm »
RC1: Toggle bookmarks (Ctrl+f2) still works in options, calculator and regex.
It doesn't crash anymore though.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #9 on: September 14, 2016, 08:31:51 pm »
RC1: Toggle bookmarks (Ctrl+f2) still works in options, calculator and regex.
It doesn't crash anymore though.

RC1: toggle-bookmark doesn't set a bookmark for me in the calculator or regex. I ran with your config too.

jporkkahtc

  • Senior Community Member
  • Posts: 1901
  • Hero Points: 184
  • Text
Re: Fun corner case in Options -> App Colors.
« Reply #10 on: September 14, 2016, 08:44:02 pm »
Oops, I meant Alt+f2 -- Set-bookmark


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5146
  • Hero Points: 425
Re: Fun corner case in Options -> App Colors.
« Reply #11 on: September 14, 2016, 08:52:33 pm »
Ah...That one can be hot fixed if necessary.