Author Topic: slickedit closes all by itself  (Read 449 times)

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
slickedit closes all by itself
« on: November 08, 2018, 12:46:13 pm »
I was looking into a question about scrolling that was asked on here today and went to look at the fast_scroll function.  I typed fp fast_scroll on the command line and mouse.e gets opened with the cursor on the fast_scroll function.  One second later slickedit closes without asking if I want to save files or configuration.  When I restart it it's forgotton that mouse.e was open.  It's 100% repeatable.
Second issue - I opened a slick C file of my own and typed in a call to fast_scroll, then I used Ctrl-dot to take me  to mouse.e  -  which it did but one second later slick closed.  When I restarted, autosave popped up and told me about unsaved changes and it showed me the recovered file test5.e  -  but it has made the language mode of test5.e to now be "plain text" instead of slick C.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
Re: slickedit closes all by itself
« Reply #1 on: November 08, 2018, 05:00:21 pm »
That sounds more like crashing rather than closing.  If I had to guess I would say maybe a tag file has been corrupted, and that accessing is causing an exception that isn't caught or something we haven't seen before.  If you attach a debugger to a running process and then try to repeat your steps, you may be able to capture a dump file of any exceptions that are occurring.  If it is not an an exception, then will have to try something else, like maybe something is triggering fexit command.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #2 on: November 09, 2018, 07:53:58 am »
It's crashing on every slick c file I tried from the installation folder but not on my own slick c files.  I rebuilt the slick c tag file but it didn't help so I deleted the tag file and it got rebuilt very quickly but still crashed.
After getting the dump below I deleted vslick.sta and the crashing stopped so please yourselves whether you want to investigate or not.

Visual studio reported this.
Quote
Unhandled exception at 0x00007FFB5A01A388 in vs.exe: Microsoft C++ exception: cmException at memory location 0x000000D21CEF0D18. occurred

Here's a zip of my config and a zip of the dump file.
https://drive.google.com/open?id=1CsuvvxLFSXjbyts1wJmt4vpS6d-bkc8k

https://drive.google.com/open?id=1z8rfHHX6yfHb3PaDe5Lk4_DkJOu3ThGP


Quote
SlickEdit Pro 2018 (v23.0.0.11 64-bit)

Build Date: October 30, 2018
Emulation: CUA

OS: Windows 10 x64
OS Version: 10.00.0 
Memory: 40% Load, 3356MB/8189MB Physical, 4155MB/9469MB Page File, 4579MB/134217727MB Virtual
Shell Information: C:\WINDOWS\system32\cmd.exe /q
Screen Size: 1618 x 1050, 1680 x 1050, 1680 x 1050

Project Type: Cpp
Language: .e (Slick-C)
Encoding: Automatic

Installation Directory: C:\Program Files\SlickEdit\Pro 23-0-0-11\ (non-removable drive,NTFS,115182MB free)
Configuration Directory: C:\SlickConfig\23.0.0\ (non-removable drive,NTFS,115182MB free)
Migrated from: C:\SlickConfig\22.0.2\
Spill File: C:\Users\GP\AppData\Local\Temp\$slk.12116 (non-removable drive,NTFS,115182MB free)


Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #3 on: November 09, 2018, 09:29:33 am »
oops, I take it back.  Now slick crashes as soon as I run it because I have mouse.e open.

So I start a brand new config, load all my macro files, import all my options from old config, try a few things, slick c installation files don't make it crash.  Close and re-open slick, seems fine, so now I start xretrace, go to a slick c file  - slick crashes.  Restart and turn off xretrace, slick still crashes.

Yikes, I would love it if you could investigate.


Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
Re: slickedit closes all by itself
« Reply #4 on: November 09, 2018, 03:10:15 pm »
For the workspace loaded, is it under version control?  Does the same exception occur with no workspace loaded?

This could be something in backup history.  Nothing obvious is crashing with just the config, so it could be your backup history which I don't have.  Try moving backup history directory, I am specifically thinking something may be up with mouse.e history.
« Last Edit: November 09, 2018, 03:35:56 pm by Lee »

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #5 on: November 09, 2018, 08:16:29 pm »
I created a file abc.txt in the installation macros folder and it still crashes when I open that file.  I then tried changing the backup history path from ./SlickBackups/ to c:\temp and the crashes have stopped  -  great suggestion, thanks.  It might be something to do with xretrace.  I need to find out what it is because I've posted this code on the forum.  The latest version of xretrace creates a sub-folder where a source file is called xretrace_data.  I put files in there to keep track of "local" bookmarks for a buffer and where the cursor has been.  I call _save_config_file to save the file and a ./SlickBackups sub-folder gets created.  I recall 2 or 3 weeks ago I had to change the permissions on a folder to allow the xretrace files to be created.  I'll do some more testing.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #6 on: November 09, 2018, 08:34:22 pm »
It looks like it's fine if I have xretrace disabled.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #7 on: November 09, 2018, 08:54:24 pm »
If I call save_file(p_buf_name, '') instead of _save_config_file in xretrace, the crashes stop.  However my customized version of save_file is now giving me error -18.  I have save_file set up to make a copy of the file being saved in a directory on google drive  - I have no idea why that would go wrong.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
Re: slickedit closes all by itself
« Reply #8 on: November 09, 2018, 09:34:40 pm »
_save_config_file() does include user backup settings when saving the file.  Error -18 is NO_MORE_FILES_RC, which in this case probably means we tried to get file attributes for the file in question and were not able.  What permissions  changed on the folder in question, from what to what?

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #9 on: November 09, 2018, 09:51:52 pm »
Thanks.  I'm going to change xretrace to do this
_save_file(maybe_quote_filename(p_buf_name))
 instead of save_config_file, and I'll make the creation of these files off by default.
I suspect my customized version of save_file needs to add maybe_quote_filename as I think the error -18 was for files with spaces in the pathname.
I suspect we should try to figure out why a backup history path of ./SlickBackups\ gave an unhandled exception crash for "Program Files" pathnames.  I'm not sure if it's permissions or spaces  - I'm also not sure what's happening with permissions right now  - I'll test some more.


Code: [Select]
   _str pa = 'C:\Users\GP\Google Drive\slick\copy-on-save\' :+ strip_filename(filename,'DN');
   if (!path_exists(pa)) {
      int result = make_path(pa);
      if (result) {
         _message_box("slick backup make path failed : " :+ result :+ pa);
         return status;
      }
   }

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #10 on: November 10, 2018, 10:53:32 pm »
So far I'm unable to figure this out.  In the installation macros folder, my xretrace macro creates a sub-folder called xretrace_data.  I write files into that folder using _save_config_file().  I don't remember why I used that but I'm going to change it.  It results in a SlickBackups sub-folder being created for delta backups.  I changed the permissions on the SlickBackups folder and the problem stopped happening but now I'm unable to make the problem come back.  Changing permissions in Windows 10 is painful and it sometimes gives me "an error has occurred" - I guess because I enabled a "deny - full control" or something.

So now I had an idea, I'll open a file from an older installation of slickedit - say V21-0-1 - where I haven't fiddled with permissions.  I try changing alias.e but it won't let me, so I close slick and restart using "run as administrator" - now I can save alias.e and a delta backup gets created in a SlickBackups sub-folder.  However there's no xretrace_data folder  - I guess because there's no write permission into the "macros" folder.  In exlporer I right click -> new folder -> windows says -> you need to be admin, click continue -> I can create a folder.  Now back to slick, create a bookmark using xretrace  -> xretrace succeeds in creating an xretrace_data sub-folder and writes files into it.  Now run slick as non admin and I'm no longer able to write to the xretrace_data sub-folder.  Now I enable "full control" for non admins on xretrace_data and once again slick can write to both xretrace_data and SlickBackups.  Now I deny all permissions for non admins on SlickBackups folder and windows won't even let me view the folder and I can't open a file from it in slick......  but xretrace save-config-file is not crashing.  I give up.  I don't know how to make it crash right now.
Let me know if there's anything you want me to try.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #11 on: November 10, 2018, 11:09:25 pm »
Well now I had another idea.  I'm wondering why just going to (visiting) mouse.e makes it crash because I suspect xretrace won't be trying to write to xretrace_data just because I jumped to a file.  So I add some debug code to xretrace and yep, there's no call to save-config-file when I first go to visit a file  - but after re-starting xretrace (it stopped because I re-loaded xretrace.e) - once again slick crashes.  Yay  -  what is it trying to do when it crashes and what's it got to do with ./SlickBackups\.  I'll try to figure it out.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #12 on: November 10, 2018, 11:23:00 pm »
Actually I take it back slightly, when I first go to visit a file that xretrace hasn't seen before, it tries to create a new file in the xretrace-data sub-folder  - so right now I can visit alias.e without slick crashing but as soon as I open ada.e from the same folder, slick crashes because it tries to create a new file using _open_temp_view using "create if not found" set true, followed immediately by a call to _save_config_file.  Create file (in xretrace_data) is succeeding so...  It must be the call to _save_config_file is crashing because it can't even read the SlickBackups sub-folder, let alone write to it.

Code: [Select]
static void create_new_file_k(_str fn)
{
   int new_wid, orig_wid;
   boolean was;
   if (_open_temp_view(_maybe_quote_filename(fn), new_wid, orig_wid, '', was, true, false, 0, true) == 0)
   {
      insert_line('xretrace rev 001');

      // we insert the full path and name of the file even though this might not match at some point
      // in the future if the project source folders are copied to another location.
      // if XRETRACE_USE_SUBFOLDER is defined then the project source can be copied to a different location
      // and the xretrace marker data gets copied with it and is usable.
      // if XRETRACE_USE_SUBFOLDER is not defined then all xretrace marker data files are stored in
      // one single folder and the marker data files are valid only if the project source files
      // remain in their original location

      insert_line(retrace_current_buf_name);
      files_active_since_startup:[retrace_current_buf_name] = fn;
      say("save config 1");
      _save_config_file();
      _delete_temp_view(new_wid);
      activate_window(orig_wid);
   }
}


Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: slickedit closes all by itself
« Reply #13 on: November 11, 2018, 10:38:20 am »
I've updated xretrace to fix this by not calling _save_config_file.
https://community.slickedit.com/index.php/topic,16598.0.html

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4536
  • Hero Points: 349
Re: slickedit closes all by itself
« Reply #14 on: November 11, 2018, 02:44:12 pm »
I've been trying to investigate this a bit. It doesn't look like specifying a relative backup directory for "Backup directory path" is supported when "Make backup files" is set to "Create backup history on save". Docs don't seem to be clear on this though. You do still get backup files created but it looks like the backup system isn't working right.

I tried testing a backup location where the initial backup directory couldn't be created but I didn't get a crash. I did get a Slick-C stack bringing up the Backup History Browser.