vedang / pdf-tools

Emacs support library for PDF files.
https://pdftools.wiki
GNU General Public License v3.0
641 stars 90 forks source link

[MacOS Ventura] Crashes Emacs upon an attempt to select text #173

Closed simurgh9 closed 1 year ago

simurgh9 commented 1 year ago

When you try and select text using mouse, Emacs crashes and shuts down. Click here to see a demo on Youtube of another user having the same issue.

I am running GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-11-29 installed by brew install emacs-nightly with MacOS Ventura (Version 13.0.1) on Macbook Air M2.

vedang commented 1 year ago

Copying my comment from the Youtube video here:

Hi @ Artawower @ NFVblog! I'm the maintainer of pdf-tools and I discovered this video via https://github.com/vedang/pdf-tools/issues/173

Can you please head over there and share the backtrace with me? I am not on MacOS Ventura or Emacs 30 (as reported in the issue) and am not able to reproduce this issue. If you can help me with the following (on the github issue) that would be great:

  1. Your OS and Emacs versions
  2. Your pdf-tools version (M-x package-list-packages, search for pdf-tools and hit enter on the entry. You will get all the details of the package)
  3. The backtrace thrown when Emacs crashes
  4. The command you use to compile from tex to pdf.

@simurgh9 : If you can also share the same details with me that would be great

Artawower commented 1 year ago
  1. GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin22.1.0, NS appkit-2299.00 Version 13.0.1 (Build 22A400)) of 2022-11-15
  2. pdf-tools 20221202.1104
  3. Error report: https://codeshare.io/6pQEDm
  4. Where could i find this command?
simurgh9 commented 1 year ago

pdf-tools is at 20221202.1104. The backtrace looks pretty much the same as artawower's. This happens even with pdfs that are not generated via tex. But here is the one I used for a document that too crashed emacs pdflatex -file-line-error -interaction=nonstopmode article.tex.

There is also a post about this on reddit.

vedang commented 1 year ago

From the post on reddit, it looks like a problem in the latest poppler on the latest Mac OS. I tested Poppler version 22.12.0 on Ubuntu and Mac OS (version 12.6) and it works fine. So my guess is that it is a problem on Mac OS Ventura (version 13.x).

Unfortunately, there isn't anything that I can do about this since I cannot personally test on Ventura. I will wait for someone on Ventura to debug this further.

simurgh9 commented 1 year ago

If you leave some instructions on how to debug this further, I might get to it at some point if no one else ever does.

orgtre commented 1 year ago

Is this not the same issue as #166?

d8660091 commented 1 year ago

I encountered the same issue on my M2. I thought it was some Apple Silicon issue. But after I enabled pdf-view-dark-minor-mode, the issue is gone. Thanks for the info! @orgtre

simurgh9 commented 1 year ago

@orgtre indeed. As a temporary work around, add the following to your configs.

(add-hook 'pdf-tools-enabled-hook 'pdf-view-dark-minor-mode)

I'll close this here due to duplicity. Please visit #166.

Pepito-source commented 1 year ago

I had the same issue on my M1 MacBook Pro running MacOS Ventura 13.2.1. with GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2023-02-22. Thanks for the work around simurgh9 !