Bug 1550245 - QtScriptEngine fails (JSON parsing, execution)
Summary: QtScriptEngine fails (JSON parsing, execution)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5-qtscript
Version: 28
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1551246 (view as bug list)
Depends On:
Blocks: 1551664
TreeView+ depends on / blocked
 
Reported: 2018-02-28 20:28 UTC by Graham Whitted
Modified: 2019-05-28 19:00 UTC (History)
11 users (show)

Fixed In Version: qt5-qtscript-5.10.1-3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 19:00:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
fc28-qt-json source (1.45 KB, application/x-xz)
2018-02-28 20:28 UTC, Graham Whitted
no flags Details
Term log showing difference in behavior between qt-4.8.7-34 and qt-4.8.7-36 (17.81 KB, text/plain)
2018-02-28 20:31 UTC, Graham Whitted
no flags Details

Description Graham Whitted 2018-02-28 20:28:26 UTC
Created attachment 1402107 [details]
fc28-qt-json source

Description of problem:

Looks like there is a regression from qt-4.8.7-34.fc28.x86_64 to qt-4.8.7-36.fc28.x86_64 that breaks QtScriptEngine ability to parse/stringify JSON integer numbers.

Version-Release number of selected component (if applicable):

qt-4.8.7-36.fc28.x86_64

How reproducible:

Attached is a simple test program that shows the bad behavior

Steps to Reproduce:
1. tar xJvf fc28-qt-json.txz
2. cd fc28-qt-json
3. qmake-qt4
4. make
5. ./fc28-qt-json

Actual results:

parser    :  "function parse_json(string) { return JSON.parse(string); }" 
serializer:  "function serialize_json(object) { return JSON.stringify(object); }" 
-----  "int"  (json -> qvariant -> json) ----- 
json    :  "5" 
qvariant:  QVariant(int, 5) 
json    :  "5" 
 
-----  "int" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(int, 5) 
json    :  "5" 
qvariant:  QVariant(int, 5) 
 
-----  "real"  (json -> qvariant -> json) ----- 
json    :  "1.23" 
qvariant:  QVariant(double, 1.23) 
json    :  "1.23" 
 
-----  "real" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(double, 1.23) 
json    :  "1.23" 
qvariant:  QVariant(double, 1.23) 
 
-----  "string"  (json -> qvariant -> json) ----- 
json    :  ""hello world"" 
qvariant:  QVariant(QString, "hello world") 
json    :  ""hello world"" 
 
-----  "string" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(QString, "hello world") 
json    :  ""hello world"" 
qvariant:  QVariant(QString, "hello world") 
 
-----  "list"  (json -> qvariant -> json) ----- 
json    :  "[5, 1.23, "hello world"]" 
qvariant:  QVariant(QVariantList, (QVariant(int, 5) ,  QVariant(double, 1.23) ,  QVariant(QString, "hello world") )  ) 
json    :  "[5,1.23,"hello world"]" 
 
-----  "object" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(QVariantList, (QVariant(int, 5) ,  QVariant(double, 1.23) ,  QVariant(QString, "hello world") )  ) 
json    :  "[5,1.23,"hello world"]" 
qvariant:  QVariant(QVariantList, (QVariant(int, 5) ,  QVariant(double, 1.23) ,  QVariant(QString, "hello world") )  ) 
 
-----  "map"  (json -> qvariant -> json) ----- 
json    :  "{"a": 5, "b": 1.23, "c": "hello world"}" 
qvariant:  QVariant(QVariantMap, QMap(("a", QVariant(int, 5) ) ( "b" ,  QVariant(double, 1.23) ) ( "c" ,  QVariant(QString, "hello world") ) )  ) 
json    :  "{"a":5,"b":1.23,"c":"hello world"}" 
 
-----  "object" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(QVariantMap, QMap(("a", QVariant(int, 5) ) ( "b" ,  QVariant(double, 1.23) ) ( "c" ,  QVariant(QString, "hello world") ) )  ) 
json    :  "{"a":5,"b":1.23,"c":"hello world"}" 
qvariant:  QVariant(QVariantMap, QMap(("a", QVariant(int, 5) ) ( "b" ,  QVariant(double, 1.23) ) ( "c" ,  QVariant(QString, "hello world") ) )  ) 


Expected results:


Additional info:

Comment 1 Graham Whitted 2018-02-28 20:31:23 UTC
Created attachment 1402109 [details]
Term log showing difference in behavior between qt-4.8.7-34 and qt-4.8.7-36

Comment 2 Graham Whitted 2018-02-28 20:38:31 UTC
I mistakenly submitted the bug before I was done creating the description. The "Actual Results" shown above are actually the expected results (i.e. what I see when running with qt-4.8.7-34 installed). Here is a snippet of what the output looks like when running with qt-4.8.7-36. The attached term log shows the full output.

-----  "int"  (json -> qvariant -> json) ----- 
json    :  "5" 
qvariant:  QVariant(int, 0) 
json    :  "0" 
 
-----  "int" (qvariant -> json -> qvariant) ----- 
qvariant:  QVariant(int, 5) 
json    :  "0" 
qvariant:  QVariant(int, 0)

Comment 3 Rex Dieter 2018-02-28 22:06:26 UTC
This is likely due to something in build environment, gcc compiler the most obvious candidate (qt4's source code hasn't changed).

Comment 4 Kevin Kofler 2018-03-01 01:57:36 UTC
Rex, the one relevant change between -34 and -36 is your change to the LDFLAGS. But it could also simply be a GCC regression, indeed.

Comment 5 Rex Dieter 2018-03-05 20:57:32 UTC
Tried lots of things, mostly playing with compiler flags, and in the end, the only thing that I've found to work so far is dropping -O2 to -O1

qt5-qtscript:
%changelog
* Mon Mar 05 2018 Rex Dieter <rdieter> - 5.10.1-3
- support %%bootstrap, %%check: add autotests
- build with -O1 to workaround s

Comment 6 Rex Dieter 2018-03-05 21:20:07 UTC
confirmed autotests (most!) pass now, calculator example works, as well as linked bug for plasmashell

Comment 7 Adam Williamson 2018-03-05 21:43:05 UTC
Maybe file a GCC bug about this? Seems v. likely to be a GCC 8 bug, to me?

Comment 8 Rex Dieter 2018-03-06 15:15:08 UTC
*** Bug 1551246 has been marked as a duplicate of this bug. ***

Comment 9 Rex Dieter 2018-03-06 15:17:39 UTC
Yeah, I'll re-open this to track it formally (hopefully so we can eventually drop the workaround in place)

Comment 10 Ben Cotton 2019-05-02 22:00:11 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Adam Williamson 2019-05-21 22:06:29 UTC
Do you know the status of this, Rex?

Comment 12 Rex Dieter 2019-05-22 14:22:35 UTC
Fail on my part, didn't follow-through doing much beyond re-opening this bug.

I'll go verify if it's still an issue on f30 (or not).

Comment 13 Rex Dieter 2019-05-22 14:39:31 UTC
Confirmed no longer an issue with Qt 5.12.1 as shipped on f30.

Now to try to figure out what fixed it (code changes or compiler or other)

Comment 14 Kevin Kofler 2019-05-22 16:14:09 UTC
The bug was originally reported against Qt 4 (qt-4.8.7-36.fc28.x86_64) though.

Comment 15 Rex Dieter 2019-05-22 16:31:06 UTC
I'm testing both

Comment 16 Ben Cotton 2019-05-28 19:00:52 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.