Closed Bug 1272817 Opened 9 years ago Closed 9 years ago

Crash in java.lang.IllegalArgumentException: Expected buffer size larger than 0. Got: 0 at org.mozilla.gecko.util.FileUtils.readStringFromInputStreamAndCloseStream(FileUtils.java)

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
critical

Tracking

(firefox49 fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 --- fixed

People

(Reporter: dbaron, Assigned: mcomella)

References

Details

(Keywords: crash, topcrash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is report bp-195f2b3a-8359-4d04-8714-90bd02160513. ============================================================= There are 5 of these crashes: java.lang.IllegalArgumentException: Expected buffer size larger than 0. Got: 0 at org.mozilla.gecko.util.FileUtils.readStringFromInputStreamAndCloseStream(FileUtils.java:147) at org.mozilla.gecko.telemetry.stores.TelemetryJSONFilePingStore.lockAndReadFileAndCloseStream(TelemetryJSONFilePingStore.java:235) at org.mozilla.gecko.telemetry.stores.TelemetryJSONFilePingStore.getAllPings(TelemetryJSONFilePingStore.java:158) at org.mozilla.gecko.telemetry.stores.TelemetryJSONFilePingStore.getAllPings(TelemetryJSONFilePingStore.java:55) at org.mozilla.gecko.telemetry.TelemetryUploadService.uploadPendingPingsFromStore(TelemetryUploadService.java:87) at org.mozilla.gecko.telemetry.TelemetryUploadService.onHandleIntent(TelemetryUploadService.java:70) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.os.HandlerThread.run(HandlerThread.java:61) probably from 2 different users, in the May 12 nightly builds. (I got a little confused trying to track down blame for this, but I think all the possibilities point to mcomella.)
Flags: needinfo?(michael.l.comella)
Regression from bug 1243585. We pass the file length to a method that uses that to set the buffer size. When the buffer size is 0, we throw (i.e. that API does not gracefully handle empty files. The solution is to return early if we try to read empty files. That being said, it's curious we're reading an empty file – we probably crashed while trying to write the file in the first place.
Blocks: 1243585
Flags: needinfo?(michael.l.comella)
Assignee: nobody → michael.l.comella
Attachment #8752413 - Flags: review?(s.kaspari) → review+
Comment on attachment 8752413 [details] MozReview Request: Bug 1272817 - Return early if file is empty + regression test. r=sebastian https://reviewboard.mozilla.org/r/52603/#review49563
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: