Summary: | Segmentation fault when creating or opening a file | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Gerald Young <supersayoyin> |
Component: | General | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | halla, johan.thelmen |
Priority: | NOR | Keywords: | drkonqi |
Version: | 2.8.1 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/calligra/f4be845f49f81579807501fa036778a96d2dfd97 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Patch which fixes the issue |
Description
Gerald Young
2014-05-26 18:44:18 UTC
Hi, I'm guessing this is an arm-related bug and that you're the first to actually try to run Krita on arm :-). I'm not sure _what_'s going on, though! Reproduced crash under gdb, and then did: (gdb) p *(Core *)(this->m_coreData + this->m_offset) $6 = {_vptr.Core = 0x0, rgb = {<Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 2, 3, 1> >> = {<No data fields>}, m_storage = {m_data = {array = {0, 0, 0}}}}, hsx = {<Eigen::MatrixBase<Eigen::Matrix<float, 4, 1, 2, 4, 1> >> = {<No data fields>}, m_storage = {m_data = {array = {-1.34243398e-12, 0, 0, 0}}}}, type = KisColor::HSY} (gdb) p ((Core *)(this->m_coreData + this->m_offset))->setRGB(0,0,0,0) Cannot access memory at address 0x8 That would suggest it's a bug in Eigen... Did you build krita yourself? If so... Could you apply the patch from this review request and build against eigen3 and see if that fixes something? https://git.reviewboard.kde.org/r/116611/ Applied patch from above link but crash still happens. I think I found what happens. The problem happens is when this line: m_offset = quint8(16 - (reinterpret_cast<size_t>(m_coreData) % 16)); Evaluates to 16. When that happens the assignment: core()->type = type; Overflows the m_coreData buffer and overwrites the m_offset with zero, causing the following line: core()->setRGB(r, g, b, a); To segfault (since reinterpret_cast<Core*>(m_coreData + m_offset) no longer points to a valid Core structure). Okay, then it's not an eigen issue indeed. I think your analysis is quite correct! Created attachment 86873 [details]
Patch which fixes the issue
Attached patch which fixes the issue. It runs now and can paint stuff in canvas. :-)
Git commit f4be845f49f81579807501fa036778a96d2dfd97 by Boudewijn Rempt. Committed on 28/05/2014 at 07:17. Pushed by rempt into branch 'master'. Patch by Supersayonin. Thanks! CCMAIL:supersayoyin@gmail.com A +1077169 -0 callgrind.out.3413 M +2 -2 krita/plugins/extensions/dockers/artisticcolorselector/kis_color.cpp http://commits.kde.org/calligra/f4be845f49f81579807501fa036778a96d2dfd97 *** Bug 354345 has been marked as a duplicate of this bug. *** |