Floating point numbers cause KJS to get caught in an infinite loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kdelibs (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: kdelibs4c2a
I listed a binary package because this appears to be some kind of build or optimization issue (the source package is kdelibs). I rebuilt kdelibs on my local machine without optimization and was no longer able to reproduce the problem. I'll try another rebuild with optimization to see if it's the build or the optimization that is the problem.
I'm testing on this virtual machine: http://
I applied all of the available updates using apt-get.
Steps to reproduce:
1. Install Kst:
sudo apt-get install kst
2. Launch Kst:
Applications -> Accessories -> Kst
3. Enable Kst JavaScript extension:
Settings -> Extensions -> Javascript Extension
4. Open a terminal and execute the following command to evaluate a simple floating point number in JavaScript:
echo "3.14" | kstcmd
5. KJS will get stuck in an infinite loop with the following backtrace. I haven't analyzed why it's getting stuck.
#0 mult (a=<value optimized out>, b=<value optimized out>) at /build/
#1 0x02a45634 in pow5mult (b=<value optimized out>, k=-2048) at /build/
#2 0x02a45b8f in kjs_dtoa (d=3.1400000000
#3 0x02a4b02f in KJS::UString::from (d=3.1400000000
#4 0x02a4b329 in KJS::NumberImp:
#5 0x02a53a1a in KJS::ValueImp:
#6 0x02451a81 in JSIfaceImpl:
...
Large integers also cause issues. Values bigger than 536870911 and smaller than -536870912 (29 bits) produce weird ASCII character output (and then segfaults with bigger numbers).
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: kdelibs4c2a 4:3.5.10.
ProcVersionSign
Uname: Linux 2.6.32-21-generic i686
Architecture: i386
Date: Tue Aug 24 16:21:09 2010
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100427.1)
ProcEnviron:
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: kdelibs
tags: | added: javascript kde kjs kst |
As a quick reference, it gets stuck in the do... while() loop on line 739 here: websvn. kde.org/ branches/ KDE/4.3/ kdelibs/ kjs/dtoa. cpp?view= markup& pathrev= 1052100
http://