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

🐞 反馈问题:v1.3.2 无法运行 #124

Closed
3 of 4 tasks
0x2E opened this issue Jun 12, 2023 · 25 comments
Closed
3 of 4 tasks

🐞 反馈问题:v1.3.2 无法运行 #124

0x2E opened this issue Jun 12, 2023 · 25 comments
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available

Comments

@0x2E
Copy link

0x2E commented Jun 12, 2023

请先确认以下事项:

  • 已仔细阅读了 README
  • issues 页面搜索过问题(包括已关闭的 issue),但未能找到解决方法
  • Easydict 已升级到最新版本

问题描述

Hi,感谢开发这个好用的 App。

v1.3.2 无法运行,删除配置文件+重装+重启系统也不行。终端里看了下似乎是因为缺少 AppCenter 的密钥?

~ /Applications/Easydict.app/Contents/MacOS/Easydict
2023-06-12 14:34:20.195 Easydict[1539:13687] arguments: (
    "/Applications/Easydict.app/Contents/MacOS/Easydict"
)
2023-06-12 14:34:20.195 Easydict[1539:13687] queryText: (null)
2023-06-12 14:34:20.196 Easydict[1539:13687] detectText: (null)
2023-06-12 14:34:20.341 Easydict[1539:13707] [AppCenter] ERROR: -[MSACAppCenter startService:withAppSecret:transmissionTargetToken:fromApplication:]/457 Cannot start service MSACCrashes. App Center was started without app secret, but the service requires it.
[1]    1539 killed     /Applications/Easydict.app/Contents/MacOS/Easydict

重现步骤

启动 App

期望结果

正常运行

解决方案(可选)

No response

设备信息 && 操作系统版本(可选)

Macbook Air M1, macOS 13.4

是否愿意提交 PR 解决该问题?

  • 我愿意提交 PR!
@0x2E 0x2E added the bug Something isn't working label Jun 12, 2023
@github-actions
Copy link

Hello 0x2E, Thank you for your first issue contribution 🎉

@bihell
Copy link

bihell commented Jun 12, 2023

没错,我今天更新以后也无法运行了

@tisfeng tisfeng added the fixed in next release The issue will be closed once next release is available label Jun 12, 2023
@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

感谢反馈,我的锅,有个地方代码写错了,但开发环境没有报错导致没测出来 😭

晚上会重新发一个修复版本。

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

奇怪,我直接下载 1.3.2 版本,在我电脑上运行测试,虽然 debug 会报错有这个问题,但程序并没有崩溃,似乎也并不影响运行 🤔

你们的无法运行,是指程序启动就会崩溃吗?

麻烦导出日志给我看一下,帮助 --> 导出日志。

如果无法打开应用,可以直接进入下面目录,压缩 MMLogs 文件给我。

~/Library/Caches/com.izual.Easydict/MMLogs

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

MMLogs/Default :

[2023-06-12 19:54:22.048 ● MMLog ● 75 ● I] +[MMManagerForLog sharedDDLog]_block_invoke ●
=========>
🚀 com.izual.Easydict(1.3.2)[17] 启动 MMLog(Defalut)...

日志文件夹:
/Users/rook1e/Library/Caches/com.izual.Easydict/MMLogs/Default
<=========
[2023-06-12 19:54:22.048 ● AppDelegate ● 24 ● I] -[AppDelegate applicationDidFinishLaunching:] ● 程序启动

MMLogs/Crash :

Signal Exception:
Signal SIGSEGV was raised.
Call Stack:
1   libsystem_platform.dylib            0x00000001903a6a24 _sigtramp + 56
2   ???                                 0xffff80019042ff7c 0x0 + 18446603342936473468
3   CoreFoundation                      0x000000019042ff7c CFMachPortCreateRunLoopSource + 60
4   Easydict                            0x0000000100c05564 Easydict + 333156
5   Easydict                            0x0000000100c05400 Easydict + 332800
6   Easydict                            0x0000000100bc7750 Easydict + 79696
7   Easydict                            0x0000000100bc76a0 Easydict + 79520
8   Easydict                            0x0000000100bc758c Easydict + 79244
9   libdispatch.dylib                   0x00000001901c8400 _dispatch_client_callout + 20
10  libdispatch.dylib                   0x00000001901c9c40 _dispatch_once_callout + 32
11  Easydict                            0x0000000100bc7578 Easydict + 79224
12  Easydict                            0x0000000100bedf1c Easydict + 237340
13  Easydict                            0x0000000100c32cf8 Easydict + 519416
14  CoreFoundation                      0x000000019044b180 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
15  CoreFoundation                      0x00000001904e6eec ___CFXRegistrationPost_block_invoke + 88
16  CoreFoundation                      0x00000001904e6e34 _CFXRegistrationPost + 440
17  CoreFoundation                      0x000000019041c4cc _CFXNotificationPost + 704
18  Foundation                          0x000000019137a8f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
19  AppKit                              0x000000019367d158 -[NSApplication _postDidFinishNotification] + 284
20  AppKit                              0x000000019367cf08 -[NSApplication _sendFinishLaunchingNotification] + 172
21  AppKit                              0x000000019367afa4 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 504
22  AppKit                              0x000000019367aba0 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 492
23  Foundation                          0x00000001913a4b64 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 316
24  Foundation                          0x00000001913a49c4 _NSAppleEventManagerGenericHandler + 80
25  AE                                  0x000000019677d518 _AppleEventsCheckInAppWithBlock + 14724
26  AE                                  0x000000019677ce44 _AppleEventsCheckInAppWithBlock + 12976
27  AE                                  0x0000000196775f18 aeProcessAppleEvent + 488
28  HIToolbox                           0x0000000199caeb44 AEProcessAppleEvent + 68
29  AppKit                              0x0000000193676048 _DPSNextEvent + 1408
30  AppKit                              0x0000000193674ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
31  AppKit                              0x0000000193669344 -[NSApplication run] + 464
32  AppKit                              0x0000000193640794 NSApplicationMain + 880
33  dyld                                0x000000019001ff28 start + 2236
threadInfo:
<_NSMainThread: 0x600003490080>{number = 1, name = main}%

@Boblee93
Copy link

可能是不兼容苹果芯片,我的英特尔芯片运行正常,苹果芯片不能运转

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

这没道理,我自己的电脑就苹果芯片,编译环境应该没问题 😔

看上面日志,确实发生了崩溃,但很诡异,看不出具体是哪行代码导致的, @bihell @Boblee93 能麻烦提供一下崩溃日志吗

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

打包了个新版本,你们试一下,如果没问题,等会我就发布。

Easydict.zip

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

跟之前的状态一样,还是运行不了。

2023-06-12 22:08:16.277 Easydict[13887:261832] arguments: (
    "./Easydict"
)
2023-06-12 22:08:16.278 Easydict[13887:261832] queryText: (null)
2023-06-12 22:08:16.278 Easydict[13887:261832] detectText: (null)
2023-06-12 22:08:16.458 Easydict[13887:261862] [AppCenterCrashes] WARNING: +[MSACErrorLogFormatter formatStackFrame:report:]/576 Cannot find image for 0x19001ff28
2023-06-12 22:08:16.473 Easydict[13887:261834] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: 566A6D6C-B14A-4A12-A6C4-4CA80FCA74CD
2023-06-12 22:08:16.473 Easydict[13887:261834] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: last_saved_wrapper_exception
[1]    13887 killed     ./Easydict
Signal Exception:
Signal SIGSEGV was raised.
Call Stack:
1   libsystem_platform.dylib            0x00000001903a6a24 _sigtramp + 56
2   CoreFoundation                      0x000000019042ff7c CFMachPortCreateRunLoopSource + 60
3   CoreFoundation                      0x000000019042ff7c CFMachPortCreateRunLoopSource + 60
4   Easydict                            0x0000000102079578 Easydict + 333176
5   Easydict                            0x0000000102079414 Easydict + 332820
6   Easydict                            0x000000010203b764 Easydict + 79716
7   Easydict                            0x000000010203b6b4 Easydict + 79540
8   Easydict                            0x000000010203b5a0 Easydict + 79264
9   libdispatch.dylib                   0x00000001901c8400 _dispatch_client_callout + 20
10  libdispatch.dylib                   0x00000001901c9c40 _dispatch_once_callout + 32
11  Easydict                            0x000000010203b58c Easydict + 79244
12  Easydict                            0x0000000102061f30 Easydict + 237360
13  Easydict                            0x00000001020a6cd8 Easydict + 519384
14  CoreFoundation                      0x000000019044b180 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
15  CoreFoundation                      0x00000001904e6eec ___CFXRegistrationPost_block_invoke + 88
16  CoreFoundation                      0x00000001904e6e34 _CFXRegistrationPost + 440
17  CoreFoundation                      0x000000019041c4cc _CFXNotificationPost + 704
18  Foundation                          0x000000019137a8f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
19  AppKit                              0x000000019367d158 -[NSApplication _postDidFinishNotification] + 284
20  AppKit                              0x000000019367cf08 -[NSApplication _sendFinishLaunchingNotification] + 172
21  AppKit                              0x000000019367afa4 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 504
22  AppKit                              0x000000019367aba0 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 492
23  Foundation                          0x00000001913a4b64 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 316
24  Foundation                          0x00000001913a49c4 _NSAppleEventManagerGenericHandler + 80
25  AE                                  0x000000019677d518 _AppleEventsCheckInAppWithBlock + 14724
26  AE                                  0x000000019677ce44 _AppleEventsCheckInAppWithBlock + 12976
27  AE                                  0x0000000196775f18 aeProcessAppleEvent + 488
28  HIToolbox                           0x0000000199caeb44 AEProcessAppleEvent + 68
29  AppKit                              0x0000000193676048 _DPSNextEvent + 1408
30  AppKit                              0x0000000193674ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
31  AppKit                              0x0000000193669344 -[NSApplication run] + 464
32  AppKit                              0x0000000193640794 NSApplicationMain + 880
33  dyld                                0x000000019001ff28 start + 2236
threadInfo:
<_NSMainThread: 0x60000317c1c0>{number = 1, name = main}%

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

@0x2E 是启动就崩溃吗?

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

@Jerry23011 麻烦你测一下这个问题

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

是启动就崩溃吗?

是的,1.3.2 和新打包的这个都是启动 App 没任何反应,不显示界面、Dock、菜单栏图标,也没有弹窗,终端里看才发现是崩溃了。

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

@0x2E 你试过删除 1.3.2 版本,再运行我刚打包的新版本吗? 可能 1.3.2 引入了脏数据

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

我是 brew uninstall --zap --force easydict 卸载和删掉相关文件,重启系统,再次安装新打包版本,仍然崩溃。是还有什么脏数据遗漏了吗?

@tisfeng
Copy link
Owner

tisfeng commented Jun 12, 2023

我对 brew 的删除机制不太了解,但按理来说这样删除应该没什么问题了。对了,你的系统版本版本是多少,是升到 macOS 14 了吗?

难搞,我这边复现不出来,运行一直是正常的 。。 麻烦你参照 开发者构建 用 Xcode 直接运行最新代码,看一下具体的崩溃日志。

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

系统版本 macOS 13.4。我明天安装跑一下代码

@0x2E
Copy link
Author

0x2E commented Jun 12, 2023

洗个漱发现 Xcode 装完了,跑了一下 93a2203

直接调试会卡在 Easydict/Feature/EventMonitor/EZEventMonitor.m 102 行:

xcode debug

ChatGPT 说可能是因为 CGEventTapCreate() 返回的 eventTap 是空指针。加了判空就没问题了:

if (!eventTap) {
    NSLog(@"Failed to create event tap!");
    return;
}

然后发现在系统设置「隐私与安全性/输入监控」里把应用的权限关掉,eventTap 就会是空。所以我猜之前崩溃是因为第一次安装时没给足权限吧。不懂为什么卸载应用删除相关文件了系统还保留这里的权限设置。

不会 macOS 开发,瞎猜的。以上言论由 ChatGPT 负责 😁

@Jerry23011
Copy link
Collaborator

麻烦你测一下这个问题

好的,正在试

我对 brew 的删除机制不太了解

brew 是需要包维护者手动添加删除目录的,在这里

@tisfeng
Copy link
Owner

tisfeng commented Jun 13, 2023

@0x2E 确实可能和 CGEventTapCreate 有关,如果未获得 Accessibility 权限,这个值为空是会导致崩溃。

但如果用户之前已经获得了 Accessibility,这个代码应该是没问题的。 你在升级到 1.3.2 之前,一直没有使用鼠标自动取词,没有授权 Accessibility 吗?

@0x2E
Copy link
Author

0x2E commented Jun 13, 2023

你在升级到 1.3.2 之前,一直没有使用鼠标自动取词,没有授权 Accessibility 吗?

是的,我一直只用输入翻译,所以其他权限都没给

@tisfeng
Copy link
Owner

tisfeng commented Jun 13, 2023

明白了,确实有这种场景,没考虑到,稍后我改进一下代码。

@Jerry23011
Copy link
Collaborator

我这边和@0x2E 结果一样
截屏2023-06-13 18 53 12

@tisfeng
Copy link
Owner

tisfeng commented Jun 13, 2023

OK,今晚就发个新版本。

@tisfeng
Copy link
Owner

tisfeng commented Jun 13, 2023

1.3.4 版本 已发布,修复了没有 Accessibility 权限会导致应用启动崩溃问题。

@0x2E
Copy link
Author

0x2E commented Jun 13, 2023

我这没问题了

@tisfeng tisfeng closed this as completed Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available
Projects
None yet
Development

No branches or pull requests

5 participants