Bug 401278

Summary: Segfault in background parser [crash in PHP::ExpressionVisitor::visitClassNameReference]
Product: [Applications] kdevelop Reporter: Julio J. <julioelpoeta>
Component: Language Support: PHPAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash CC: pprkut
Priority: NOR    
Version First Reported In: git master   
Target Milestone: 5.3.1   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.3.1
Sentry Crash Report:
Attachments: GDB Backtrace of the crash

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! :)