From: Pip Cet <pipcet@gmail.com>
To: Adam Plaice <plaiceadam@gmail.com>
Cc: 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 12:05:10 +0000 [thread overview]
Message-ID: <CAOqdjBcwfcZNkHG+W6+=-eMVCC7+EH2QDJPh1Ec793UrtOvC3w@mail.gmail.com> (raw)
In-Reply-To: <CAJw81dZv_e2EFN36tq68GUtUq+MjoLxd40YW15UavDhRO-LzcA@mail.gmail.com>
On Wed, Jul 24, 2019 at 10:13 PM Adam Plaice <plaiceadam@gmail.com> wrote:
> > 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).
Thank you for testing.
> > - (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.
Agreed. As I said, I think it's best to remove the content-encoding
header when interpreting it.
> > 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.
That's my understanding as well.
> 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.
I don't think "allow-partial" properly expresses the "and delete the
specified region unconditionally" semantics we now have. It might make
more sense to replace the region only if at least one byte of data was
successfully decompressed.
next prev parent reply other threads:[~2019-07-25 12:05 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
2019-07-25 12:05 ` Pip Cet [this message]
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='CAOqdjBcwfcZNkHG+W6+=-eMVCC7+EH2QDJPh1Ec793UrtOvC3w@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=36773@debbugs.gnu.org \
--cc=plaiceadam@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.