vedang / pdf-tools

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

epdfinfo server repeatedly quitting on macos ventura poppler v 23.03.0 #210

Closed vxe closed 7 months ago

vxe commented 1 year ago

Describe the bug Upon installation of the pdf-tools package on my intel macOS ventura, when I try to open a PDF file, the message "epdfinfo server quit, restart it (y/n)?". If I say "yes", I get the same result time and time again.

Steps to Reproduce the behaviour Steps to reproduce the behaviour:

What is the expected behaviour? epdfinfo should not crash when started

Desktop Please complete the following information:

Your pdf-tools install Please complete the following information:

vxe commented 1 year ago
wget "https://poppler.freedesktop.org/poppler-22.09.0.tar.xz"
tar xvf poppler-22.09.0.tar.xz      
cd poppler-22.09.0  
mkdir build
cmake .. -DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_DCTDECODER=unmaintained    
# do below you don't have GNU sed as default edit `CMakeCache.txt` to point to `gsed`
emacs -nw  CMakeCache.txt 
make && make install

(pdf-tools-install)

haji-ali commented 1 year ago

I am also experiencing the same issue on poppler 23.04.0 Not sure why epdfinfo server is quitting.

vedang commented 1 year ago

I am extremely busy at work until the end of this month, and won't be able to look into this problem. I would appreciate it immensely if someone else has the time to debug this issue.

Thank you @vxe for providing the workaround steps.

tongjie-chen commented 1 year ago

I think we should fix on the version of poppler to reduce this kind of compatibility issue.

milanglacier commented 1 year ago

I once have the issue that emacs fails to compile the epdfinfo program after upgrading to macos13.

Here's what I did to solve the problem:

  1. reinstall emacs
  2. xcode-select --install: that is, reinstall the xcode command line tools.
  3. recompile the epdfinfo, and success.

Besides, I am using popper 23.04 from homebrew

Enrico68 commented 1 year ago

I was doing with the recipe of @milanglacier with no success and compilation of poppler22.09 ended with errors:

/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.h:58:7: error: redefinition of 'DCTStream'
class DCTStream : public FilterStream
      ^
/Users/enricopirani/poppler-22.09.0/poppler/Stream.h:1049:7: note: previous definition is here
class DCTStream : public FilterStream
      ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:66:9: error: use of undeclared identifier 'err'
        err.width = (obj.isInt() && obj.getInt() <= JPEG_MAX_DIMENSION) ? obj.getInt() : 0;
        ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:68:9: error: use of undeclared identifier 'err'
        err.height = (obj.isInt() && obj.getInt() <= JPEG_MAX_DIMENSION) ? obj.getInt() : 0;
        ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:70:9: error: use of undeclared identifier 'err'
        err.height = err.width = 0;
        ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:70:22: error: use of undeclared identifier 'err'
        err.height = err.width = 0;
                     ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:72:5: error: use of undeclared identifier 'init'
    init();
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:77:30: error: use of undeclared identifier 'cinfo'
    jpeg_destroy_decompress(&cinfo);
                             ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:93:17: error: out-of-line definition of 'init' does not match any declaration in 'DCTStream'
void DCTStream::init()
                ^~~~
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:95:21: error: use of undeclared identifier 'err'
    jpeg_std_error(&err.pub);
                    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:96:5: error: use of undeclared identifier 'err'
    err.pub.error_exit = &exitErrorHandler;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:97:5: error: use of undeclared identifier 'src'
    src.pub.init_source = str_init_source;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:98:5: error: use of undeclared identifier 'src'
    src.pub.fill_input_buffer = str_fill_input_buffer;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:99:5: error: use of undeclared identifier 'src'
    src.pub.skip_input_data = str_skip_input_data;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:100:5: error: use of undeclared identifier 'src'
    src.pub.resync_to_restart = jpeg_resync_to_restart;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:101:5: error: use of undeclared identifier 'src'
    src.pub.term_source = str_term_source;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:102:5: error: use of undeclared identifier 'src'
    src.pub.bytes_in_buffer = 0;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:103:5: error: use of undeclared identifier 'src'
    src.pub.next_input_byte = nullptr;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:104:5: error: use of undeclared identifier 'src'
    src.str = str;
    ^
/Users/enricopirani/poppler-22.09.0/poppler/DCTStream.cc:105:5: error: use of undeclared identifier 'src'
    src.index = 0;
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/poppler.dir/poppler/DCTStream.cc.o] Error 1
make[1]: *** [CMakeFiles/poppler.dir/all] Error 2
make: *** [all] Error 2
hugorichard commented 1 year ago

I have the same error

vedang commented 7 months ago

Please upgrade your System + libraries to the versions mentioned in https://github.com/vedang/pdf-tools/issues/269 . After that, please update to the latest version of pdf-tools from Melpa (check a few hours after this comment's timestamp) and try installing again.