Bug 401278 - Segfault in background parser [crash in PHP::ExpressionVisitor::visitClassNameReference]
Summary: Segfault in background parser [crash in PHP::ExpressionVisitor::visitClassNam...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: 5.3.1
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 14:31 UTC by Julio J.
Modified: 2018-11-23 07:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.3.1
Sentry Crash Report:


Attachments
GDB Backtrace of the crash (65.73 KB, text/plain)
2018-11-21 14:31 UTC, Julio J.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julio J. 2018-11-21 14:31:54 UTC
Created attachment 116448 [details]
GDB Backtrace of the crash

I've found another crash on the parser. I'm attaching the gdb output of the crash.

I'll try to find the exact file/code making it to crash later abut I'm opening this so I don't forget.

This happens using the version from master of kdev-php with HEAD at 0a4bacb7e8730dd7de7116da421013d072244466
Comment 1 Julio J. 2018-11-21 15:00:01 UTC
Found it! This is the file that causes the crash
https://github.com/googleapis/google-cloud-php-core/blob/master/src/GrpcRequestWrapper.php

Only by opening the file, I can reproduce the crash every time. Let me know if I can provide any other info.
Comment 2 Heinz Wiesinger 2018-11-22 19:55:00 UTC
Git commit 4e07839f5a978193ad10b4e3d7cc6b282c350d3f by Heinz Wiesinger.
Committed on 22/11/2018 at 19:52.
Pushed by wiesinger into branch '5.3'.

Fix handling of array indexes after ClassNameReferences
FIXED-IN: 5.3.1

M  +21   -13   duchain/expressionvisitor.cpp
M  +1    -0    duchain/expressionvisitor.h
M  +33   -0    duchain/tests/uses.cpp
M  +1    -0    duchain/tests/uses.h

https://commits.kde.org/kdev-php/4e07839f5a978193ad10b4e3d7cc6b282c350d3f
Comment 3 Julio J. 2018-11-22 22:18:29 UTC
Can confirm is fixed. I just tested with the latest HEAD from master (60dbbdf) and the crash is gone.
Comment 4 Heinz Wiesinger 2018-11-23 07:05:14 UTC
Great! Thanks for verifying! :)