Bug 259860 - crash in parsing boost header
Summary: crash in parsing boost header
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: git master
Platform: Compiled Sources macOS
: NOR crash
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-12-14 17:12 UTC by Till Adam
Modified: 2018-10-27 04:06 UTC (History)
3 users (show)

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


Attachments
GDB run and backtrace when starting kdevelop with a project containing suspect header. (18.64 KB, text/plain)
2012-04-29 11:44 UTC, Beau V.C. Bellamy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Till Adam 2010-12-14 17:12:24 UTC
Version:           SVN (using Devel) 
OS:                OS X

I get the following crash reliably while the background parser tries to process boost's alignment_of.hpp.

http://pastebin.com/GBtUupPH



Reproducible: Always
Comment 1 Milian Wolff 2010-12-15 19:03:45 UTC
David, any idea on this one? Probably an invalid context pointer that is tried to get accessed, or?
Comment 2 Milian Wolff 2010-12-18 14:01:02 UTC
btw Till, isn't Valgrind with 3.6 available for Mac OS X now? Could you try to reproduce the bug there?
Comment 3 David Nolden 2010-12-27 15:46:00 UTC
I guess this is an endless recursion of template instantiation. We might need to enforce some kind of maximum processing depth (there already is for some cases, but maybe not for this one).
Comment 4 Milian Wolff 2010-12-27 19:21:18 UTC
I could also not run duchainify on the extracted tarball of boost 1.45, it sooner or later eats all my memory and freezes the whole machine. There is at least one file that does the same when I run gcc -E on it though, so something unrelated in the macro usage there. We generally should try to add more guards everywhere to prevent against such indefinite memory consumption.

BTW: Till's example isn't endless, it only has a few houndred (not thousands) of stack frames, which is why both Till and me doubt it's actually a stack overflow. I'd rather assume the context ptr is invalid.

But well, it needs to be tested.
Comment 5 David Nolden 2010-12-27 19:50:39 UTC
It seems strange to have several hundred "valid" instantiation iterations. Maybe each iteration also consumes memory or something like that and it crashes early due to that. It should be impossible that the context is invalidated during the recursion, after all the read-lock should be held. A valgrind log might help anyway.
Comment 6 Ciprian Ciubotariu 2010-12-27 20:33:59 UTC
I believe the C++ standard mandates an instantiation stack of 17 levels. One can customize this in gcc with -ftemplate-depth=N

From info gcc, C++ Dialect Options:

`-ftemplate-depth-N'
     Set the maximum instantiation depth for template classes to N.  A
     limit on the template instantiation depth is needed to detect
     endless recursions during template class instantiation.  ANSI/ISO
     C++ conforming programs must not rely on a maximum depth greater
     than 17.
Comment 7 Beau V.C. Bellamy 2012-04-29 11:44:12 UTC
Created attachment 70749 [details]
GDB run and backtrace when starting kdevelop with a project containing suspect header.
Comment 8 Beau V.C. Bellamy 2012-04-29 11:46:25 UTC
I'd like to add that this still appears to be an issue.  Within seconds of typing out #include <boost/accumulators/statistics/weighted_sum.hpp> into my source, kdevelop crashes with a segfault.
Comment 9 Beau V.C. Bellamy 2012-04-29 11:52:07 UTC
I forgot to mention that I'm running kdevelop 4.3.1 (kdevplatform 4.8.1).  System is Gentoo Linux.  Boost version 1.48.0
Comment 10 Milian Wolff 2012-04-30 13:27:55 UTC
@Beau: this looks to this bug report. furthermore I cannot reproduce it. Please file a separate bug report and attach sources that can be used to reproduce the issue. Also add a valgrind log.

@Till: still waiting for a valgrind log if you can reproduce it with a current kdevelop on mac.

cheers
Comment 11 Jeremy W. Murphy 2012-09-08 04:28:00 UTC
I'm also suffering from this bug on Gentoo Linux.  Even though the OP uses OS X, can we combine our results until something in them suggests that it really is platform specific?
Comment 12 Aleix Pol 2013-03-31 00:48:01 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively
Comment 13 Andrew Crouthamel 2018-09-24 02:14:22 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 set the bug status 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 14 Andrew Crouthamel 2018-10-27 04:06:34 UTC
Dear Bug Submitter,

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!