Author Topic: Need to delete $HOME/.slickedit/25.0.2./ directory every week or so  (Read 408 times)

John H.

  • Community Member
  • Posts: 44
  • Hero Points: 0
  • Systems and kernel programmer
Every few weeks, I run into this error:
$ vs
Failed to communicate with existing instance.
Try runnning SlickEdit again or terminating other instances.
...which I can only seem to "fix" by deleting the $HOME/.slickedit/25.0.2./ directory

Installation details, slightly sanitized:
SlickEdit Pro 2020 (v25.0.2.0 64-bit)

Serial number: [...]
Licensed number of users: Single user
License file: /home/username/slickedit-pro/bin/slickedit.lic

Build Date: May 15, 2021
Emulation: Visual Studio

OS: Linux
OS Version: Arch Linux
Kernel Level: 5.12.12-arch1-1
Build Version: #1 SMP PREEMPT Fri, 18 Jun 2021 21:59:22 +0000
Processor Architecture: x86_64

X Server Vendor: The X.Org Foundation
Window Manager: KWin
Display manager: /usr/bin/sddm

Memory: 51% Load, 13988MB/27062MB Virtual
Shell Information: /home/username/slickedit-pro/bin/secsh -i
Screen Size: 3840 x 2160, 3840 x 2160

Project Type: (Other)
Language: .c (C/C++)
Encoding: UTF-8, no signature

Installation Directory: /home/username/slickedit-pro/
Configuration Directory: /home/username/.slickedit/25.0.2/
Migrated from: /home/username/.slickedit/25.0.1/
Spill File: /tmp/$slk.username.134056


« Last Edit: June 22, 2021, 05:56:38 am by John H. »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1651
  • Hero Points: 140
Re: Need to delete $HOME/.slickedit/25.0.2./ directory every week or so
« Reply #1 on: June 22, 2021, 02:10:46 pm »
I haven't seen this before.  Looking at the code my suspicion is with the pid files we keep under $HOME/25.0.2/instances. If something prevented the file from being deleted when the editor exited, and another process took this PID, AND our checking missed the fact that the process wasn't a SlickEdit, then it would cause what you're seeing.  I don't see another code path for that error.  I've only taken a brief look at the checking and cleanup code, and it doesn't look obviously wrong, but I need to take a closer look later this morning.

Have you had any crashes, or had to kill the editor with kill -9 or anything like that?

In case I don't find anything, here are things to check when it happens again:

1) When this is happening, do you have another instance of SlickEdit running?  Running vs without +new implies there may be another editor you want to open the file in.  Check the process list and make sure that the number of vs_exe processes matches the number SlickEdit editors you have running.  In the unlikely case where there's a editor that got stuck cleaning up after it closed the main window.

2) ls $HOME/.slickedit/25.0.2/instances.   There will be files whose names are PID numbers.  Do you have more than actual open editors?   With your editors all closed, are there still files there?  If so, do any of them match the PID's of any running processes?

Once you've checked that, you should be able to recover by closing any running SlickEdit windows, and then  just removing the contents of the $HOME/.slickedit/25.0.2/instances directory, rather than the entire config, unless I've completely missed what's going on.

John H.

  • Community Member
  • Posts: 44
  • Hero Points: 0
  • Systems and kernel programmer
Re: Need to delete $HOME/.slickedit/25.0.2./ directory every week or so
« Reply #2 on: June 22, 2021, 07:15:58 pm »
OK, I will check those things, the next time this happens. (I just checked now, while everything is working fine, and everything looks right.) I'll report back here with details if this occurs again.

thanks!

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1651
  • Hero Points: 140
Re: Need to delete $HOME/.slickedit/25.0.2./ directory every week or so
« Reply #3 on: July 06, 2021, 07:48:52 pm »
I did verify there is a way for this to happen.  I actually accidentally reproduced it while working on a debugging problem where I was repeatedly causing segfaults.  I ended up with a few orphaned pid files in the instances directory. 

I'm working a fix for that which will be in the next release or point release.  Not hot-fixable. 

John H.

  • Community Member
  • Posts: 44
  • Hero Points: 0
  • Systems and kernel programmer
Re: Need to delete $HOME/.slickedit/25.0.2./ directory every week or so
« Reply #4 on: July 06, 2021, 08:42:35 pm »
Great timing, because this just happened again this morning, after the computer was rebooted as part of a routine update. I checked and found one pid file. Deleting that file allowed SlickEdit to start normally.

Looking forward to your fix, whenever it gets here. And I'm glad that the workaround is easy and safe.