| Summary: | SIGSEGV, Segmentation fault on open aduino file *.ino & kwrite et kate | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Martial Guex <martial.guex> |
| Component: | framework | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | christoph, kare.sars, killermosi, martial.guex, thomas.surrel |
| Priority: | NOR | ||
| Version First Reported In: | 5.51.0 | ||
| Target Milestone: | --- | ||
| Platform: | Debian unstable | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Custom syntax highlight for arduino making kate crash (memory protect)
Custom file for syntax highlight for arduino, it's generate an kate crash (memory protect) |
||
|
Description
Martial Guex
2018-11-27 18:27:09 UTC
The example file you pointed to works fine for me in Kate and Kwrite. What synthax highlighting is active when opening the file ? Created attachment 116548 [details]
Custom syntax highlight for arduino making kate crash (memory protect)
Created attachment 116549 [details]
Custom file for syntax highlight for arduino, it's generate an kate crash (memory protect)
Oops -:( I found the same custom highlight file for arduino on two folders ~ / .kde / share / apps / katepart / syntax / and / usr / share / katepart5 / syntax /. I deleted files and the problem is gone. I attached this file to check on your side. Inadvertently I joined the same file twice to improve the definition so if you have a way to remove one, I did not find a way to do it. Sorry for the inconvenience to everyone. This needs investigation, since if such a setup crashes KSyntaxHighlighting, possibly many users might hit this. I also get a crash with this arduino highlight file. I get the crash from an Q_ASSERT(format.isValid()) in KateHighlighting::applyFormat(...) replacing the assert with an early return stops the crash, but there is no highlighting and a lot of debug messages about the broken HL file. As expected not returning early also results in a crash. PS. Adding the <!DOCTYPE> tag from isocpp.xml to the Arduino HL file also stops the crash, but there are still a bunch of debug warnings. Ok, that means it's missing the entities such as &separators; and &punctators;. Imo KSyntaxHighlighting should reject these files somehow... But that's tricky with lazy loading... Btw, adding this file to KSyntaxHighlighting, the syntax highlighting indexer says: Error FODC0002 in file:///home/dh/kde/kf5/src/frameworks/syntax-highlighting/data/syntax/arduino.xml, at line 287, column 78: Entity 'separators' not declared. --> KSyntaxHighlighting should somehow reject this file entirely when not compiled in as resource. *** Bug 402421 has been marked as a duplicate of this bug. *** *** Bug 401162 has been marked as a duplicate of this bug. *** This got fixed ;=)
Don't crash on malformed syntax highlighting files
Test Plan:
1. Create malformed syntax highlighting file with missing end tags
2. Place it in ~/.local/share/katepart5/syntax/
3. Open Kate with file which uses that syntax highlighting
Reviewers: cullmann, dhaumann
Reviewed By: cullmann
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: #kate, #frameworks
Differential Revision: https://phabricator.kde.org/D19533
|