[FFmpeg-trac] #1863(undetermined:closed): Remove all abort() calls from ffmpeg libraries
FFmpeg
trac at avcodec.org
Mon Nov 12 22:51:08 CET 2012
#1863: Remove all abort() calls from ffmpeg libraries
-------------------------------------+-------------------------------------
Reporter: DonMoir | Owner:
Type: defect | Status: closed
Priority: normal | Component:
Version: unspecified | undetermined
Keywords: | Resolution: wontfix
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by reimar):
All av_assert* use abort().
Unfortunately all av_assert and aborts I can find are for cases where a
serious error occurred, we are in an unknown state and generally it is
simply unfixable and continuing would potentially make bugs easier to
exploit.
Or to put it differently:
> but this might be difficult to handle from an application perspective
since it would not know what state the thing is in and what exactly to do
about it.
It is used in cases where FFmpeg itself has exactly this problem.
A ff_abort seems kind of pointless, since you can already catch SIGABRT
for a more or less similar effect.
So I do not see a way to avoid them that provides a reasonable
cost/benefit ratio, however
1) All abort() that are called directly should probably be replaced with
av_assert0
2) There might be _some_ that would be better to replace with a more
robust solution (for example the one in ff_init_sparse_vlc that you
probably encountered could probably be enhanced with a check that all
static tables are initialized under a lock, thus making this kind of
mistake immediately obvious).
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1863#comment:5>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list