Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start on some Linux desktop distributions #9347

Closed
3 tasks done
Reverier-Xu opened this issue Oct 5, 2023 · 25 comments
Closed
3 tasks done

Unable to start on some Linux desktop distributions #9347

Reverier-Xu opened this issue Oct 5, 2023 · 25 comments
Assignees
Labels
Milestone

Comments

@Reverier-Xu
Copy link
Contributor

Reverier-Xu commented Oct 5, 2023

terminated by SIGTRAP in Arch

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

在 Arch 上使用 2.10.8 的 AppImage 版本会直接退出:

$ /opt/appimages/siyuan.AppImage
xdg-mime: application argument missing
Try 'xdg-mime --help' for more information.
bash: Job 1, '/opt/appimages/siyuan.AppImage' terminated by signal SIGTRAP (Trace or breakpoint trap)

2.10.7 版本是正常的。

Expected result

正常运行

Screenshot or screen recording presentation

No response

Version environment

- Version: 2.10.8
- Operating System: Arch Linux

Log file

No new logs after crashing

More information

No response

@88250
Copy link
Member

88250 commented Oct 5, 2023

应该和 Electron 版本有关系,关联 #9342

@88250 88250 closed this as completed Oct 5, 2023
@88250 88250 reopened this Oct 6, 2023
@88250 88250 changed the title terminated by SIGTRAP in Arch Unable to start on some Linux desktop distributions Oct 6, 2023
@88250 88250 added the Bug label Oct 6, 2023
@88250 88250 mentioned this issue Oct 6, 2023
@88250 88250 self-assigned this Oct 6, 2023
@88250 88250 added this to the backlog milestone Oct 6, 2023
@88250
Copy link
Member

88250 commented Oct 6, 2023

@88250 88250 pinned this issue Oct 7, 2023
@88250

This comment was marked as outdated.

@88250 88250 closed this as completed Oct 8, 2023
@88250 88250 unpinned this issue Oct 8, 2023
@88250 88250 modified the milestones: backlog, 2.10.9 Oct 8, 2023
@88250
Copy link
Member

88250 commented Oct 9, 2023

最后定位到是 main.js 中电源处理代码的问题,Linux 端升级 Electron 26 以后电源相关事件必须放在 whenReady 里面,否则会导致 Trace/breakpoint trap (core dumped)

@ProgramFan
Copy link

仍然有问题:现在能启动了,闪屏结束后进入上一次的笔记的编辑界面,5秒以后白屏,终端输出如下:

./siyuan
got kernel port [33813]
ui version [2.10.8], booting kernel [/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/kernel/SiYuan-Kernel --port 33813 --wd /home/zyang/.local/opt/siyuan-2.10.8-linux/resources]
booted kernel process [pid=5754, port=33813]
checking kernel version
got kernel version [2.10.8]
network proxy [system]
[5736:1009/220525.967009:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[5736:1009/220529.870255:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
[5736:1009/220535.409612:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

@88250
Copy link
Member

88250 commented Oct 9, 2023

@ProgramFan 你那里使用了插件吗?

@ProgramFan
Copy link

有插件

@88250
Copy link
Member

88250 commented Oct 9, 2023

请帮忙测试一下在没有插件的新工作空间能否重现问题。

@ProgramFan
Copy link

got kernel port [33543]
ui version [2.10.8], booting kernel [/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/kernel/SiYuan-Kernel --port 33543 --wd /home/zyang/.local/opt/siyuan-2.10.8-linux/resources]
booted kernel process [pid=10068, port=33543]
checking kernel version
get kernel version failed: net::ERR_CONNECTION_REFUSED
got kernel version [2.10.8]
network proxy [system]
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
[10051:1009/221851.801555:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:705:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
[10051:1009/221858.548445:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!

@ProgramFan
Copy link

一样的情况,也是闪屏过后2秒就白屏了

@ProgramFan
Copy link

测试了全新工作空间,删除原工作空间等情形,结果和上面都一样,时间长度不一样。

@88250
Copy link
Member

88250 commented Oct 9, 2023

我这里用 Ubuntu 22 虚拟机测试正常,感觉可能是这个问题 electron/electron#32760

@ProgramFan
Copy link

我在 Wayland 和 X11 两种情况下测试,结果都一样。主要错误在于:

Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:705:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:705:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:705:26)
    at BrowserWindow.emit (node:events:525:35)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at WebFrameMain.send (node:electron/js2c/browser_init:2:94576)
    at WebContents.send (node:electron/js2c/browser_init:2:79721)
    at BrowserWindow.<anonymous> (/home/zyang/.local/opt/siyuan-2.10.8-linux/resources/app/electron/main.js:708:26)
    at BrowserWindow.emit (node:events:525:35)

@ProgramFan
Copy link

ChatGPT 的看法:

The error message "Error sending from webFrameMain: Error: Render frame was disposed before WebFrameMain could be accessed" indicates a timing or state issue within an Electron application. Here's a breakdown of what each part means:

Error sending from webFrameMain: The error is occurring when trying to send a message from the main process to the renderer process via Electron's WebFrameMain API.

Render frame was disposed before WebFrameMain could be accessed: This is the core issue. It suggests that the renderer frame (essentially, a web page within your Electron application) has been closed, navigated away from, or otherwise disposed of before the main process could perform an operation on it via WebFrameMain.

The following lines provide a stack trace, indicating where in the code the issue occurred.

Here are some common reasons why this could happen:

Navigating Away: If the web page in the renderer process is navigated away from or refreshed, the frame would be disposed of.

Closing or Reloading the Window: If the Electron BrowserWindow is closed or reloaded, the render frame will be disposed of.

Race Condition: Your code might be running asynchronously, and you're trying to perform an operation on the render frame after it's already been disposed of but before your code is aware of that.

Debugging Steps
Check Object Lifecycles: Make sure you're not accidentally disposing of the render frame by closing a window, navigating away, or refreshing the page.

Review Asynchronous Code: If you're making asynchronous calls, use appropriate checks or hooks to ensure that the frame still exists when your code runs.

Error Handling: Incorporate try-catch blocks or promise-based error handling to catch such exceptions and handle them gracefully.

Event Listening: Listen for events like 'closed' on the BrowserWindow object or other events that indicate a change in frame status, and prevent or queue up actions accordingly.

Check API Documentation: Ensure that you are using Electron's WebFrameMain and other related APIs correctly.

This should give you a good starting point for debugging the issue.

@ProgramFan
Copy link

目前 2.10.7 一切正常,我有办法能测试一下其他版本的 Electron 吗?

@88250
Copy link
Member

88250 commented Oct 9, 2023

目前 main.js 改动有点多,我们现在再编译一个 dev 版看看。

要测试其他版本只能手动编译打包,scripts/linux-build.sh

@88250
Copy link
Member

88250 commented Oct 9, 2023

@ProgramFan
Copy link

错误依旧,无变化。

@88250
Copy link
Member

88250 commented Oct 9, 2023

稍等我们降级一下 Electron 再测测看。

@88250
Copy link
Member

88250 commented Oct 9, 2023

@ProgramFan
Copy link

新版本工作正常。

@88250
Copy link
Member

88250 commented Oct 9, 2023 via email

@88250
Copy link
Member

88250 commented Nov 21, 2023

下个版本我们计划升级到 Electron v27.1.0,可能还会导致这个问题,麻烦看到的老铁帮忙测试。

如果有问题,请到 #9705 中反馈,谢谢。

@ProgramFan
Copy link

发布可用版本后第一时间测试。

@ProgramFan
Copy link

27.1.0 正常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants