Author Topic: Bug when switching projects.  (Read 2024 times)

flethuseo

  • Senior Community Member
  • Posts: 176
  • Hero Points: 2
Bug when switching projects.
« on: July 29, 2014, 06:54:07 pm »
I don't know why this is happening but I keep getting this Slick-C Stack trace every time I try to switch to another project. Or, sometimes just trying to close some of the buffers in the currently open project, it will keep throwing that stack trace. It's a real pain, and I don't know what is causing it:

Code: [Select]
Invalid argument
bufftabs.ex 5155 _cbquit_tabs(13,C:\dev\Prod.DC.Kingdom.Dev\C++\WellBoreTableIterator.cpp,,0)   p_window_id: 93   p_object: OI_EDITOR   p_name:
files.ex 10333 call_list(_cbquit_,13,C:\dev\Prod.DC.Kingdom.Dev\C++\WellBoreTableIterator.cpp,,0)   p_window_id: 93   p_object: OI_EDITOR   p_name:
saveload.ex 123 quit_file()   p_window_id: 93   p_object: OI_EDITOR   p_name:
window.ex 2041 _window_quit(1,1,0,0)   p_window_id: 93   p_object: OI_EDITOR   p_name:
files.ex 8872 close_buffer(1,0)   p_window_id: 93   p_object: OI_EDITOR   p_name:
files.ex 9058 quit(1,0)   p_window_id: 93   p_object: OI_EDITOR   p_name:

Also, this seems to happen after I issue a command like 'vs +new' in both the previous, and new process. I don't have a precise workflow, it just happens as I am working...
Any ideas?
« Last Edit: July 29, 2014, 06:59:26 pm by flethuseo »

flethuseo

  • Senior Community Member
  • Posts: 176
  • Hero Points: 2
Re: Bug when switching projects.
« Reply #1 on: October 31, 2014, 01:00:10 pm »
Seriously, this bug is very annoying. I don't know exactly what is going on, but it would be helpful if you can tell me what more information you need (and how to get it). I am attaching a few videos of the problem. When it happens I can't switch project or even close files, and it appears to happen when I have 2 Slickedit processes up (via vs +new).



Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2074
  • Hero Points: 101
Re: Bug when switching projects.
« Reply #2 on: October 31, 2014, 01:55:56 pm »
What version of SlickEdit are you using?

What happens if you close and reopen the file tabs tool window?

Graeme

  • Senior Community Member
  • Posts: 2117
  • Hero Points: 258
Re: Bug when switching projects.
« Reply #3 on: October 31, 2014, 01:56:58 pm »
Exactly what version of SlickEdit and what hotfixes?
Do you know that it definitely never happens when you only have one instance of slick running?
How many times a day does it happen - or how many times per 100 file closes would it happen?

Was SlickEdit working fine for a few months before the problem started happening?  If so, try
1. close slick, make a copy of your config folder
2. run slick, export all your options
3. close slick, delete your entire configuration folder
4. run slick, let it create a new configuration folder, import your previously exported options.
5. install hotfixes
See if the problem is gone.

Can you use the files toolwindow instead of bufftabs?
Have you tried the command document-tab-list-buffers for switching buffers instead of using file tabs  - or maybe enable "one file per window" and use doc tabs instead of file tabs.


flethuseo

  • Senior Community Member
  • Posts: 176
  • Hero Points: 2
Re: Bug when switching projects.
« Reply #4 on: October 31, 2014, 05:54:35 pm »
Exactly what version of SlickEdit and what hotfixes?
SlickEdit 2014 (v19.0.0.9 64-bit) Beta 6 (It has also happened in 2013)

Do you know that it definitely never happens when you only have one instance of slick running?
There have been a few times where it will have the same problem with one slickedit instance, but it's more likely to happen with multiple instances.

How many times a day does it happen - or how many times per 100 file closes would it happen?
It happens for various files when it does happen, and I'd say maybe once a week.

Was SlickEdit working fine for a few months before the problem started happening?  If so, try
1. close slick, make a copy of your config folder
2. run slick, export all your options
3. close slick, delete your entire configuration folder
4. run slick, let it create a new configuration folder, import your previously exported options.
5. install hotfixes
See if the problem is gone.
Not sure, the problem seems to have been around for a while.

Can you use the files toolwindow instead of bufftabs?
Have you tried the command document-tab-list-buffers for switching buffers instead of using file tabs  - or maybe enable "one file per window" and use doc tabs instead of file tabs.
I haven't. I didn't know filetabs were deprecated.

Graeme

  • Senior Community Member
  • Posts: 2117
  • Hero Points: 258
Re: Bug when switching projects.
« Reply #5 on: November 02, 2014, 05:26:56 am »
Hi
File tabs aren't deprecated.  I just thought doc tabs might work for you and not crash.  I just tried one file per window with doc tabs in RC2 and didn't like the results much - I seemed to get spurious multiple abbreviated tabs.

If you want to try debugging the crash, when it next crashes, get the error "offset" number (e.g. 5155 in the stack dump you posted), then open bufftabs.e in the editor, type st -f 5155 on the slick command line and slick will jump to the line of code that has the problem.  You then need to figure out which variable had the problem that generated the "default argument" error
e.g. if it was this line
      ptabsdata->buffid_order[buffid]._makeempty();
and buffid is an invalid index, then _makeempty would be called on some kind of null object that didn't support _makeempty.
So you could add a piece  of code before the above line to quit and force a delayed refresh of the file tabs.
Code: [Select]
if (buffid >= buffid_order._length)
{
      say("found the problem");  // comment this line out
      if (batch_call_list("refresh_file_tabs", null, true)) {
         ptabsdata->pending_refresh = true;
         //say("_cbquit_tabs: PENDING");
      }
      return;
}
Load the new code using the load module command on the macro menu.

But it might be easier to always force a delayed refresh by changing the existing line in _cbquit_tabs that calls batch_call_list to this
      if (batch_call_list("refresh_file_tabs", null, true)) {

The third argument true forces a delayed refresh of the file tabs, bypassing the piece of code that crashes.
Use at your own risk...

Graeme


 

flethuseo

  • Senior Community Member
  • Posts: 176
  • Hero Points: 2
Re: Bug when switching projects.
« Reply #6 on: February 03, 2015, 11:19:52 pm »
This bug persists, but I'll try to get more information as I encounter it because I don't have a way to reproduce it consistently. It also happens when I'm using one file tab per document tab. From the procedure Graeme mentioned, I found the following lines that seem to cause the slickC stack (highlighted in the red glow):

Code: [Select]
/**
 * Does any necessary adjustment of auto-sized controls.
 */
static void _tbfind_form_initial_alignment()
{
   rightAlign := _findtabs.p_width - _find_label.p_x;



Code: [Select]
/*** find tabs ***/
void _findtabs.on_create()
{
   _findtabs.p_DocumentMode = true;
Code: [Select]
}



« Last Edit: February 03, 2015, 11:24:20 pm by flethuseo »