Bug 189809 - [PATCH] kjs crashes when built with gcc 4.4 without -fno-strict-aliasing
Summary: [PATCH] kjs crashes when built with gcc 4.4 without -fno-strict-aliasing
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-16 16:45 UTC by Bernhard Rosenkraenzer
Modified: 2009-04-29 04:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix (4.10 KB, patch)
2009-04-16 16:46 UTC, Bernhard Rosenkraenzer
Details
Cleanup patch (5.67 KB, patch)
2009-04-16 16:50 UTC, Bernhard Rosenkraenzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2009-04-16 16:45:36 UTC
Version:            (using Devel)
Compiler:          gcc 4.4 
OS:                Linux
Installed from:    Compiled sources

When built with gcc 4.4 without -fno-strict-aliasing, kjs crashes as soon as any javascript code is being executed.

The problem turns out to be aliasing violations in dtoa.cpp, which looks like it has at some point been forked off nspr -- nspr has already come up with a fix (see https://bugzilla.mozilla.org/show_bug.cgi?id=439144).

I've ported their fix to kjs (will attach) -- I've been running it here for a few hours without noticing any weird stuff.
Comment 1 Bernhard Rosenkraenzer 2009-04-16 16:46:28 UTC
Created attachment 32873 [details]
Fix
Comment 2 Bernhard Rosenkraenzer 2009-04-16 16:50:59 UTC
Created attachment 32874 [details]
Cleanup patch

Looking at the file, there's some odd stuff going on outside the aliasing violations -- in C++ code, it doesn't really make sense to support K&R constructs.

Attaching another patch which gets rid of those (to be applied on top of the previous one), but this one isn't required to fix the problem.
Comment 3 LuRan 2009-04-28 02:01:01 UTC
I tried the patch and I can confirm that kjs does not crash any more after this patch.
Comment 4 Bernhard Rosenkraenzer 2009-04-28 12:28:54 UTC
SVN commit 960321 by bero:

Fix crash when built with gcc 4.4 without -fno-strict-aliasing

Details included in the bug report.

BUG:189809


 M  +26 -147   dtoa.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=960321
Comment 5 Kevin Kofler 2009-04-29 04:16:38 UTC
SVN commit 960767 by kkofler:

Fix crash when built with gcc 4.4 without -fno-strict-aliasing

Details included in the bug report.

CCBUG:189809

(backport revision 960321 by bero from trunk)

 M  +26 -147   dtoa.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=960767