Author Topic: reloading clipbd.e causes stack traces when using list-clipboards  (Read 10309 times)

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
I was trying to figure out a problem with list-clipboards (when I use it, sometimes it chooses a clipboard other than the one I select, usually one below or above the line I chose) when I discovered that reloading clipbd.e leads to a very frustrating problem: invalid argument errors when calling activate-window with an argument of value 0 (in the call to put_in_box(temp_view_id) where temp_view_id = 0).

Any idea why this would be happening?  (Or what's wrong with list-clipboards?)

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #1 on: November 05, 2007, 04:05:18 AM »

Quote
I was trying to figure out a problem with list-clipboards (when I use it, sometimes it chooses a clipboard other than the one I select, usually one below or above the line I chose) when I discovered that reloading clipbd.e leads to a very frustrating problem: invalid argument errors when calling activate-window with an argument of value 0 (in the call to put_in_box(temp_view_id) where temp_view_id = 0).

Any idea why this would be happening?  (Or what's wrong with list-clipboards?)


What version of slick?

I dunno what the problem with list-clipboards is but possibly closing and restarting slick would be a good idea after reloading clipbd.e - or at least close the list-clipboards window..  Can you find how to reproduce the problem e.g. does it need a selection active to start with.  Try adding the "say" command to various parts of list-clipboards to see what is going wrong.  Have you made any changes to clipbd.e from the standard installation?

Graeme

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #2 on: November 05, 2007, 11:41:33 AM »
There are some known problems with the SE internal clipboard (see http://community.slickedit.com/index.php?topic=1881.0).
For the time being use the 'reset-clipboards' command on cmdline to recover. Hopefully it's available in your SE version.
BTW: I strongly recommend to 'reset-clipboards' as soon as you recognize a corruption particularly if you set up 'Tools>Options>General -> Autorestore: Clipboards'. SE might fail to restore properly when restoring the corrupted clipboard.
HS2
« Last Edit: November 05, 2007, 11:49:47 AM by hs2 »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #3 on: November 05, 2007, 01:53:31 PM »
alex:  Which version of SlickEdit are you using, and what platform are you running on?  I've been trying to track down some of these clipboard related issues and have had very little success recreating or reproducing them, so any extra info you can provide will help us track them down.  The list-clipboards problem sounds like the clipboard ring buffer is corrupt.  When list-clipboards is off by one, is the normal paste command not pasting the last copied entry as well?  The problem with reloading clipbd.e is a different and new problem, which is the first I've heard of.  You may try reset-clipboards command (as hs2 suggests) instead if it is a problem with a corrupted clipboard buffer to see if that helps.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #4 on: November 05, 2007, 02:16:11 PM »
Lee: The 'paste wrong (+/- 1) clip' problem usually arises if one of the previous clips was/is corrupted (':CHAR 1 * 79 0' or similar). I think it's not a real off-by-one problem. It's all caused by corrupted clipboard (ring) entries...
HS2

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #5 on: November 05, 2007, 05:45:37 PM »
Thanks for the replies!  I discovered why reloading clipbd.e was causing trouble--I'd somehow deleted an important line from list-clipboards.  PEBKAC!

But that doesn't solve the real issue of list-clipboards not behaving correctly.

Lee: I'm using VS 12.0.3, on Win XP SP2, in Vim emulation mode (I wonder if this matters?  It's a highly consistent problem if I just copy three lines onto the clipboard, and try to paste whatever text is copied on to the middle of  the list of clipboards, it usually pastes one of the other lines).  I usually use the "dd" command to copy multiple pieces of text onto the clipboard.  I haven't noticed any indications of corruption in the actual content of the list-clipboards dialog--nothing along the lines described by hs2.

I have not found reset-clipboards to be terribly helpful--at any event, it quickly becomes corrupt after copying more than three lines to the clipboard.

Is there any easy way to view the state of the clipboard ring besides list-clipboards?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #6 on: November 05, 2007, 10:02:47 PM »
Thanks for the additional info, it definitely looks like a problem with named clipboard entries.  Lets test a small change, and see if it holds up for you.

macros/clipbd.e ($Revision: 1.58.4.5 $):  line 2098, change
Code: [Select]
   if ( show_cb_name ) {
      goto_named_clipboard(i);  /* HERE - GOTO-NAMED-CLIPBOARD can handle a number */
   } else {
      goto_clipboard(Nofclipboards-i+1);
   }

to this
Code: [Select]
//   if ( show_cb_name ) {
      goto_named_clipboard(i);  /* HERE - GOTO-NAMED-CLIPBOARD can handle a number */
//   } else {
//      goto_clipboard(Nofclipboards-i+1);
//   }

I have do some more checking, but I think this will at least clear up this issue with vim users and list-clipboards.  If you don't report any problems with it, I'll go ahead and roll into the latest hotfix.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #7 on: November 05, 2007, 11:51:47 PM »
Interesting patch since it seems to change the code path at least for my setup (show_cb_name = 0).
I've also applied the fix and for now it also works for non-VIMs like me (Brief)...
HS2

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: reloading clipbd.e causes stack traces when using list-clipboards
« Reply #8 on: November 06, 2007, 12:20:49 AM »
My preliminary results are good--I haven't yet had a problem that would have thrown previous test cases for a loop.  Thanks!  I'm really psyched that I can use this feature now.  With Vim emulation, multiple CBs is a huge win.