After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670350 - Weird behavior in for loops in (ppc64 -mcpu=G5)
Weird behavior in for loops in (ppc64 -mcpu=G5)
Status: RESOLVED NOTGNOME
Product: gjs
Classification: Bindings
Component: general
1.30.x
Other Linux
: Normal critical
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-18 14:54 UTC by eruyome
Modified: 2012-03-03 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description eruyome 2012-02-18 14:54:46 UTC
Hello all,

I've created the following javascript file:

var i;
for(i=0; i<2; ++i) {
 print(i);
}

and ran in through gjs 1.30.1 in two machines.

Machine A: arch linux x86_64.
Machine B: gentoo imacG5 ppc64 (compiled with CFLAGS="-mcpu=G5 -02 -pipe").

I have glib version 2.30.2 on both machines.

When I run "$ gjs test.js" I get the two following behaviours:

Machine A Output (x86_64):
0
1

Machine B Output (G5 ppc64):
1
4.2439915824e-314
1
4.2439915824e-314
1
4.2439915824e-314
... (repeats forever)

It also happens to crash gnome 3 (e.g. gdm or gnome-session) on my machine (With the "Oh no, something when wrong..." kind of problem) because of a loop in dbus.js (around line 256) executing one more iteration than it should. 

Please ask me for any extra information required for the bug.
Comment 1 Colin Walters 2012-02-18 16:38:58 UTC
Almost certainly a duplicate.

*** This bug has been marked as a duplicate of bug 665152 ***
Comment 2 eruyome 2012-02-18 23:19:48 UTC
The latest git (together with the git gobject-introspection and glib) with the patched gi/function.c does not seem to improve the issue.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-02-18 23:22:55 UTC
Does this happen with raw SpiderMonkey? gjs isn't really doing anything here.
Comment 4 eruyome 2012-02-18 23:25:28 UTC
I have found out that the same thing also happens in SpiderMonkey (1.8.5) js. I will try a hg SpiderMonkey build to see if they've somehow fixed the issue. It may help in identifying the problem.
Comment 5 eruyome 2012-02-19 22:40:19 UTC
Seems like this bug: https://bugzilla.redhat.com/show_bug.cgi?id=749604
Comment 6 eruyome 2012-03-03 13:33:15 UTC
Hello,

Just to note that the bug is fixed in the recent checkouts of SpiderMonkey.