all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Adam Plaice <plaiceadam@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Pip Cet <pipcet@gmail.com>, 36773@debbugs.gnu.org
Subject: bug#36773: 27.0.50; Accessing a cached SVG with eww can cause Emacs to crash
Date: Thu, 25 Jul 2019 00:13:16 +0200	[thread overview]
Message-ID: <CAJw81dZv_e2EFN36tq68GUtUq+MjoLxd40YW15UavDhRO-LzcA@mail.gmail.com> (raw)
In-Reply-To: <83sgqvnt87.fsf@gnu.org>

> I'm attaching a patch to fix the rsvg segfault, and another patch
> which works around the url-http issue. However, I'm not sure how the
> latter should be fixed properly.

Thanks! The first patch indeed prevents the crash, while the second also
causes the image to be displayed (as expected).

> -      (zlib-decompress-region (point) (point-max)))))))
> +      (zlib-decompress-region (point) (point-max) t))))))

> So I guess that is a hint, we could just go back to the Emacs-26
> behavior. I don't think we should, but in practice it should work
> okay.

b36913d803ee22a314f2e0a27523fbadeb60dd2c introduced the above change.
Testing with a checkout of it, results in a blank "standard error box"
being displayed, though interestingly without a crash.  At
b36913d803ee22a314f^ the SVG was correctly displayed, so
b36913d803ee22a314f did indeed introduce (part of) this bug.  However,
not using ALLOW-PARTIAL, would re-introduce Bug#33133, which would
probably not be a great idea.

(I tried bisecting to find out when the crashes themselves started,
but without appropriate "make clean"ing (or more severe), I ended up
in an unbuildable state, and I didn't have time for full rebuilds,
with this range to be bisected.  In any case, your
0001-Don-t-crash-when-parsing-bad-SVG-data-bug-36773.patch fixes the
crash.)

> I thought that additional argument only mattered upon failure to
> completely uncompress the data.  Otherwise, the use of that argument
> should not have changed the behavior.  Are you saying that the
> decompression failed in this case?  If not, what am I missing?

If I understand the issue correctly, it's because
`zlib-decompress-region' is trying to decompress content that is in
the cache and had already been decompressed.  Hence, the decompression
fails and deletes the contents, which, depending on other particulars,
either crashes Emacs or causes a warning, and in any case prevents the
actual image from being displayed.

Thank you!
Adam





  reply	other threads:[~2019-07-24 22:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 16:40 bug#36773: 27.0.50; Accessing a cached SVG with eww can cause Emacs to crash adam plaice
2019-07-23 18:37 ` Pip Cet
2019-07-23 19:33   ` Adam Plaice
2019-07-23 20:06     ` Pip Cet
2019-07-23 21:13       ` Adam Plaice
2019-07-24 13:24         ` Pip Cet
2019-07-24 14:46           ` Eli Zaretskii
2019-07-24 18:28             ` Pip Cet
2019-07-24 19:11               ` Eli Zaretskii
2019-07-24 22:13                 ` Adam Plaice [this message]
2019-07-25 12:05                   ` Pip Cet
2019-07-25  9:38           ` Lars Ingebrigtsen
2019-07-25 11:51             ` Pip Cet
2019-07-25 12:55               ` Eli Zaretskii
2019-07-25 14:14                 ` Pip Cet
2019-07-25 22:14                   ` Adam Plaice
2019-07-27 10:58                   ` Eli Zaretskii
2019-07-25 17:09               ` Lars Ingebrigtsen
2019-07-25 21:37 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJw81dZv_e2EFN36tq68GUtUq+MjoLxd40YW15UavDhRO-LzcA@mail.gmail.com \
    --to=plaiceadam@gmail.com \
    --cc=36773@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=pipcet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.