Bug 512498 - Krita crashes immediately when the text field in the SeExpr Fill layer options is cleared (emptied).
Summary: Krita crashes immediately when the text field in the SeExpr Fill layer option...
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: SeExpr for Krita (other bugs)
Version First Reported In: 5.2.13
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2025-11-23 06:12 UTC by threeseven.t3s7
Modified: 2025-11-23 15:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Backtrace (5.59 KB, text/plain)
2025-11-23 06:12 UTC, threeseven.t3s7
Details

Note You need to log in before you can comment on or make changes to this bug.
Description threeseven.t3s7 2025-11-23 06:12:05 UTC
Created attachment 187086 [details]
Backtrace

SUMMARY
Krita crashes immediately when the text field in the SeExpr Fill layer options is cleared (emptied). I believe this happens because the instant preview tries to parse an empty string, triggering a hard assertion failure in libKSeExpr on systems built with GLIBCXX assertions.

STEPS TO REPRODUCE
1. Create a new document
2. Add a Fill Layer
3. Select SeExpr generator from the list
4. In the SeExpr script options tab, select all text in the script box, Ctrl+A
5. Press Backspace to clear the box

OBSERVED RESULT
Krita closes immediately (crashes)

EXPECTED RESULT
The text box should become empty, and I should be allowed to type a new script. The preview should likely just fail silently or show a blank output, not crash the application.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 6.17.8-arch1-1 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt version: Running 
`from krita import *

print ( QLibraryInfo.version().majorVersion() )`

within Kritas python scripter returns 5

Qt Version (system): 6.10.0
Window: Wayland


ADDITIONAL INFORMATION
The crash is an assertion failure in KSeExpr::Expression::prep()
Backtrace snippet:
#10 0x00007f025369a41f in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/assert_fail.cc:41
#11 0x00007f021071e2c8 in KSeExpr::Expression::prep() const () at /usr/lib/libKSeExpr.so.4
#12 0x00007f02188f1a6f in ??? () at /usr/lib/kritaplugins/kritaseexprgenerator.so

This contradicts the Krita Manual (Tutorials and How-tos > Introduction to SeExpr), which tells users:
"Go to the text box, and clear it if it has any text."
Comment 1 Halla Rempt 2025-11-23 15:16:57 UTC
I cannot reproduce this with the appimage. It looks like an asswert in kseexpr itself, though.
Comment 2 Halla Rempt 2025-11-23 15:40:21 UTC
        if (_evaluationStrategy == UseInterpreter) {
            if (debugging) {
                debugPrintParseTree();
                std::cerr << "Eval strategy is interpreter" << std::endl;
            }
            assert(!_interpreter);
            _interpreter = new Interpreter;

It's here... I don't think the assert is useful, though.