Bug 396310 - Segfault when parsing file
Summary: Segfault when parsing file
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.2.3
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-08 11:50 UTC by Afief Halumi
Modified: 2021-01-16 04:37 UTC (History)
1 user (show)

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


Attachments
File causes KDevelop to crash (2.13 KB, text/x-csrc)
2018-07-08 11:50 UTC, Afief Halumi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Afief Halumi 2018-07-08 11:50:47 UTC
Created attachment 113832 [details]
File causes KDevelop to crash

KDevelop 5.2.3 crashes as soon as the attached file is loaded.

I apologize for the nonsensical code, but this is what was left after widdling down an issue across a 3000 line cpp and 5 headers.

Running on Ubuntu 14.04.

KDevelop output:
$ ./KDevelop-5.2.3-x86_64.AppImage
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number
kdevplatform.serialization: version mismatch or no version hint; expected version: 84017920
kdevplatform.serialization: "The data-repository at /home/afiefh/.cache/kdevduchain/kdevelop-{de104b96-9b1f-4d1d-938c-7259177997ff} has to be cleared."
libGL error: failed to load driver: swrast
"applications.menu"  not found in  ("/etc/xdg/menus")

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
kdevelop.plugins.qthelp: Couldn't setup QtHelp Collection file
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find "mtp"
trying to load "/tmp/.mount_H5UcPE/usr/lib/qt5/plugins/kf5/kio/file.so" from "/tmp/.mount_H5UcPE/usr/lib/qt5/plugins/kf5/kio/file.so"
libclang: crash detected during parsing: {
  'source_filename' : '/home/afiefh/projects/locking/BlockGen.cpp'
  'command_line_args' : ['clang', '-ferror-limit=100', '-fspell-checking', '', '-Wunused-parameter', '-Wunreachable-code', '-Wall', '-std=c++11', '-nostdinc', '-nostdinc++', '-xc++', '-include', '/tmp/.mount_H5UcPE/usr/share/kdevclangsupport/gcc_compat.h', '-isystem/usr/include/c++/4.8', '-isystem/usr/include/x86_64-linux-gnu/c++/4.8', '-isystem/usr/include/c++/4.8/backward', '-isystem/usr/lib/gcc/x86_64-linux-gnu/4.8/include', '-isystem/usr/local/include', '-isystem/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed', '-isystem/usr/include/x86_64-linux-gnu', '-isystem/usr/include', '-imacros', '/tmp/kdevelop.J21184'],
  'unsaved_files' : [],
  'options' : 781,
}
/tmp/.mount_H5UcPE/AppRun: line 35: 21184 Segmentation fault      (core dumped) kdevelop $@
Comment 1 Sven Brauch 2018-07-08 14:22:21 UTC
Hmm, I can unfortunately not reproduce the crash here with that file. Maybe it only crashes if it is part of a project including the types used there?
Comment 2 Afief Halumi 2018-07-08 14:41:32 UTC
Hi Sven, thanks for looking.

No, I extracted the file into a completely session (no project), pressed ctrl+n and pasted the contents into the editor. It crashed instantly.

The types for the most part are made up types that don't even exist in the actual project (sorry, proprietary mess) so it can't be that.

It is interesting that even removing stuff as simple as a integer decrement or an snprintf would stop the crashes. I think I tried to remove every single line at some point and it would simply not crash after I remove it.
Comment 3 Afief Halumi 2018-07-08 16:04:35 UTC
Tested again on a live image of Ubuntu 14.04.5, crash reproduced.

Steps for reproduction:
* Run 14.04.5 live image
* sudo apt-get install build-essential #crash doesn't happen without this
* wget https://download.kde.org/stable/kdevelop/5.2.3/bin/linux/KDevelop-5.2.3-x86_64.AppImage
* chmod +x KDevelop-5.2.3-x86_64.AppImage
* ./KDevelop-5.2.3-x86_64.AppImage
* ctrl+n to open new file and paste contents of the file attached in the report
* save the file with the extension cpp

I hope this is helpful. I can add any required information regarding the issue.
Comment 4 Sven Brauch 2018-07-08 17:42:05 UTC
Huh, yes, with the AppImage it indeed crashes. Very interesting. With the non-AppImage version it works ok.

I'm unfortunately too stupid right now to get a proper trace from the AppImage ...
Comment 5 Afief Halumi 2018-07-09 06:29:19 UTC
Tested another few AppImages:
KDevelop-5.2.0-x86_64.AppImage: No crash
KDevelop-5.2.1-x86_64.AppImage: Crash
KDevelop-5.2.3-x86_64.AppImage: Crash
Comment 6 Afief Halumi 2018-09-09 04:50:29 UTC
Crash still happens in KDevelop-5.2.4-x86_64.AppImage
Comment 7 Justin Zobel 2020-12-17 05:37:42 UTC
Thank you for the crash report.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 8 Bug Janitor Service 2021-01-01 04:38:40 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2021-01-16 04:37:26 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!