Summary: | Crash (_cairo_pen_find_active_cw_vertex_index: Assertion `i < pen->num_vertices' failed) with CAIRO_LINE_CAP_ROUND and a degenerate transform matrix. | ||
---|---|---|---|
Product: | cairo | Reporter: | Riccardo Magliocchetti <riccardo.magliocchetti> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | proski |
Version: | 1.4.10 | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Minimal test case |
Description
Riccardo Magliocchetti
2007-11-19 12:47:20 UTC
(In reply to comment #0) > First of all i'm very sorry for the problem i've caused with bug 10231. Please don't worry about it. I think I was just grouchy this morning, and I probably let too much of that come through in my response. Sorry about that. > I'm getting this crash with swfdec git 7c377ba3852ca8c66e5d42bbdec7662ca9b7a4fd > while loading http://www.labottegadellabici.it/index.swf in firefox. > > Without installing the mozilla plugin you can reproduce by: > swfdec-dir/player/swfplay http://www.labottegadellabici.it/link.swf Thanks for the details on how to replicate it. Unfortunately I haven't been able to replicate the failure. I've compiled exactly that revision of swfdec and run it with a locally downloaded copy of link.swf against many versions of cairo (current HEAD from git, 1.4.10, 1.4.0, 1.2.6), and in all cases I get the same behavior. Namely, I see complaints like the following: SWFDEC: WARN : swfdec_shape_parser.c(279): swfdec_shape_parser_finish: fillstyle 0 has no path SWFDEC: WARN : swfdec_shape_parser.c(279): swfdec_shape_parser_finish: fillstyle 1 has no path SWFDEC: WARN : swfdec_shape_parser.c(279): swfdec_shape_parser_finish: fillstyle 2 has no path SWFDEC: WARN : swfdec_shape_parser.c(279): swfdec_shape_parser_finish: fillstyle 3 has no path SWFDEC: ERROR: swfdec_codec_gst.c(231): swfdec_gst_decoder_init: failed to create decoder SWFDEC: ERROR: swfdec_codec_audio.c(192): swfdec_audio_decoder_new: no suitable decoder for audio codec 2 Then a window appears with large text at the top of "La Bottega della Bici", a picture of a person on a bicycle, a large yellow rectangle, and 6 text "buttons" at the bottom, (some gray and some black). I can't seem to get anything else to happen, (the buttons don't do anything for example), but I also can't get any crash. Since you're able to exercise the failure, what might help is if you could use libcairowrap[*] and capture the last few cairo calls leading to the crash. -Carl [*] http://cgit.freedesktop.org/~company/libcairowrap/ Benjamin, I assume this is a recent version. We should probably go ahead and host a repository for this on git.freedesktop.org to be more "official". Any reason not to do that? (In reply to comment #1) > Thanks for the details on how to replicate it. Unfortunately I haven't > been able to replicate the failure. I've compiled exactly that > revision of swfdec and run it with a locally downloaded copy of > link.swf against many versions of cairo (current HEAD from git, > 1.4.10, 1.4.0, 1.2.6), and in all cases I get the same behavior. Uhm, can't get the crash playing the file locally too. Playing from the website makes a difference. Btw upgraded to latest git of swfdec. > Since you're able to exercise the failure, what might help is if you > could use libcairowrap[*] and capture the last few cairo calls leading > to the crash. Done > Benjamin, I assume this is a recent version. We should probably go > ahead and host a repository for this on git.freedesktop.org to be more > "official". Any reason not to do that? AFAICS he's not in C These are few last calls before the assert: cairo_set_source(cr_0x9b79de8, pattern_0xa0a4e10); cairo_pattern_destroy(pattern_0xa0a4e10); cairo_fill(cr_0x9b79de8); cairo_set_line_cap(cr_0x9b79de8, 1); cairo_set_line_join(cr_0x9b79de8, 1); cairo_move_to(cr_0x9b79de8, 52, -73); cairo_curve_to(cr_0x9b79de8, 78, -45,6667, 86,6667, -24,3333, 78, -9); cairo_curve_to(cr_0x9b79de8, 86,6667, 26,3333, 78, 47,3333, 52, 54); cairo_curve_to(cr_0x9b79de8, 45,3333, 81,3333, 24,6667, 90,3333, -10, 81); cairo_curve_to(cr_0x9b79de8, -25,3333, 90,3333, -46, 81,3333, -72, 54); cairo_curve_to(cr_0x9b79de8, -78,6667, 46,6667, -87,3333, 25,6667, -98, -9); cairo_curve_to(cr_0x9b79de8, -87,3333, -24,3333, -78,6667, -45,6667, -72, -73); cairo_curve_to(cr_0x9b79de8, -46, -80,3333, -25,3333, -89, -10, -99); cairo_curve_to(cr_0x9b79de8, 24,6667, -89, 45,3333, -80,3333, 52, -73); cairo_set_source_rgba(cr_0x9b79de8, 0,6, 0,6, 0,6, 1); cairo_set_line_width(cr_0x9b79de8, 20); cairo_stroke(cr_0x9b79de8); (In reply to comment #2) > (In reply to comment #1) > > Benjamin, I assume this is a recent version. We should probably go > > ahead and host a repository for this on git.freedesktop.org to be more > > "official". Any reason not to do that? > > AFAICS he's not in C that should read CC (In reply to comment #4) > (In reply to comment #2) > > (In reply to comment #1) > > > Benjamin, I assume this is a recent version. We should probably go > > > ahead and host a repository for this on git.freedesktop.org to be more > > > "official". Any reason not to do that? > > > > AFAICS he's not in C > > that should read CC /me demonstrates why he dislikes bugzilla so much... it makes these little walled-off conversations. Mailing lists are much better for including more people. I remember him being involved in this dicussion earlier, (perhaps it was on a separate bug report and he had suggested the duplication), so it seemed natural to try to address him. -Carl (In reply to comment #2) > Uhm, can't get the crash playing the file locally too. Playing from the > website makes a difference. Btw upgraded to latest git of swfdec. Thanks. I've tried that now and I have succesfully replicated the bug. And the bug seems to exist with even the latest cairo from git, so this definitely looks new compared to other bugs we've seen, (even those that crashed on the same assertion failure). And thanks for the report from libcairowrap. That tool's output is definitely looking really good. For anyone hacking on it, (and yes, Benjamin might not be on the CC list so someone might have to chase him down and point him at this walled-off discussion), here are a couple of things that would be nice to fix: 1. The numbers need to be printed as valid C literals, (that is, a locale-independent printing of floating-point numbers). The current -45,6667 where C wants -45.6667 is not too useful. :-) 2. Instead of cr_0xdeadbeef it would be nice to just have the tool identify matching pointers and map them to small integers. So "cr", "cr2", "cr3" or so. Anyway, as nice as it looks, the output you gave doesn't look sufficient to replicate the bug. I'm assuming that's because there's a particular transformation matrix necessary to trigger the bug, (so using that snippet with an identity transform doesn't exercise the bug). Maybe libcairowrap should periodically emit something to explicitly set relevant cairo state such as the CTM? That would let reporters quote output back to the last such snapshot and ensure that all state was captured. -Carl Created attachment 12679 [details]
Minimal test case
Sure enough, there was just an earlier cairo_scale and cairo_transform in the libcairowrap output that were necessary to trigger the bug. So here's the minimal test case that I've come up with so far.
And I was wrong before when I said this was failing against recent cairo from git, (but it does indeed fail with cairo 1.4.10). I'll summarize the status in a next post.
OK. Here's the scoop: The test in bug 10231 originally tickled this problem by attempting to stroke with a line width explicitly 0.0. This was first fixed in cairo 1.4.2, (and added to the test suite as line-width-zero). In this bug report we're seeing the same assertion failure, but with a non-zero line width, but a transformation matrix that transforms the two-dimensional pen to a one-dimensional line or to a zero-dimensional point. This bug exists as of cairo 1.4.10. Benjamin Otte had raised this bug previously on the cairo mailing list, and it has since been fixed (and added to the test suite as degenerate-pen). This bug can be verified as fixed, (with the attached test cast) in both the 1.5.2 and 1.4.11 snapshots of cairo. This means it will be fixed in the upcoming 1.6.0 and 1.4.12 releases of cairo. Thanks for the report. -Carl |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.