Bug 4460 - Unable to build installer for Windows because syntax error in `packages.current', line 13
Summary: Unable to build installer for Windows because syntax error in `packages.curre...
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (Windows)
Classification: Unclassified
Component: default (show other bugs)
Version: 3.18.0
Hardware: PC Windows 10
: P3 minor
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2021-03-14 18:52 UTC by Ivailo Andonov
Modified: 2021-07-12 15:47 UTC (History)
1 user (show)

See Also:


Attachments
Related to the comment from 16 March (135.00 KB, image/jpeg)
2021-03-17 11:50 UTC, Ivailo Andonov
Details

Description Ivailo Andonov 2021-03-14 18:52:06 UTC
I have followed the instructions from here https://www.claws-mail.org/git.php
Downloaded the source code for the installer and start doing what is written in README.
Running the download.sh produces an error:
syntax error in `packages.current', line 13

I see that this is an empty line. When I delete it. The error happens on the next empty line and so on.

I'm using:
$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

Which cames with the latest git for Windows.

I want to build Claws mail myself because I'm searching for issues in Aspell dictionary loading and want to print some more debug information.
Moreover I experience crash every time I click Subject title (and basically claws-mail try to sort the mail by Subject) So I want to debug that too. Once clicked I'm not able to see messages anymore because once clicked on the INBOX it crashes again immediately since the sortation is remembered.
So I have to delete the whole folder from the drive, start claws-mail, open the empty INBOX, click sort by Date, close it, return back the folder and start again the claws-mail.
Unfortunately this happens often when try to click on the newest message and the mouse accidentally clicked on the header.

I'm sorry about the long explanation but I worked on this two times by 5-6 hours and gathered much information.

Best Regards
Ivo
Comment 1 Thorsten Maerz 2021-03-15 14:20:03 UTC
About the syntax error:
It comes from the files being checked out with the wrong lineendings (should be LF, not CRLF). I am not sure, if it can be built directly on Windows - maybe it works from within a cygwin environment.
It is meant to be crosscompiled from a GNU/Linux system. Preferably Debian Buster (currently requires MinGW-gcc 8, not above).

About the crash, when clicking on "subject" header:
Doesn't happen here. Are you using the current version (3.17.8-1) from https://www.claws-mail.org/win32?

About the spellchecker:
The windows port comes with hunspell as enchant backend. Not with aspell.
Comment 2 Ivailo Andonov 2021-03-15 18:19:34 UTC
Hi Thorsten,
Thank you for the explanations!
Here I've found interesting article for configuring the line endings by creating a file .gitattributes file in the repository. Probably some day developers can commit such. Anyway you are right! Another errors appeared and I'll try to compile  on Ubuntu 20 (the only Linux I have).

About the crash it happened with 3.17.4 and happens too with the latest 3.17.8 (there is no -1 in the version. Downloaded yesterday.)
The only usefull message in the debug log is:
summaryview.c:3096:Sorting summary...
GLib: critical: g_convert: assertion 'str != NULL' failed

If there is way (I didn't find such) to run the debug in verbose mode - please let me know!

About the spellchecker:
In version 3.17.4 there was an error in the German dictionary - in the beginning of the .dic file the '#' before the comments were missing. This is fixed in 3.17.8 and the folder is changed - instead of myspell it is hunspell so I don't know if claws search myspell at all, but after upgrade this folder is there with the old dictionaries.

I don't know if here is the right place to tell.. but the web page https://www.claws-mail.org/win32/dictionaries.php should be updated to tell which folder in which version is used because putting the new dictionary in myspell doesn't work. If put in hunspell works.

One more thing - if the aff file has encoding 'SET microsoft-cp1251' (and it is encoded so) Spell checking won't work. I changed the encoding of the file to UTF-8 and replaced the first line to 'SET UTF-8' and after Claws restart I got the spell check working.
The file from the place http://extensions.services.openoffice.org/dictionary is encoded to CP1252 unfortunately (I used the Bulgarian dictionary).

If I can help with something more - please let me know! I'm happy with Claws now.
Thank you!
Comment 3 Jonathan Boeing 2021-03-15 20:19:12 UTC
Enchant looks for dictionaries based on the enchant.ordering file (C:\Program Files\Claws Mail\share\enchant\enchant.ordering).  The man page https://linux.die.net/man/1/enchant has more info on how it works.

If you didn't run the old uninstaller before installing a new version, files and folders that are only in the old version can accumulate in the install folder.  It's safe to remove the myspell folder manually.

Thanks for pointing out that dictionaries page; I didn't know it was there.

I updated the bundled dictionaries from https://cgit.freedesktop.org/libreoffice/dictionaries/tree/.  Their Bulgarian dictionary seems to be UTF-8 already.
Comment 4 Jonathan Boeing 2021-03-15 20:39:46 UTC
For the sorting crash, can you provide a crash entry from the event viewer?

It would be under Event Viewer > Windows Logs > Application.  Filtering to Event ID 1000 would show just the app crashes.

If you have a chance could you try to narrow it down to a particular email in a folder that triggers the crash?
Comment 5 Ivailo Andonov 2021-03-15 20:54:55 UTC
Hi Jonathan,
Thank you!
I thought that enchant.ordering tells which folders to look. But didn't want to speculate. myspell is not in there :-) So It is safe to remove the whole folder.

https://www.claws-mail.org/win32/dictionaries.php points the the user should download the dictionaries from https://extensions.openoffice.org/en/search?f%5B0%5D=field_project_tags%3A157

Probably it good idea to put there a reference to https://cgit.freedesktop.org/libreoffice/dictionaries/tree/ too.

About the crash - here is the EventID 1000 details:
Faulting application name: claws-mail.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: msvcrt.dll, version: 7.0.19041.546, time stamp: 0x7f567a50
Exception code: 0xc0000005
Fault offset: 0x000896b2
Faulting process id: 0x33c0
Faulting application start time: 0x01d719bc498eb951
Faulting application path: C:\Program Files (x86)\Claws Mail\claws-mail.exe
Faulting module path: C:\WINDOWS\System32\msvcrt.dll
Report Id: 9bc7a4c0-7e0d-4efd-b55c-5ae8bd4271aa
Faulting package full name: 
Faulting package-relative application ID: 

Narrowing down to particular e-mail will be hard because they are 115793 e-mails in that inbox. And the bug happens if I sort by subject which I don't do usually but only accidentally. I don't remember if I ever sorted by subject or that was the first time.
What I suppose is that there is some special character (Chinese or Japan) since there is a lot of communication with Japan guys. There is also a lot of spam so it is possible to have something nasty in the subject there.


Best Regards!
Ivo
Comment 6 Ivailo Andonov 2021-03-16 11:21:11 UTC
Hi Johnathan,

Here is the Event 1000 details from another machine that when sort the inbox by subject crashes running Windows 7 x64 but claws installed as 32bit since otherwise it crashes very often:
Faulting application name: claws-mail.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: msvcrt.dll, version: 7.0.7601.17744, time stamp: 0x4eeaf722
Exception code: 0xc0000005
Fault offset: 0x00018b21
Faulting process id: 0x2bdc
Faulting application start time: 0x01d71976561e3476
Faulting application path: C:\Program Files (x86)\Claws Mail\claws-mail.exe
Faulting module path: C:\Windows\syswow64\msvcrt.dll
Report Id: 712584b5-8635-11eb-b991-00252234b16d 

Can I ask one more question: Some e-mails have date looking like 'Fri, 08 Jul 16 13:34:23 +0300' and other that look like '16.03.21 г.(Tue) 12:06'. The first get always on top regardless they are from 2016 for example. So I can't see the new e-mails on the top of the list. They always appear somewhere down the list.
Probably if I delete those it will be OK but they are many and I don't want to delete them.
Is there a way to sort the mails properly by date and time?

Best Regards!
Ivo
Comment 7 Ivailo Andonov 2021-03-17 11:50:40 UTC
Created attachment 2188 [details]
Related to the comment from 16 March
Comment 8 Jonathan Boeing 2021-03-26 16:51:45 UTC
The Win7 crash is helpful; I've got the same version of msvcrt.dll.  The fault offset points to strcmp, so we'll need to narrow it down.

You can set a registry key to produce a mini dump when claws crashes, documented here: https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps

If you set the key as follows:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpType"=dword:00000001

it'll save the dump to C:\Users\<username>\AppData\Local\CrashDumps by default.  That file should be small enough to compress and attach here.

The question about the sorting the emails with the nonstandard(?) date would be better directed to the users@lists.claws-mail.org mailing list for a broader audience.  I'm not sure myself how you might handle them.
Comment 9 Ivailo Andonov 2021-03-26 19:17:26 UTC
Hi Jonathan,

This is the crash dump from 16 March error is uploaded at the following URL because the size limit here is 500kb.
https://dox.abv.bg/download?id=2da505b3f2
There are 14 days before the content will be deleted.
If you need it uploaded again please let me know!

BR
Ivo
Comment 10 Jonathan Boeing 2021-03-30 07:43:36 UTC
The debugger couldn't fully unwind the stack in the dump, but I was able to dig some info out of it.  It looks like you've got one or more emails with a subject that isn't valid UTF-8.  Glib expects valid UTF-8 strings and triggers the crash by passing a null pointer to strcmp.

Here's a 32-bit build of Claws 3.17.8-1 with a patch to check if the subjects are valid UTF-8 before calling into where I think the crash is happening.

https://mega.nz/file/RlBmGZCD#fX2FAi9Hgnh7hOG1DS8IZ24qeA0Vk7grO9VuCUiAbFE

$ sha256sum.exe claws-mail.exe
c46d73f4913497ded9884f5465088ca7252ab9268c7ac066f1aaa378c559557a *claws-mail.exe

You can just copy this file into the C:\Program Files (x86)\Claws Mail folder.

If I'm right, you should see some warnings in Tools > Debug Log after sorting by subject.
Comment 11 Ivailo Andonov 2021-06-10 12:22:47 UTC
I'm sorry about this delay in the feedback. I expected to receive an e-mail once you post here but I probably missed it. I accidentaly saw the tab in the browser...
Anyway. I replaced the executable and now everything is working perfect!
Thank you!
BR
Ivo
Comment 12 Jonathan Boeing 2021-07-12 15:47:50 UTC
Thanks for the feedback.  I filed a new bug with the patch for the crash when sorting at https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4501

Note You need to log in before you can comment on or make changes to this bug.