Bug#792672: Assertion error in meters.lv2
trebmuh at tuxfamily.org
trebmuh at tuxfamily.org
Thu Jul 23 16:32:11 UTC 2015
De: "Miguel A. Colón Vélez"
Objet: Bug#792672: Assertion error in meters.lv2
Someone at the #debian-multimedia channel dropped this report
<olinuxx> Hi guys, I've a bug to report against x42-plugins
<olinuxx> the meters, both as LV2 or standalone app (x42-meter) who
are normaly displaying a needle are segfaulting
<olinuxx> using them in ardour crash it
<olinuxx> the error log is : x42-meter: ./gui/needle.c:118: void
img2surf(const MyGimpImage*, cairo_surface_t**, unsigned char**):
Assertion `ys + xs < (img->width * img->height +
<olinuxx> (you can get it trying "x42-meter 6" as an example)
<olinuxx> this is the case with a fresh Jessie install with the
backport from stretch, as well as a fresh Stretch install
<olinuxx> I didn't looked deep yet into BTS reporting, so I'm putting
that here, hopefully, someone will pick it up
I looked at the source and the fix is trivial. It should be "*" and
not "+" as in:
-assert (ys + xs < (img->width * img->height + img->bytes_per_pixel));
+assert (ys + xs < (img->width * img->height * img->bytes_per_pixel));
ys + xs is a sequence that accumulates the total number of bytes and it
img->bytes_per_pixel, img->bytes_per_pixel*1, img->bytes_per_pixel*2,
img->bytes_per_pixel*(img->width * img->height -1)
It seems upstream wanted to bound ys + xs by the next value in the
sequence which is (img->width * img->height * img->bytes_per_pixel).
This makes the assertion always true since it will be short of the
upper bound by at least img->bytes_per_pixel.
Upstream's commit suggest that there may be another issue
with array boundaries but that is independent of this report.
I have never run or compiled these plugins but the math seems to add
up. Hope my pseudo-patch helps.
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers at lists.alioth.debian.org
Hi all (olinuxx here),
I've been talking with Robin Gareus (upstream) over IRC today. He's
copied to this email.
The outcomes is : the lines "assert..." can be totally removed and have
beendone so upstream :
As well, Robin suggested to remove the fast-math optimisation
(debian/rules) since (quoting Robin) :
> ffast-math is not good
> that can result in the meters being wrong by half a dB or so. depends
> -ffast-math don't care about accuracy, be fast.
> and with small numbers there can be a discrepancy then convert to dB
> and it'll be even larger
I rebuild the package on my computer using the debian sources and
pbuilder and it looks to be doing the job, ie: not segfaulting anymore.
Hope this email helps and thanks to you all for the jobs done.
More information about the pkg-multimedia-maintainers