Author Topic: SE 26 hang when finding references  (Read 1630 times)

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
SE 26 hang when finding references
« on: June 09, 2022, 11:33:22 PM »
I hit ctrl-/ on a symbol to find all references and now I've been looking at a grayed out SE screen with the blue ring mouse pointer for the last 20 minutes.  SE is consuming about 1 core's worth of CPU.  How can I tell if it's actually still looking for symbols or is just looping forever?  Is there a way to search in the foreground so that a cancel function is available?  I'd prefer not to kill the process as who knows what edits I'd lose.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SE 26 hang when finding references
« Reply #1 on: June 10, 2022, 12:40:26 PM »
Best thing you could do is attach a debugger to the hung process and collect a core dump or a dump file if you are on Windows.

The references and context tagging engine are designed to have limits and timeouts, so if you found a hang, you either discovered a deadlock or a special case which was not previously handled.

https://community.slickedit.com/index.php/topic,18869.0.html

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #2 on: June 11, 2022, 06:17:37 AM »
Hi Dennis
Thanks for the reply.  I restarted SE before I saw your reply as I had some work to complete.  I tried finding references to the same symbol after I restarted at it worked as expected.  If it happens again I'll be sure to get a minidump.
Thanks.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #3 on: June 14, 2022, 11:30:04 PM »
I have a minidump file but I can't share it with you as it contains strings that my company would consider proprietary.
In case it helps, here's a stack trace of the threads from the minidump:

Code: [Select]
0:000> ~*k

.  0  Id: 35f4.17c0 Suspend: 0 Teb: 000000c9`0e76b000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0e8f9540 00007ffc`88f2d0a7 tagsdb!cmDebug::`default constructor closure'+0xcc7d3
01 000000c9`0e8f9aa0 00007ffc`88f2f59a tagsdb!cmDebug::`default constructor closure'+0xec017
02 000000c9`0e8f9e40 00007ffc`88f30993 tagsdb!cmDebug::`default constructor closure'+0xee50a
03 000000c9`0e8fa3a0 00007ffc`88d65cb0 tagsdb!cmDebug::`default constructor closure'+0xef903
04 000000c9`0e8fa3d0 00007ffc`88d68eeb tagsdb!vsTagFindOccurrence+0x6e0
05 000000c9`0e8fab40 00007ffc`88d57cd8 tagsdb!vsTagListFileOccurrences+0x5b
06 000000c9`0e8fac70 00007ffc`8a1a4d36 tagsdb!tag_list_file_occurrences+0x78
07 000000c9`0e8facd0 00007ffc`8a1bbce6 vsapi!SEWorkspaceFindFile+0x73136
08 000000c9`0e8fad20 00007ffc`8a1bb1f0 vsapi!SENameGetName+0xafd6
09 000000c9`0e8faf60 00007ffc`89e3e896 vsapi!SENameGetName+0xa4e0
0a 000000c9`0e8fafc0 00007ffc`89e3e896 vsapi!cmNTRegQueryValue+0x12a66
0b 000000c9`0e8fb000 00007ffc`8a1f1030 vsapi!cmNTRegQueryValue+0x12a66
0c 000000c9`0e8fb040 00007ffc`89e6bfd1 vsapi!SENameGetName+0x40320
0d 000000c9`0e8fb0a0 00007ffc`89e844b6 vsapi!SEFilename2LangId+0x3351
0e 000000c9`0e8fb120 00007ffc`89d3e2f5 vsapi!vsRegisterUserFilename2LangIdFilenameCallback+0x7b6
0f 000000c9`0e8fb1d0 00007ffc`89ef7c6a vsapi!vsInstanceId+0x15a5
10 000000c9`0e8fb220 00007ffc`89ef8272 vsapi!vsShell+0x336da
11 000000c9`0e8fb280 00007ffc`89edee3e vsapi!vsQTSlickCExecuteKeyEvent+0x2b2
12 000000c9`0e8fb370 00007ffc`8aba592b vsapi!vsShell+0x1a8ae
13 000000c9`0e8fb3a0 00007ffc`8ab78350 Qt5Widgets!QWidget::event+0x20b
14 000000c9`0e8fb430 00007ffc`8ab76501 Qt5Widgets!QApplicationPrivate::notify_helper+0x110
15 000000c9`0e8fb460 00007ffc`8b2d0e5a Qt5Widgets!QApplication::notify+0x3a1
16 000000c9`0e8fb990 00007ffc`8abbf33b Qt5Core!QCoreApplication::notifyInternal2+0xba
17 000000c9`0e8fba00 00007ffc`8ab78350 Qt5Widgets!QSizePolicy::QSizePolicy+0x97b
18 000000c9`0e8fba70 00007ffc`8ab77a7a Qt5Widgets!QApplicationPrivate::notify_helper+0x110
19 000000c9`0e8fbaa0 00007ffc`8b2d0e5a Qt5Widgets!QApplication::notify+0x191a
1a 000000c9`0e8fbfd0 00007ffc`8b72670b Qt5Core!QCoreApplication::notifyInternal2+0xba
1b 000000c9`0e8fc040 00007ffc`8b70edb7 Qt5Gui!QGuiApplicationPrivate::processKeyEvent+0x1eb
1c 000000c9`0e8fc110 00007ffc`8b32563b Qt5Gui!QWindowSystemInterface::sendWindowSystemEvents+0x87
1d 000000c9`0e8fc140 00007ffc`b5cf8939 Qt5Core!QEventDispatcherWin32::processEvents+0x9b
1e 000000c9`0e8ff270 00007ffc`8b2ce3e7 qwindows!qt_plugin_instance+0x21b9
1f 000000c9`0e8ff2a0 00007ffc`8b2d1464 Qt5Core!QEventLoop::exec+0x237
20 000000c9`0e8ff330 00007ff7`526bf1b8 Qt5Core!QCoreApplication::exec+0x154
21 000000c9`0e8ff390 00007ff7`526d8c87 vs!cmProductVer::toString+0x2478
22 000000c9`0e8ff680 00007ff7`5288cd6a vs!vspsGetEnv+0x1957
23 000000c9`0e8ff780 00007ffd`41127034 vs!cmDebug::`default constructor closure'+0xf228a
24 000000c9`0e8ff7c0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
25 000000c9`0e8ff7f0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   1  Id: 35f4.505c Suspend: 0 Teb: 000000c9`0e793000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0f9ffb08 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0f9ffb10 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0f9ffbb0 00007ffc`88ca63f9 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0f9ffbe0 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x3b9
04 000000c9`0f9ffdd0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0f9ffe00 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0f9ffe30 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   2  Id: 35f4.14d0 Suspend: 0 Teb: 000000c9`0e795000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0faff448 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0faff450 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0faff4f0 00007ffc`88ca63f9 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0faff520 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x3b9
04 000000c9`0faff710 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0faff740 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0faff770 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   3  Id: 35f4.52a4 Suspend: 0 Teb: 000000c9`0e797000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0fbff438 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0fbff440 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0fbff4e0 00007ffc`88ca74c3 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0fbff510 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x1483
04 000000c9`0fbff7a0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0fbff7d0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0fbff800 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   4  Id: 35f4.337c Suspend: 0 Teb: 000000c9`0e799000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0fcff988 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0fcff990 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0fcffa30 00007ffc`88ca74c3 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0fcffa60 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x1483
04 000000c9`0fcffcf0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0fcffd20 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0fcffd50 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   5  Id: 35f4.3a70 Suspend: 0 Teb: 000000c9`0e79b000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0fdffb38 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0fdffb40 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0fdffbe0 00007ffc`88ca74c3 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0fdffc10 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x1483
04 000000c9`0fdffea0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0fdffed0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0fdfff00 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   6  Id: 35f4.263c Suspend: 0 Teb: 000000c9`0e79d000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0feff988 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0feff990 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0feffa30 00007ffc`88ca74c3 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0feffa60 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x1483
04 000000c9`0feffcf0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0feffd20 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0feffd50 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   7  Id: 35f4.2de8 Suspend: 0 Teb: 000000c9`0e79f000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0ffff548 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`0ffff550 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`0ffff5f0 00007ffc`88ca74c3 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`0ffff620 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x1483
04 000000c9`0ffff8b0 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`0ffff8e0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`0ffff910 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   8  Id: 35f4.326c Suspend: 0 Teb: 000000c9`0e7a1000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`100fd698 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`100fd6a0 00007ffc`88e405cf KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`100fd740 00007ffc`88ca9757 tagsdb!cmConfig::operator=+0x4287f
03 000000c9`100fd770 00007ffc`88e3f1fe tagsdb!slickedit::SEListTagsTargetCache::replaceTarget+0x3717
04 000000c9`100ffb40 00007ffd`41127034 tagsdb!cmConfig::operator=+0x414ae
05 000000c9`100ffb70 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`100ffba0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   9  Id: 35f4.52a0 Suspend: 0 Teb: 000000c9`0e7a3000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0f8ff718 00007ffd`3f6796de ntdll!NtDelayExecution+0x14
*** WARNING: Unable to verify checksum for filewatcher.dll
01 000000c9`0f8ff720 00007ffc`895b405f KERNELBASE!SleepEx+0x9e
02 000000c9`0f8ff7c0 00007ffc`8968468e filewatcher!vsDllInit+0xc3cf
03 000000c9`0f8ff890 00007ffd`41127034 filewatcher!cmPlugin::hex2dec+0x28b8e
04 000000c9`0f8ff8c0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
05 000000c9`0f8ff8f0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  10  Id: 35f4.32c8 Suspend: 0 Teb: 000000c9`0e7a5000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`0f3ffd68 00007ffd`252c2751 ntdll!NtWaitForMultipleObjects+0x14
01 000000c9`0f3ffd70 00007ffd`41127034 winmm!timeThread+0x91
02 000000c9`0f3ffef0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
03 000000c9`0f3fff20 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  11  Id: 35f4.512c Suspend: 0 Teb: 000000c9`0e7a7000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`101ffa68 00007ffd`419c2dc7 ntdll!NtWaitForWorkViaWorkerFactory+0x14
01 000000c9`101ffa70 00007ffd`41127034 ntdll!TppWorkerThread+0x2f7
02 000000c9`101ffd70 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
03 000000c9`101ffda0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  12  Id: 35f4.20d0 Suspend: 0 Teb: 000000c9`0e7ab000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 000000c9`103ff5f8 00007ffd`3f651ace ntdll!NtWaitForSingleObject+0x14
01 000000c9`103ff600 00007ffc`8968556f KERNELBASE!WaitForSingleObjectEx+0x8e
02 000000c9`103ff6a0 00007ffc`895ac9de filewatcher!cmPlugin::hex2dec+0x29a6f
03 000000c9`103ff6d0 00007ffc`8968468e filewatcher!vsDllInit+0x4d4e
04 000000c9`103ff890 00007ffd`41127034 filewatcher!cmPlugin::hex2dec+0x28b8e
05 000000c9`103ff8c0 00007ffd`419c2651 kernel32!BaseThreadInitThunk+0x14
06 000000c9`103ff8f0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #4 on: July 06, 2022, 12:18:19 AM »
This is still happening in SE 26.0.3.1.  Did the stack trace help at all?  It'd be really nice to get a fix for this.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SE 26 hang when finding references
« Reply #5 on: July 19, 2022, 06:06:33 PM »
When SlickEdit hangs on references, can you interrupt it with the Slick-C interrupt key sequence?

From help:

Interrupting Slick-C Macros
A long-running Slick-C macro can be interrupted by holding down the following key sequences:

Ctrl+Alt+Shift+F2 (Ctrl+Option+Command+S on macOS) -- Halt Slick-C® macro that is executing. Use this to terminate infinite loops.

Ctrl+Alt+Shift+F9 (Ctrl+Option+Command+S on macOS) -- Halt Slick-C® macro that is executing, even if it is currently executing a background timer event. Note that halting the interpreter in a timer event can frequently leave SlickEdit in an unusable state which will require closing and restarting the editor.

If that does work, you will get a Slick-C stack error (this is to be expected, you interrupted a running function).  The trace (or possibly multiple traces) will be written to %SLICKEDITCONFIG%/logs/stack.log.

The Visual Studio stack trace was of no use, since the symbol information is not complete or correct unless I get a mini dump file so I can map the symbol locations back to the original build.  There are two types of Visual Studio crash dumps, one that is minimal (mini dump), which does not include variables or global memory, really it is just the stack trace.  And then there is the large dump file that includes everything.  I would not expect there to be any strings in a mini-dump that would be proprietary to you.

Mini Dumps vs Full Crash Dumps (from Microsoft)
When Windows captures a crash dump it can capture either a mini or full crash dump.

Mini dumps include just the essentials — registers, stack segment and stack trace.
Full crash dumps also include the data segments and can be enormous (as in multiple gigabyte enormous) but are handy if you need to know what was in memory when the crash happened.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #6 on: July 19, 2022, 09:07:32 PM »
Hi Dennis

I just had another hang looking for references and I tried both Ctrl-Alt-Shift-F2 and Ctrl-Alt-Shift-F9 and neither command did anything.  The VS UI is greyed out and Windows is showing the blue circle mouse cursor.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #7 on: July 19, 2022, 09:44:44 PM »
Hi Dennis

It seem that I can now recreate this on demand.  There is one symbol that causes this hang every time.  The only thing I can find that is different about it is that the name is used for both a struct and a static function in the same file, something like this:

Code: [Select]
#include <stdio.h>

typedef struct ref_test
{
    int a;
    int b[3];
    unsigned char c[1];
} Tref_test;

static void ref_test(int a, int b, int c)
{
  fprintf(stderr,"%d %d %d\n",a,b,c);
}

int main(int argc, char **argv)
{
  ref_test(1,2,3);
}

The hang is caused when I put the cursor on the call to ref_test(1,2,3) in main and hit ctrl-/.  A dialog is presented with the 2 symbol definitions.  If I choose the function definition symbol it works as expected.  If I choose the struct symbol then I get the hang.

However, it doesn't do it with the simple example above, just in the main code base where both the struct and the function are used in many places.

Hope that helps.


rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #8 on: July 19, 2022, 10:40:41 PM »
A little more information that I've found regarding this issue.  I have narrowed it down to a single tag file, if I disable that tag file then find references works as expected.  If I enable that tag file I get the hang.

I can't find any reference to the symbol that causes issues in that tag file and rebuilding that tag file made no difference to the behaviour.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SE 26 hang when finding references
« Reply #9 on: July 20, 2022, 04:42:36 PM »
There may not be references to the same symbol in that tag file, but is the same identifier used in that code (for a different purpose)?

Have you tried rebuilding just that tag file, maybe it got corrupted?

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #10 on: July 20, 2022, 09:24:34 PM »
Hi Dennis,

Thanks for the suggestions.

I had a look through both the code and the binary tag file and there's no mention of that symbol's name anywhere in either.

I also rebuilt the offending tag file including references and it made no difference.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SE 26 hang when finding references
« Reply #11 on: July 21, 2022, 04:13:22 PM »
Do you need cross-referencing for that tag file?  If not, as a workaround, you could build it without references.  You only need references if when you do a "Find References" you want to see where a symbol is used in the source files indexed by that tag file.  Subtle thing here, you can build a tag file without references and still search for references to symbols declared or defined in source files indexed by that tag file.

Any chance that the source code indexed by that tag file is non-proprietary and you can send it in to support?  There must be a very specific case causing that tag file to trigger a hang based on what I am seeing.  How large is it?  (Tools > Tag Files... shows file size and number of source files).
« Last Edit: July 21, 2022, 04:50:30 PM by Dennis »

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #12 on: July 21, 2022, 10:22:36 PM »
Hi Dennis

Thinking about it I can probably do without references for that tag file, so I re-tagged it without references and SE is working OK.

Unfortunately the code in that tag file is proprietary so I can't share it with you.  It contains 100 files and is 2MiB in size.

Now that the symbol in question is working for find references, it's interesting that if I select the function definition in the popup list SE lists all references to the function which is expected.  However, if I select the struct definition, SE lists the structure definition as well as all usages of the function.  I was expecting just the struct definition.  I guess SE knows the difference as when I select the function it doesn't include the struct. 

If there's any debugging I can do to help you find the hang, let me know.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SE 26 hang when finding references
« Reply #13 on: July 21, 2022, 10:31:15 PM »
If you just want the struct definition, I'd use Ctrl+Dot (Go to Definition), and not bother with references.

I still need to try your small test case.  I believe the behavior you are seeing is to be expected, but I'll still investigate (may be next week).

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: SE 26 hang when finding references
« Reply #14 on: July 21, 2022, 10:51:53 PM »
Hi Dennis
Using ctrl-. is OK to find the definition of the struct, but if someone has used:
Code: [Select]
struct ref_test xxx;in the code rather than
Code: [Select]
Tref_test xxx;then it's nice to be able to find all references to it.  And while that works, the reference list also contains all occurrences of the function as well which clutters things up somewhat.