← Back to team overview

ubuntu-phone team mailing list archive

Re: split() method failure with Qt5.3

 

There hasn’t been any visible progress on
https://bugreports.qt-project.org/browse/QTBUG-39289 in the past 5 days,
except that it has been confirmed.

So until it’s properly fixed upstream, I resorted to workarounds in
webbrowser-app. I used String.match() instead of String.split() as
suggested by Zoltán, and I wrote a custom implementation of
String.replace().
For those interested, the code is there:
https://code.launchpad.net/~osomon/webbrowser-app/qt53-workaround-QTBUG-39255/+merge/220985
.
Please note that these are temporary workarounds that should disappear
ASAP, patching every single application is not the way to go.

Cheers,

 Olivier


On Tue, May 27, 2014 at 7:34 AM, Roman Shchekin <mrqtros@xxxxxxxxx> wrote:

> >> I think we should also consider looking into Qt’s code ourselves and
> see if we can come up with a patch, in case upstream is not responsive
> enough.
> They are very responsive, but we should provide tiny reproducible code
> sample (done) and good description (not yet).
> Just say in comments that it causes SEGMENTATION FAULT (everyone fears
> this words) and it also affect Android (I can confirm).
> Obviously it is an error in QV4, it wasn't tested a lot yet.
>
> BR,
> Roman.
>
>
>
> 2014-05-27 1:50 GMT+04:00 Olivier Tilloy <olivier.tilloy@xxxxxxxxxxxxx>:
>
>>
>>
>>
>> On Mon, May 26, 2014 at 7:08 PM, Zoltán Balogh <
>> zoltan.balogh@xxxxxxxxxxxxx> wrote:
>>
>>>
>>> On 05/26/2014 10:24 AM, Albert Astals Cid wrote:
>>>
>>>> On Sunday 25 May 2014 13:36:56 Zoltán Balogh wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> During the Qt5.3 migration work we  realized that the split() methods
>>>>> terminates the process it is used in when the separator is a regular
>>>>> expression.
>>>>>
>>>> Hi, I just tried the attached main.qml in qmlscene and it's working
>>>> fine under
>>>> 5.3 beta2 ppa packages. Is that because i didn't understand the problem
>>>> or did
>>>> the issue get fixed meanwhile?
>>>>
>>>> Cheers,
>>>>    Albert
>>>>
>>> Sorry, I was a bit too brief. The issue is exclusive on armhf:
>>> https://bugreports.qt-project.org/browse/QTBUG-39255
>>>
>>> It only causes problem when you use the split with a regular expression.
>>> So 'what ever'.split(" ") will do the job but if you try to use
>>> split(/\s+/) then it dumps core. Additional fun, that it malfunctions only
>>> when the regexp matches.
>>>
>>> Odd problem. The lucky part is that it happens only with the split. So
>>> all other string methods are working well. So I simple suggest to use
>>> match() method or whatever what does the same job.
>>>
>>
>> Not so fast… It seems a similar issue affects String.replace(re, …). See
>> for yourself with the following example:
>>
>>   import QtQuick 2.0
>>   Item {
>>     Component.onCompleted: "bla".replace(/\w/g, function(a) { return
>> a.toUpperCase() })
>>   }
>>
>> I’ll look into working around this issue tomorrow, but I think we should
>> also consider looking into Qt’s code ourselves and see if we can come up
>> with a patch, in case upstream is not responsive enough.
>>
>> Cheers,
>>
>>  Olivier
>>
>> --
>> Mailing list: https://launchpad.net/~ubuntu-phone
>> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ubuntu-phone
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>

Follow ups

References