mac-dictionary-kit icon indicating copy to clipboard operation
mac-dictionary-kit copied to clipboard

fix crashing on Catalina

Open shincurry opened this issue 4 years ago • 43 comments

ENV: Xcode 11.3.1 (11C504) Catalina 10.15.3 (19D76)

For unkown reason, [pboard propertyListForType: NSPasteboardTypeFileURL] returns an NSString(NSCFString) directly instead of an NSArray.

it cause DictUnifier can't get correct file url.

shincurry avatar Feb 05 '20 14:02 shincurry

It can not open dict file.

Step 1

brew install glib

Step 2

Run xcode

2020-02-07 1 40 07

MoeClub avatar Feb 07 '20 05:02 MoeClub

you can use it by dragging a dictionary data file.tar.bz2 into the app window.

Menu -> FIle -> Open... not clickable seems to be another bug from original master branch?🤔

shincurry avatar Feb 07 '20 06:02 shincurry

Drag operation is invalid.

It seems to be another bug.

Alternative: You can release the latest compiled version.

MoeClub avatar Feb 07 '20 07:02 MoeClub

2020-02-07 19-39-21 2020-02-07 19_40_39

shincurry avatar Feb 07 '20 12:02 shincurry

there is a chance that the operation will fail, the reason is because this application has two DragAndDrop callbacks, which are located in DUWindow and DUImageView, i just only fix bug in DUWindow, missed in DUImageView.

shincurry avatar Feb 07 '20 12:02 shincurry

need test in previous macOS version

shincurry avatar Feb 07 '20 12:02 shincurry

Well!!! It is work. But Menu -> FIle -> Open... not clickable.

MoeClub avatar Feb 08 '20 03:02 MoeClub

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

daimon99 avatar Feb 09 '20 03:02 daimon99

@daimon99 Hello,My MacBook Pro are Catalina 10.15.3 as yours, and downloaded your release of DictUnifier, the crash problem in drawing file was solved. However, a new error is any tar.bz2 file was failed to convert and the software give up for converting. image

KingofAsianPopJC avatar Feb 12 '20 07:02 KingofAsianPopJC

@KingofAsianPopJC I noticed in use that some dictionary files fail to convert, try other ones http://download.huzheng.org/zh_CN/

maybe we should create another branch pull request to fix this convert-failed problem. current pull request focused on fixing file open crash issue.

shincurry avatar Feb 13 '20 02:02 shincurry

@shincurry Thanks for your reply! I downloaded 8 dictionary from http://download.huzheng.org/zh_CN/, but all of them failed to be converted and all of them were English-Chinese dictionarys. Other dictionaries in this website are not suitable for me in use.

KingofAsianPopJC avatar Feb 13 '20 04:02 KingofAsianPopJC

截屏2020-02-13下午12 21 52

i have converted 4 dictionaries successfully.

@KingofAsianPopJC

shincurry avatar Feb 13 '20 04:02 shincurry

截屏2020-02-13下午12 21 52

i have converted 4 dictionaries successfully.

@KingofAsianPopJC

您好,請問一下是否能提供「计算机词汇 」的文件呢? 本身沒有任何程式編寫經驗,因看了您的文章後成功修復了DictUnifier的bug,謝謝您!

chiaaaa96 avatar Feb 13 '20 05:02 chiaaaa96

@KingofAsianPopJC Try to install glib with this commande brew install glib I got the same problem after installing glib, it works

qfdk avatar Mar 04 '20 12:03 qfdk

Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app.

image

macOS version is 10.15.2.

rainux avatar Mar 11 '20 10:03 rainux

Good job, mate. It is really helpful :)

YichaoXu avatar Mar 24 '20 11:03 YichaoXu

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

that works for me,thanks

JohnnieFucker avatar Mar 27 '20 09:03 JohnnieFucker

@KingofAsianPopJC Try to install glib with this commande brew install glib I got the same problem after installing glib, it works

@qfdk I input "brew install glib" in the terminal, but it says "command not found".

RigelXi avatar Apr 05 '20 10:04 RigelXi

@RigelXi You need to install brew with this command

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then you can use brew command to install glib

qfdk avatar Apr 06 '20 13:04 qfdk

Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app.

image

macOS version is 10.15.2.

I have the same problem with the Merriam-Webster's Collegiate Dictionary in http://download.huzheng.org/bigdict/ Anyone has fix for this "Format not supported" issue?

xiao-zang avatar Apr 24 '20 08:04 xiao-zang

Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app. image macOS version is 10.15.2.

I have the same problem with the Merriam-Webster's Collegiate Dictionary in http://download.huzheng.org/bigdict/ Anyone has fix for this "Format not supported" issue?

朗道英汉词典5.0 works me,but Merriam Webster's Collegiate Dictionaries in "http://download.huzheng.org/bigdict/" and in "http://download.huzheng.org/babylon/english/" both show "Format not supported" error message in dictionary app, as @rainux commented.

xiao-zang avatar Apr 24 '20 09:04 xiao-zang

@xiao-zang I read the codes these days and found that some formats had never been supported by the author. https://github.com/jjgod/mac-dictionary-kit/blob/2b8705d76b53c8a7ea21bc629d9a66d1170cb173/sdconv/convert.cpp#L94-L100

Considering the latest commit was about 2 years ago, I believe this repo is no more maintained. So the answer is: No fix.

ritou11 avatar Apr 24 '20 09:04 ritou11

@xiao-zang I read the codes these days and found that some formats had never been supported by the author.

https://github.com/jjgod/mac-dictionary-kit/blob/2b8705d76b53c8a7ea21bc629d9a66d1170cb173/sdconv/convert.cpp#L94-L100

Considering the latest commit was about 2 years ago, I believe this repo is no more maintained. So the answer is: No fix.

Thank you for the quick comment! @ritou11 It is disappointing though, as I feel Merriam-Webster has the most comprehensive definitions for some words. For example, if you look up "overhang" in https://www.merriam-webster.com/dictionary/overhang, the 4th definition of the noun is not listed in almost any other dictionary.

xiao-zang avatar Apr 24 '20 09:04 xiao-zang

@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that dictconv is the very early version and you could provide the link to your stardict by issues if it doesn't work.

ritou11 avatar Apr 29 '20 13:04 ritou11

@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that dictconv is the very early version and you could provide the link to your stardict by issues if it doesn't work.

@ritou11 Your dictconv converted http://download.huzheng.org/bigdict/stardict-Merriam-Webster_s_Collegiate_11th_Ed-2.4.2.tar.bz2 successfully, but the resulting dictionary looks like this

image

But thank you anyway!

xiao-zang avatar Apr 30 '20 00:04 xiao-zang

依然不行🥺试了三个词典。请问有新的办法了吗?Open files依然无法点按……

Boooom0099 avatar May 05 '20 11:05 Boooom0099

I believe you can fix the crash by replacing NSPasteboardTypeFileURL with NSFilenamesPboardType without other changes.

zcbenz avatar May 06 '20 06:05 zcbenz

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

@daimon99 This one didn't work at first, as it returned "abort" when dragging a stardict into it. The "Open" button was invalid, too.

But after I installed glib using brew install glib, the drag operation works. Though the "Open" button remains invalid.

FSYtiredtodeath avatar May 11 '20 09:05 FSYtiredtodeath

I converted a roughly-8M Oxford English-Chinese dictionary on macOS Catalina 10.15.6 and it cost me about over 12 hours and still not finished, is this normal?

yhshu avatar Jul 19 '20 00:07 yhshu

I converted a roughly-8M Oxford English-Chinese dictionary on macOS Catalina 10.15.6 and it cost me about over 12 hours and still not finished, is this normal?

@lzw429 obviously abnormal.

There are still some bugs in this application that have not been fixed. Currently, only some dictionary files can be converted normally.

shincurry avatar Jul 19 '20 04:07 shincurry

In Catalina (10.15.6), I'm getting this when loading it with a dictionary file[1]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteTask terminationStatus]: task not launched' abort() called terminating with uncaught exception of type NSException

[1] The file stardict-dictd-web1913-2.4.2.tar.bz2 available at https://s3.amazonaws.com/jsomers/dictionary.zip referenced from https://jsomers.net/blog/dictionary

redbar0n avatar Sep 03 '20 18:09 redbar0n

It worked with the build from @daimon99 ! Thanks. I hope that build can make it into the releases section, @jjgod .

redbar0n avatar Sep 03 '20 18:09 redbar0n

Actually.. It always just stopped at "Checking source"...

After running brew install glib (installing glib properly; i.e. completely without errors) then DictUnifier always just stops at Building dictd_www.dict.org_web1913.dictionary. (the latter part is the name of the dictionary).

redbar0n avatar Sep 04 '20 13:09 redbar0n

I was able to use @daimon99's build of DictUnifier to successfully convert/install the following dictionary, like @chiaaaa96 also managed: stardict-cedict-gb-2.4.2.tar.bz2. So it seems like it might be some incompatibilities with certain dictionaries, like stardict-dictd-web1913-2.4.2.tar.bz2 which makes them unable to be built.

This note from a fork of this repo could give a clue as to why some dictionaries won't build: "The source dictionary could be in any format, but we only support stardict format at present. The target dictionary must be Dictionary 2.0 format defined in Mac OS X 10.5.". (I am using Dictionary 2.3.0 (239.5) in MacOS Catalina.)

redbar0n avatar Sep 07 '20 13:09 redbar0n

Was able to install Webster's 1913 dictionary in MacOS Catalina using the precompiled websters-1913.dictionary.zip from https://github.com/ponychicken/WebsterParser. Circumventing the need to use DictUnifier.

For other dictionaries, the build instructions here: https://github.com/ponychicken/WebsterParser and the instructions in this StackExchange answer, might help tech savvy users, for dictionaries where DictUnifier fails to work.

redbar0n avatar Sep 07 '20 13:09 redbar0n

@daimon99 Hello,My MacBook Pro are Catalina 10.15.3 as yours, and downloaded your release of DictUnifier, the crash problem in drawing file was solved. However, a new error is any tar.bz2 file was failed to convert and the software give up for converting. image

hi~, there is a solution about this. open your terminal and install brew, so you can install glib brew install glib just wait for a minute and then you can drop tar.bz2 file to DictUnifier!

lerogo avatar Oct 25 '20 07:10 lerogo

Any upcoming plans for Big Sur support?

bryanmanio avatar Jan 08 '21 00:01 bryanmanio

Any upcoming plans for Big Sur support?

It's working on Big Sur 11.1 with Catalina build version

danielsss avatar Feb 26 '21 19:02 danielsss

Is it crashing on Apple Silicon? I can't use it on my M1 MacBook with Catalina build version

MorCherlf avatar Apr 28 '21 18:04 MorCherlf

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

@daimon99 This one didn't work at first, as it returned "abort" when dragging a stardict into it. The "Open" button was invalid, too.

But after I installed glib using brew install glib, the drag operation works. Though the "Open" button remains invalid.

not work now in Catalia 10.15.5

liangxiwei avatar May 05 '21 08:05 liangxiwei

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

It's working on Big Sur 11.5.1. Make sure glib is installed!

2788 avatar Aug 16 '21 13:08 2788

DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.

my macOS is 11.5, it is works for me when i execute

brew glib

tips:

you may execute

brew update

brew upgrade

first

misternian avatar Aug 29 '21 13:08 misternian

@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that dictconv is the very early version and you could provide the link to your stardict by issues if it doesn't work.

I have tried dictconv and it works for me. thanks

poyv avatar Jan 18 '22 04:01 poyv