ahrm / sioyek

Sioyek is a PDF viewer with a focus on textbooks and research papers
https://sioyek.info/
GNU General Public License v3.0
7.09k stars 235 forks source link

Sioyek under development branch, crashs when opening some PDF. #983

Closed jinjiaodawang closed 8 months ago

jinjiaodawang commented 8 months ago

I understand the development branch is not complete, but I am posting this to ensure the owner is aware of it.

Sioyek version: development branch, 6903701

OS: macOS 14.4

I am experiencing random crashes when opening approximately 10% of PDF files. These files do not contain any bookmarks or highlights and were freshly downloaded from websites. One of these links is attached: https://arxiv.org/pdf/2110.09361.pdf Corrected steps to reproduce the issue are updated in the following comments.

I will investigate this issue further. I am curious if the issue also occurs on Windows or Linux. Also, if anyone has any discoveries, please let me know.

jinjiaodawang commented 8 months ago

Also, here's the output when I run Sioyek from the terminal. There is no crash report if I run it from the Dock

log ``` WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'uvs' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'uvs' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'uvs' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'uvs' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: Output of vertex shader 'screen_pos' not read by fragment shader WARNING: 0:2: extension 'GL_OES_standard_derivatives' is not supported [1] 5487 segmentation fault ./sioyek ```
ahrm commented 8 months ago

I am not able to reproduce the issue on windows. Does this happen immediately upon opening the file? Also how do you open the file? Can you share your prefs_user.config?

ahrm commented 8 months ago

Also can't reproduce on MacOS.

jinjiaodawang commented 8 months ago

I am not able to reproduce the issue on windows. Does this happen immediately upon opening the file? Also how do you open the file? Can you share your prefs_user.config?

That's strange then... I checked again, on main/development version, that development version indeed crashes. My config file attached.

my config file ``` check_for_updates_on_startup 0 background_color 0.0 0.0 0.0 fit_to_page_width_ratio 0.6 search_url_s https://www.semanticscholar.org/search?q= search_url_g https://scholar.google.com/scholar?q= search_url_k https://google.com/search?q= search_url_c https://www.connectedpapers.com/search?q= search_url_d https://dblp.org/search?q= new_command _download_paper python3 -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}" "%{selected_text}" [Your Email, If Using Unpaywall] new_command _dual_panelify python3 -m sioyek.dual_panelify "%{sioyek_path}" "%{file_path}" "%{command_text}" new_command _embed_annotations python3 -m sioyek.embed_annotations "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "fitz" new_command _extract_highlights python3 -m sioyek.extract_highlights "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%1" %{zoom_level} new_command _translate_selected_text python3 -m sioyek.translate "%{sioyek_path}" "%{selected_text}" new_command _translate_current_line_text python3 -m sioyek.translate "%{sioyek_path}" "%{line_text}" new_command _import_annotations python3 -m sioyek.import_annotations "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" new_command _remove_annotations python3 -m sioyek.remove_annotation "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" new_command _add_text python3 -m sioyek.add_text "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" "%{command_text}" new_command _add_red_text python3 -m sioyek.add_text "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" "%{command_text}" fontsize=5 text_color=255,0,0 # shift_click_command _download_paper horizontal_move_amount 0.0 status_bar_format %{current_page} / %{num_pages}%{chapter_name}%{search_results}%{search_progress}%{link_status}%{waiting_for_symbol}%{indexing}%{preview_index}%{synctex}%{drag}%{presentation}%{visual_scroll}%{locked_scroll}%{closest_bookmark}%{close_portal}%{rect_select}%{custom_message} search_highlight_color 1.0 0.0 0.0 should_highlight_unselected_search 1 unselected_search_highlight_color 1.0 1.0 0.0 synctex_highlight_color 1.0 0.0 1.0 inverse_search_command nvim --headless -c "VimtexInverseSearch %2 '%1'" background_color #303446 text_highlight_color #e5c890 visual_mark_color #838ba7 search_highlight_color #e5c890 link_highlight_color #8caaee synctex_highlight_color #a6d189 highlight_color_a #e5c890 highlight_color_b #a6d189 highlight_color_c #99d1db highlight_color_d #ea999c highlight_color_e #ca9ee6 highlight_color_f #e78284 highlight_color_g #e5c890 custom_background_color #303446 custom_text_color #c6d0f5 ui_text_color #c6d0f5 ui_background_color #414559 ui_selected_text_color #c6d0f5 ui_selected_background_color #626880 startup_commands toggle_custom_color incremental_search 1 ui_font "MesloLGS NF" ```
ahrm commented 8 months ago

Does macos produce a trace log for the crash?

jinjiaodawang commented 8 months ago

Sorry, maybe this is the correct way to reproduce the issue.

  1. Backup you Sioyek data. I assume you are using macOS:
    cd ~/Library/Application\ Support/
    cp -r  sioyek sioyek_copy
  2. Download pdf https://arxiv.org/pdf/2110.09361.pdf
  3. Import .db files here. I remove deplicate records to find a minimal one to reproduce the issue. Archive.zip
  4. Reopen the pdf by Sioyek, development version. You may find the development version crashes but main branch version does not.
ahrm commented 8 months ago

Thanks, I was able to reproduce the issue on windows. How did you create these highlights? The issue is that the UUID of these highlights is NULL which should not be possible.

jinjiaodawang commented 8 months ago

Yes, I created the highlight using main branch version of Sioyek.

ahrm commented 8 months ago

The main branch and development branch are incompatible. We do migrate main branch's database when opened using the development branch but once the database is it can't be used with the main branch anymore (not in the sense that it is impossible to use with the main branch but in the sense that it might cause crashes like this).

jinjiaodawang commented 8 months ago

Understood. However, it seems this might become problematic when you release the development version in the future. Thank you for your time.

ahrm commented 8 months ago

My expectation is that people will migrate to the new version and will not be using the old version anymore. Unfortunately there is no way to prevent the old version of sioyek from messing with new database files.

gennaro-tedesco commented 6 months ago

I am experiencing the same WARNING stacktrace shown in the original comments. I have installed sioyek using brew install --cask sioyek on a macOS 12.7.4 Monterey. I understand from this thread that the installed branch may not be the one that is actively being developed (and bug-fixed).

Could you advice on the preferred installation method and whether the brew formula is out of date?