Bug 340564 - crash when opening an empty file
Summary: crash when opening an empty file
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Plugin: Okteta Integration (other bugs)
Version First Reported In: 4.7.0
Platform: MacPorts macOS
: NOR crash
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 21:15 UTC by RJVB
Modified: 2016-09-08 17:06 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2014-11-01 21:15:58 UTC
KDevelop crashes in Kasten2::ByteArrayView::init when trying to open an empty file, after clicking away the alert this file cannot be opened.

Reproducible: Always

Steps to Reproduce:
1. Open a project that contains an empty file.
2. Double-click that file in the Project toolview
3. Accept the dialog warning that the file cannot be opened

Actual Results:  
crash

Expected Results:  
No crash, and maybe a window on the empty file, ready to fill it.

This is the backtrace I get:

```
#0  0x0000000123cd0594 in Kasten2::ByteArrayView::init ()
#1  0x0000000123cd0b7b in Kasten2::ByteArrayView::ByteArrayView ()
#2  0x0000000123c91087 in KDevelop::OktetaView::OktetaView (this=0x13d9f7050, document=<value temporarily unavailable, due to optimizations>, viewProfileSynchronizer=0x13e64d440) at /Volumes/Debian/MP6/var/macports/build/_Volumes_Debian_MP6_site-ports_kde_kdevelop-git/kdevelop-git/work/kdevelop-git-4.7.0/utils/okteta/oktetaview.cpp:39
```
Comment 1 RJVB 2014-11-01 21:24:38 UTC
NB: the file in question is called Info.plist.template.orig, and was created by applying a patch to a project open in a running KDevelop session.
Empty files created through KDevelop do not cause a crash.
Comment 2 Kevin Funk 2016-09-08 10:26:07 UTC
Reproducible in 5.0?
Comment 3 RJVB 2016-09-08 10:43:09 UTC
No, not even with 4.7.3 in fact. Or it depends on the type of the empty file, which sadly I didn't record in my initial report.