Bug report #6940
Crash using Python console and latest QScintilla 2.7
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||16053|
When using the latest QScintilla version 2.7 (libqscintilla220.127.116.11), I get a crash with the console when an error is about to be shown.
This is on Mac, with latest master. Reproduce crash with:
import <some non-existent module>
Mac crash report attached. Looks like something is funky between QGIS issuing the error and QScintilla formatting it for output.
#2 Updated by Larry Shaffer over 6 years ago
Certainly a blocker for me, but I won't be testing on other Macs, since it is a bit of a hassle to recompile the whole PyQt4/QScintilla setup just to verify it doesn't work, only to have to undo it to get back to a working state (don't have the time right now).
So, I would definitely appreciate verification of this bug on another platform, or another Mac.
#4 Updated by Larry Shaffer over 6 years ago
- File console_output_qsci2.7_patch.diff added
- Pull Request or Patch supplied changed from No to Yes
- Status changed from Open to Feedback
Ok, I fixed the crashing, but would like to know if the patch will work for older QScintilla setups as well. (see attached patch)
I'll test it tonight on a different Mac with QScintilla 2.6 (libqscintilla2.8).
If you run into the crash, or have the time on a pre-QScintilla 2.7 install (even though console is currently working there), please test the patch. It would be good if the patch worked for all QScintilla 'recent' (2.4.5-thru-2.7) installs without having to code for different versions.
#5 Updated by Salvatore Larosa over 6 years ago
Crash confirmed and the patch fixes the issue !
Tested on Linux (2.6, 2.7) and Win (2.6).
Thanks for the fix !
Please, could you apply the patch to master branch as below ?
if self.style == "traceback": # Show errors in red pos = self.outputArea.SendScintilla(QsciScintilla.SCI_GETCURRENTPOS) self.outputArea.SendScintilla(QsciScintilla.SCI_STARTSTYLING, pos, 31) self.outputArea.append(m) self.outputArea.SendScintilla(QsciScintilla.SCI_SETSTYLING, len(m), 1)