Bug 1472466

Summary: cppcheck segfault on qml file
Product: [Fedora] Fedora Reporter: ced
Component: cppcheckAssignee: Susi Lehtola <susi.lehtola>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: ced, mtasaka, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-11 08:56:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ced 2017-07-18 19:59:10 UTC
Description of problem:

Cppcheck crash with a segfault when analysing a Qt (cpp) project with a specific Qml file.
(Note: qml is the UI description language used by the Qt framework)

How reproducible:


Steps to Reproduce:
1. Create a "fake" qml file looking like this

```
MyElement {
    title: qsTr("Hello World")
    button.onClicked: title = "foo";
}
```

Save it in "/tmp/project/sample.qml"
The important point in this file is the "onClicked" element

2. Run cppcheck with the following options:

```
cppcheck --enable=all --library=qt /tmp/project
```


Actual results:

Cppcheck crash

```
Checking /tmp/project/sample.qml ...
Segmentation fault (core dumped)
```

Expected results:

cppcheck returns with no error

Additional info:

Fedora 26 provides the last released version 1.79
Building from source master do not trigger the bug

Comment 1 ced 2017-07-18 20:21:59 UTC
after some investigation, this patch should fix the issue:

https://github.com/danmar/cppcheck/commit/956b5812e7c49a7d221f99e12dcb13deb5d6ffab

It can be cherry-picked on 1.79 without conflict

Comment 2 Mamoru TASAKA 2017-09-11 05:06:57 UTC
F-26 now has cppcheck-1.80-1.fc26. Would you confirm if this bug is fixed?

Comment 3 ced 2017-09-11 08:29:05 UTC
I confirm the bug is fixed.
You can close

Thx!

Comment 4 Mamoru TASAKA 2017-09-11 08:56:11 UTC
Thank you for confirming.