Bug 324084

Summary: QA Notice: kdelibs-4.11.0/kdecore/io/kdebug.h:260:64: warning: array subscript is above array bounds [-Warray-bounds]
Product: [Unmaintained] kdelibs Reporter: Coacher <itumaykin+kde>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: mpyne, sven
Priority: NOR    
Version First Reported In: 4.11.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: emerge --info kdelibs

Description Coacher 2013-08-26 21:25:20 UTC
QA Notice generated during kdelibs build on Gentoo amd64:

QA Notice: Package triggers severe warnings which indicate that it may exhibit random runtime failures.
/var/tmp/portage/kde-base/kdelibs-4.11.0-r1/work/kdelibs-4.11.0/kdecore/io/kdebug.h:260:64: warning: array subscript is above array bounds [-Warray-bounds]

If you need any additional info I am ready to provide it.

Reproducible: Always
Comment 1 Michael Pyne 2013-08-29 00:16:48 UTC
I've confirmed that gcc 4.7.3 flags this error in kdelibs/khtml/xpath/parser.cpp (which can be auto-generated from parser.y in the same directory, if makeparser in that directory is run and GNU bison is installed).

The offending code is parser.y:195, which can be confirmed by commenting it out, running makeparser, then compiling khtml again:

> kWarning(6011) << "Found unknown namespace prefix " << prefix.string();

However there is nothing wrong with the code as far as I can tell, nor does it flag an error message with the latest version of clang here.

Additionally there is a gcc bug reported about false positives with this check (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53198) which seems to indicate that 4.7.2 at least could falsely flag out-of-bounds access, but that it's fixed for 4.8.0.

I don't have 4.8.0 available to test, it may be helpful to know which compiler version you're using to see if this is a possibility here or not.
Comment 2 Coacher 2013-08-29 00:29:47 UTC
Created attachment 82003 [details]
emerge --info kdelibs

My gcc version is 4.6.3.

I've also attached text file with various system-wide options and important package versions. It is Gentoo-specific, but may be useful.
Comment 3 Sven Eden 2013-11-25 14:31:55 UTC
This warning, and another for kimgio, is triggered for kdelibs-4.11.3, compiled with gcc-4.8.2, too:

========
kdelibs-4.11.3/kimgio/pcx.cpp:584:55: warning: array subscript is above array bounds [-Warray-bounds]
kdelibs-4.11.3/kdecore/io/kdebug.h:260:64: warning: array subscript is above array bounds [-Warray-bounds]
========
Comment 4 Andrew Crouthamel 2018-11-11 04:33:25 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-21 04:45:12 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Sven Eden 2018-11-21 06:39:13 UTC
I think we can close this. If there is a system still using kdelibs-4.x out there, it hasn't exploded, yet. Therefore I assume that this array in question is in no way able to wreak havoc.