Author Topic: SE crash when enabling spell check while typing  (Read 988 times)

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
SE crash when enabling spell check while typing
« on: February 27, 2023, 08:31:48 am »
Running SE 27.0.1.0 (HF 2) on macoS 13.2.1.
I opened options and under languages/C/C++/General I clicked in the "enable spell check while typing" checkbox and clicked apply and SE abended with the following stack.  It's repeatable as it happens every time.  Any thoughts on how I can fix this please?

Code: [Select]
Process:               vs [35591]
Path:                  /Applications/SlickEditPro2022.app/Contents/MacOS/vs
Identifier:            com.slickedit.SlickEdit
Version:               27.0.1 (27.0.1.0)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2023-02-27 21:25:37.7763 +1300
OS Version:            macOS 13.2.1 (22D68)
Report Version:        12
Anonymous UUID:        B8321347-F1A2-90A9-51D0-B1988FBCEA61

Sleep/Wake UUID:       B1CF7242-D474-424A-8FBB-C5803556063B

Time Awake Since Boot: 470000 seconds
Time Since Wake:       2345 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0xf4003a03d03843ac -> 0x00003a03d03843ac (possible pointer authentication failure)
Exception Codes:       0x0000000000000001, 0xf4003a03d03843ac

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [35591]

VM Region Info: 0x3a03d03843ac is not in any region.  Bytes after previous region: 63307016324013  Bytes before following region: 41765063605332
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)        1000000000-7000000000   [384.0G] ---/--- SM=NUL  ...(unallocated)
--->  GAP OF 0x5f9000000000 BYTES
      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-/rwx SM=PRV 

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   vs                                   0x10587d2e4 cmAllocator::deallocate(void*) + 92
1   vs                                   0x10587d2c8 cmAllocator::deallocate(void*) + 64
2   vs                                   0x1043dc3cc spell_init(char const*) + 1188
3   vs                                   0x1043e1734 vs_spell_init() + 416
4   vs                                   0x1043e4a4c spellwt_buf(fileview_t*, char const*, int, int, unsigned char) + 84
5   vs                                   0x1043e48c8 spellwt_line(fileview_t*, unsigned char, char*, int, unsigned short*, int, unsigned char, bool) + 2532
6   vs                                   0x10438a8e8 vsclex_color_line2(clex_t&, fileview_t*, hfile_t*, char*, int, unsigned short*, unsigned long long, unsigned short*, int, int, int, bool) + 388
7   vs                                   0x1043d8830 VSSOFTWRAP::SoftWrapAddColorCoding(clex_t&, filewindow_t*, fileview_t*, hfile_t*, unsigned short*, int, unsigned char*, int, unsigned long long*, int*, unsigned short*) + 324
8   vs                                   0x1043d97cc VSSOFTWRAP::SoftWrapGetLine(unsigned char**, unsigned char**, int*, fileview_t*, filewindow_t*, int*, int*, clex_t*, unsigned short**, CRT2_CHARTAB**, unsigned long long*, int*, int*, unsigned short*, unsigned short*, unsigned short*, int*, bool) + 404
9   vs                                   0x104398b94 refreshtext(bool, int, long long, int, int, int, long long*, fileview_t&, int&, int&, int, bool) + 4576
10  vs                                   0x10438c6c8 refreshwindow(int, int*, QPainter*, QRect*, bool) + 4996
11  vs                                   0x10438d1d0 se_refresh(int) + 684
12  vs                                   0x104442714 se_call_event(filewindow_t*, unsigned int, int, int, VSARGTYPE const*, int) + 296
13  QtCore                               0x10750c05c QObject::event(QEvent*) + 80
14  QtGui                                 0x1080e74d8 QWidget::event(QEvent*) + 3820
15  QtGui                                 0x10809d6e0 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 208
16  QtGui                                 0x10809ebe4 QApplication::notify(QObject*, QEvent*) + 420
17  QtCore                               0x1074f954c QCoreApplication::notifyInternal(QObject*, QEvent*) + 140
18  QtCore                               0x1074fa2bc QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 600
19  CoreFoundation                       0x1a56b9a08 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
20  CoreFoundation                       0x1a56b999c __CFRunLoopDoSource0 + 176
21  CoreFoundation                       0x1a56b970c __CFRunLoopDoSources0 + 244
22  CoreFoundation                       0x1a56b8310 __CFRunLoopRun + 836
23  CoreFoundation                       0x1a56b7878 CFRunLoopRunSpecific + 612
24  HIToolbox                             0x1aed97fa0 RunCurrentEventLoopInMode + 292
25  HIToolbox                             0x1aed97c30 ReceiveNextEventCommon + 236
26  HIToolbox                             0x1aed97b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
27  AppKit                               0x1a893d84c _DPSNextEvent + 632
28  AppKit                               0x1a893c9dc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
29  AppKit                               0x1a8930e0c -[NSApplication run] + 464
30  QtGui                                 0x1080586c4 0x10802c000 + 181956
31  QtCore                               0x1074f6778 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 528
32  QtCore                               0x1074f9ba4 QCoreApplication::exec() + 212
33  vs                                   0x1040af384 vmain(int, char**) + 2676
34  vs                                   0x1057291b8 xmain + 56
35  vs                                   0x1040d9c14 main + 12
36  dyld                                 0x1a52afe50 start + 2544


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: SE crash when enabling spell check while typing
« Reply #1 on: February 27, 2023, 08:12:59 pm »
No luck reproducing this so far. This could be dependent on what source file is already open and the page that is currently displayed.

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #2 on: February 27, 2023, 08:25:56 pm »
Hi Clark
Indeed, if I close the project I can enable spell check while typing with no issues.  However, then SE crashes when I re-open the project/workspace.  I recovered that by editing the prefs file.

Is there a way for me to provide a zip file of the current state of SE along with the project files so you can recreate it?

If I zipped up ~/Library/Application Support/SlickEdit/27.0.1 and the project source directory, would that be enough?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: SE crash when enabling spell check while typing
« Reply #3 on: February 27, 2023, 09:58:22 pm »
If you zip up the config directory and your project source directory, that should be enough.

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #4 on: February 27, 2023, 10:16:33 pm »
I've created case CAS-74057-0T0P and uploaded the project as an attachment.  My SE config compresses to 188MB and fails the upload with MOVE UPLOADED FILE FAILED! Is there another way I can get it you?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: SE crash when enabling spell check while typing
« Reply #5 on: February 28, 2023, 12:35:46 am »
You can save space by excluding the config subdirectories. tagfiles is large.

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #6 on: February 28, 2023, 01:18:17 am »
Why didn't I think of that   :)
Uploaded the SE config without tagfiles to the case.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3911
  • Hero Points: 513
Re: SE crash when enabling spell check while typing
« Reply #7 on: February 28, 2023, 01:16:41 pm »
Just for posterity (or others reading this thread), in a case like this, it would probably have been sufficient to just export your options and put up the zip file.  Tools > Options > Export/Import Options > Export All Options...

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: SE crash when enabling spell check while typing
« Reply #8 on: February 28, 2023, 02:21:14 pm »
Exporting your options would not include vrestore.slk. Although, it sounds like the restore information in your workspace reproduces this problem.

No luck reproducing this with your uploaded files. Are you running on an Intel mac or M1/M2? I tested on an Intel mac.

Your vrestore.slk file looks like it has about 101 source files open but only about 50ish are there. Can you reduce this test case down and provide all the files? I'm hoping this test case doesn't require a bunch of files but maybe just one that is problematic.

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #9 on: February 28, 2023, 07:18:25 pm »
Hi Clark, I'm running this on an m1 max based mac.
I've removed all of the source buffers that are outside of the project I uploaded and it still crashes when enabling spell check while typing.
I've uploaded se3.tar.bz2 to the case with the contents of /Users/rjp/Library/Application Support/SlickEdit/27.0.1 (without the tagfiles) which should hopefully just restore files from the project.
Let me know if there's anything else I can provide.


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1811
  • Hero Points: 151
Re: SE crash when enabling spell check while typing
« Reply #10 on: February 28, 2023, 10:52:16 pm »
So far, we have not been able to reproduce it with the files you provided.  So it seems like it's not something special about one of those files. 

You said when you enabled the spell check with the project closed, it worked, but crashed when you opened the project.  We want to check to see if you still get it with a clean configuration.  Go to a terminal window, and start SlickEdit with this command line:

Code: [Select]
/Applications/SlickEditPro2022.app/Contents/MacOS/vs +new -sc /tmp/NoSuchDir

When it starts up, enable the spell check while typing setting for C/C++, and then see if it still crashes when you open up the problem project.

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #11 on: February 28, 2023, 10:56:50 pm »
I started SE with a new configuration and hit finish on the setup wizard.  I then changed the spell check when typing option for C++ and opened the offending project.  Unfortunately SE still abended when I opened the project.
The following was output in the terminal that I started SE from:
Code: [Select]
$ /Applications/SlickEditPro2022.app/Contents/MacOS/vs +new -sc /tmp/NoSuchDir
2023-03-01 11:54:37.565 vs[88765:5815527] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
2023-03-01 11:54:58.594 vs[88765:5815527] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
2023-03-01 11:54:59.403 vs[88765:5815527] +[CATransaction synchronize] called within transaction
vs(88765,0x200b64140) malloc: *** error for object 0x153843ee8: pointer being freed was not allocated
vs(88765,0x200b64140) malloc: *** set a breakpoint in malloc_error_break to debug

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1811
  • Hero Points: 151
Re: SE crash when enabling spell check while typing
« Reply #12 on: March 01, 2023, 04:59:01 pm »
Thanks for doing that.  We're still investigating, and still haven't reproduced it.

Just to be paranoid, when you get a chance, can you run the following from a terminal, and let us know what the output is?

Code: [Select]
cksum /Applications/SlickEditPro2022.app/Contents/smain.dct

rjpontefract

  • Senior Community Member
  • Posts: 231
  • Hero Points: 9
Re: SE crash when enabling spell check while typing
« Reply #13 on: March 01, 2023, 07:31:50 pm »
Sure, no problem:
Code: [Select]
$ cksum /Applications/SlickEditPro2022.app/Contents/smain.dct
1374061862 395955 /Applications/SlickEditPro2022.app/Contents/smain.dct

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3911
  • Hero Points: 513
Re: SE crash when enabling spell check while typing
« Reply #14 on: March 01, 2023, 09:02:17 pm »
This is a long shot too, but try this.  Save this code to a Slick-C batch macro:  /tmp/which_file.e
Code: [Select]
#include "slick.sh"
defmain()
{
   args:=arg(1);
   filename:=parse_file(args,false);
   if (filename=="") {
      return;
   }
   // We want this one to act like user typed command on command line
   // except we don't look for internal editor commands.
   _str vslickpathfilename=slick_path_search(filename,"");
   // We want this one to act like user is at shell prompt.
   _str pathfilename=path_search(filename,"","");
   _str msg="VSLICKPATH found <"vslickpathfilename">   PATH found <"pathfilename">";
   sticky_message(msg);
}

Then, from the SlickEdit command line, run:
Code: [Select]
    xcom /tmp/which_file.e smain.dct
« Last Edit: March 01, 2023, 09:10:46 pm by Clark »