Bug 386394

Summary: Crash in auto-indenter
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Matthew Woehlke <mwoehlke.floss>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: rdieter, simonandric5
Priority: NOR    
Version: 5.38.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Matthew Woehlke 2017-10-31 18:16:14 UTC
I'm experiencing a reproducible crash when trying to edit a Javascript file. GDB and the bug reporting wizard are having problems generating a stack trace. Valgrind reports:

    ==4284== Invalid read of size 8
    ==4284==    at 0x35816C79: ???
    ==4284==    by 0xA387305: ??? (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0xA3EF7D6: QV4::Runtime::callActivationProperty(QV4::ExecutionEngine*, int, QV4::CallData*) (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0x2F6CA9F1: ???
    ==4284==    by 0xA387305: ??? (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0xA3EF7D6: QV4::Runtime::callActivationProperty(QV4::ExecutionEngine*, int, QV4::CallData*) (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0x2F6C9DA0: ???
    ==4284==    by 0xA387305: ??? (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0xA2ED235: QJSValue::call(QList<QJSValue> const&) (in /usr/lib64/libQt5Qml.so.5.7.1)
    ==4284==    by 0x4F67E2D: KateIndentScript::indent(KTextEditor::ViewPrivate*, KTextEditor::Cursor const&, QChar, int) (kateindentscript.cpp:75)
    ==4284==    by 0x50258BD: KateAutoIndent::scriptIndent(KTextEditor::ViewPrivate*, KTextEditor::Cursor const&, QChar) (kateautoindent.cpp:278)
    ==4284==    by 0x5026935: KateAutoIndent::userTypedChar(KTextEditor::ViewPrivate*, KTextEditor::Cursor const&, QChar) (kateautoindent.cpp:453)
    ==4284==  Address 0xb5bd04d8 is not stack'd, malloc'd or (recently) free'd

To reproduce:

- Open https://raw.githubusercontent.com/Kitware/vaui/84ba21ecce5fb64388b1510b50c8cbb8c9bda3e1/web_external/Viewer/ImageViewerWidgetWrapper/VauiGeoJSImageViewer.js
- Move the caret to the end of line 36 (`var pendingNext = false;`)
- Press enter

Curiously, if I paste the file contents into an empty document and set HL to 'javascript', no crash...
Comment 1 Rex Dieter 2017-11-02 18:33:24 UTC
Likely a dup of bug #384404

(I'll mark it as such, holler and/or re-open if anyone feels otherwise)

*** This bug has been marked as a duplicate of bug 384404 ***