Opened 6 years ago
Closed 6 years ago
#14394 closed bug (fixed)
Regression when opening file - libroot/posix/malloc exception (BPrivate::superblock::getBlock():getNumAvailable() = 0)
Reported by: | smallstepforman | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | System/libroot.so | Version: | R1/Development |
Keywords: | malloc exception | Cc: | jackburton |
Blocked By: | Blocking: | ||
Platform: | All |
Description
I'm working on a Video Editor, and after an update to the hrev 52254, when opening media files I get an exception:
/var/lib/buildbot/workers/haiku/haiku/src/system/libroot/posix/malloc/superblock.h:171:BPrivate::block * BPrivate::superblock::getBlock(): getNumAvailable() == 0
Steps to reproduce:
- start video editor
- open project which imports at a couple of video files (at least 2)
- exception thrown when opening 2nd file
Haiku Rev 52201 (2018 Aug 09) Working fine (and several older releases)
Haiku Rev 52254 (2018 Aug 20) Error when opening file
The error was introduced between hrev 52201 and 52254
Attachments (7)
Change History (23)
by , 6 years ago
Attachment: | screenshot1.png added |
---|
comment:1 by , 6 years ago
Please try running under libroot_debug (i.e. LD_PRELOAD=libroot_debug.so path/to/app...
)) and see if you get a different crash. If you don't, try further using the guarded heap (MALLOC_DEBUG=g LD_PRELOAD...
).
comment:2 by , 6 years ago
Cc: | added |
---|
Hmm, actually this might have been caused by jackburton's changes, if it is a memory violation. CC'ing him.
comment:3 by , 6 years ago
These are the commits to AVCodecDecoder.cpp and AVFormatReader.cpp within these revisions:
commit 1d404e45f1a205215f9387dd764aa74cbc205c70 (tag: hrev52222) Author: JackBurton79 <stefano.ceccherini@…> Date: Tue Aug 14 14:43:30 2018 +0200
ffmpeg plugin: use avformat/codec_free_context() where applicable
commit 3bd0b6ec8105c293cb54e1e22e201ea2cbab5d44 (tag: hrev52206) Author: Adrien Destugues <pulkomandy@…> Date: Sat Aug 11 11:59:09 2018 +0200
ffmpeg: do not compute a duration for streaming streams.
Streaming means the stream is endless, so don't compute a duration.
ffmpeg computes an estimation using what it thinks is the file size, but is instead some internal buffer size from BAdapterIO.
Fixes second part of #14326.
commit e302fe32cf4b41823a6dc153ce49f2bff70a290b Author: Barrett17 <b.vitruvio@…> Date: Sat Aug 4 11:36:34 2018 +0200
AVCodecDecoder: Rename fContext to fCodecContext
commit 334b8f3f9c2dbea74ad5f289d0114f47d816619b Author: Barrett17 <b.vitruvio@…> Date: Fri Aug 3 16:36:30 2018 +0200
ffmpeg: Remove obsolete code
commit af8f2a39a0b49397b951192f8615f8ab95c356ef (tag: hrev52212) Author: Adrien Destugues <pulkomandy@…> Date: Sun Aug 12 09:49:36 2018 +0200
ffmpeg: do not compute duration for "mutable size" streams.
Fixes #14326 without breaking other things.
comment:4 by , 6 years ago
Since most of them are just style changes or unrelated changes, you could try reverting commit 1d404e45f1a205215f9387dd764aa74cbc205c70 and try again.
comment:5 by , 6 years ago
Of course, if encoding/muxing is involved we should analyze also commits done to AVCodecEncoder.cpp and AVFormatWriter.cpp (But I guess it's not, since the ticket is about opening video files).
comment:6 by , 6 years ago
I've downloaded some Haiku images to help identify where the bug appeared. hrev 52219 is the last good rev, and with 52230 the problem appears. Hope this helps narrow down the culprit.
comment:7 by , 6 years ago
Looking at the source commit log, the error is with one the following commits:
ffmpeg plugin: use avformat/codec_free_context() where applicable hrev52222 JackBurton79 10 days -3/+3
- AVFormatWriter: free the context with the correct function hrev52221
Alternatively, since I boot Haiku from external USB2 hard disk
usb: support for retrieving full configuration descriptorshrev52223
One of these commits produces the error.
comment:9 by , 6 years ago
jackburton, I will try hrev52272 as soon as a nightly is available, or on Monday (the latest) when I connect the laptop to a wired network (sorry, no wifi support from home).
comment:10 by , 6 years ago
Hi JackBurton. I've just tried the latest nightly image (hrev 52273), and the error still exists. See attached screenshot. The video decoding class I have hasn't changed during the last 18 months, it has worked flawlessly up until hrev hrev 52219, and the problem started from the hrev 52230. So something between these 2 hrevs causes the problem.
comment:11 by , 6 years ago
This is getting frustrating. Up to revision hrev 52219, everything works fine (going back at least 18 months), But from hrev 52230 I can even get a KDL (see attachment IMG-5979.JPG, KDL in 52254) when opening an image file in my editor. Since I boot Haiku from USB2 hard disk (via XHCI interface), maybe the issue is not related to JackBurtons fixes in ffmpeg and AV layer between revs 52219 and 52230. Maybe the error is due to hrev 52223, which alters the USB stack just enough to trigger my error on USB2 hard disk.
comment:12 by , 6 years ago
Don't add spaces between the hrev and the number, then we get links to those commits.
comment:13 by , 6 years ago
I recall that KDL has its own ticket, but I can't remember which one it was. At any rate, indeed, that may be related.
comment:14 by , 6 years ago
Could you try with hrev52291 or later ? I reverted the change on AVCodecDecoder.cpp.
comment:15 by , 6 years ago
Thx JackBurton, fixed in hrev52299 (see attached screenshot). You can close the issue.
comment:16 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Debugger output