Bug 253774 - textproc/aspell: bad regular expression after location specifier
Summary: textproc/aspell: bad regular expression after location specifier
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: FreeBSD Office Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-22 22:49 UTC by vermaden
Modified: 2021-04-15 07:17 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (office)


Attachments
post.txt (4.52 KB, text/plain)
2021-04-01 10:50 UTC, vermaden
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description vermaden 2021-02-22 22:49:14 UTC
Installed from pkg(8):

aspell: 0.60.8,1
en-aspell: 2018.04.16.0



Error:

% aspell -l en check FILE
Error: /usr/local/share/aspell/perl.amf:5: "perl": Magic "0:256:^[ \t]*#!((/\w*)+)/perl": bad regular expression after location specifier; regexp reports: "trailing backslash (\)".



Regards.
Comment 1 Thierry Thomas freebsd_committer 2021-04-01 09:40:48 UTC
Not reproducible here. Could you please attach a FILE causing this problem?
Comment 2 vermaden 2021-04-01 10:50:21 UTC
Created attachment 223745 [details]
post.txt
Comment 3 vermaden 2021-04-01 10:51:14 UTC
% pkg info | grep aspell
aspell-0.60.8,1                Spelling checker with better suggestion logic than ispell

% aspell -l en check post.txt
Error: /usr/local/share/aspell/perl.amf:5: "perl": Magic "0:256:^[ \t]*#!((/\w*)+)/perl": bad regular expression after location specifier; regexp reports: "trailing backslash (\)".

Attached.

Regards.
Comment 4 Thierry Thomas freebsd_committer 2021-04-01 15:45:33 UTC
It works for me:
----------------------------------------------------------------------------
The <em>Valuable News</em> weekly series is dedicated to provide summary about news, articles and other\
interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon    \
something worth mentioning on the Internet I just put it here.

Today the amount information that we get using various information streams is at massive overload. Thus\
one needs to focus only on what is important without the need to <tt>grep(1)</tt> the Internet         \
everyday. Hence the idea of providing such information 'bulk' as I already do that <tt>grep(1)</tt>.




<h1>UNIX</h1>

FreeNAS Compression Tale.
http://storagegaga.com/a-freenas-compression-tale/

Really Leaving Linux Desktop Behind.
https://catfox.life/2021/03/21/really-leaving-the-linux-desktop-behind/

Managing Multiple PostgreSQL Instances on FreeBSD.
https://fluca1978.github.io/2021/03/22/PostgreSQLFreeBSDMultiInstance.html

Wireguard Controversy Statement from FreeBSD Core Team.
https://lists.freebsd.org/pipermail/freebsd-hackers/2021-March/057102.html
                                                                                                        
1) Ty                                               6) tat
2) YT                                               7) tit
3) Tet                                              8) tot
4) Tut                                              9) tr
5) rt                                               0) tut
i) Ignore                                           I) Ignore all
r) Replace                                          R) Replace all
a) Add                                              l) Add Lower
b) Abort                                            x) Exit
                                                                                                        
?
----------------------------------------------------------------------------

Thus we know that the encountered error does not depend on your file.

Some more ideas:
- Perl installed version?
- output of `locale'?
- check that /usr/local/share/aspell/perl.amf is not corrupt
  SHA256 (/usr/local/share/aspell/perl.amf) = a7be8f9c7e1b9640d780e1e1c1bd2ce153ebf8fcb5a402e37aeacea68e1db578
- ...
Comment 5 vermaden 2021-04-01 16:27:18 UTC
Here.

% pkg info | grep '^perl'
perl5-5.32.1_1                 Practical Extraction and Report Language

% locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8

% sha256 /usr/local/share/aspell/perl.amf
SHA256 (/usr/local/share/aspell/perl.amf) = a7be8f9c7e1b9640d780e1e1c1bd2ce153ebf8fcb5a402e37aeacea68e1db578
Comment 6 Thierry Thomas freebsd_committer 2021-04-01 16:59:09 UTC
Sorry, no more idea...

Adding Perl-list, if someone there might help?
Comment 7 vermaden 2021-04-01 17:06:57 UTC
% cat /usr/local/share/aspell/perl.amf
MODE perl

ASPELL >=0.60.1

MAGIC /0:256:^[ \t]*\#!((\/\w*)+)\/perl/pl/pm
MAGIC /<noregex>/pl/pm

DESCRIPTION mode for checking Perl comments and string literals

FILTER url
FILTER context
OPTION clear-context-delimiters 
OPTION add-context-delimiters " "
OPTION add-context-delimiters \# \0
OPTION disable-context-visible-first
Comment 8 vermaden 2021-04-01 17:07:17 UTC
(In reply to Thierry Thomas from comment #6)
Thanks for trying anyway.

Regards.
Comment 9 parv 2021-04-01 21:58:11 UTC
I could not reproduce the error either directly from the command line as shown or when aspell was invoked from vim.

Using vermaden's locale settings also did not produce any error ...

  % env LANG=en_US.UTF-8 ... aspell -l en check post.txt


My local environment ...

% pkg info -x aspell
aspell-0.60.8,1
en-aspell-2018.04.16.0

% locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE=C
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

% perl -v

This is perl 5, version 32, subversion 1 (v5.32.1) built for amd64-freebsd-thread-multi
...
Comment 10 vermaden 2021-04-01 23:16:35 UTC
Not sure if that helps but I also reinstalled perl:

# pkg install -f perl5

... did not helped.

I do not need aspell(1) that badly. We may close that BUG if only I have that problem ...
Comment 11 Jason W. Bacon freebsd_committer 2021-04-07 16:26:25 UTC
I have the same issue on a 13.0 laptop.

FreeBSD moray.acadix  bacon ~/Books/Computer-books/BIB 181: aspell check links
Error: /usr/local/share/aspell/perl.amf:5: "perl": Magic "0:256:^[ \t]*#!((/\w*)+)/perl": bad regular expression after location specifier; regexp reports: "trailing backslash (\)".

FreeBSD moray.acadix  bacon ~/Books/Computer-books/BIB 182: locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8
FreeBSD moray.acadix  bacon ~/Books/Computer-books/BIB 183: uname -a

FreeBSD moray.acadix.biz 13.0-RC5-p1 FreeBSD 13.0-RC5-p1 #0: Tue Apr  6 05:43:06 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

It also occurs on two 13.0-RC2 systems, but not on any of my 12.2-RELEASE systems.
Comment 12 Derek Schrock 2021-04-08 13:27:19 UTC
Seems related?

https://github.com/GNUAspell/aspell/issues/613
Comment 13 Jason W. Bacon freebsd_committer 2021-04-08 18:20:35 UTC
(In reply to Derek Schrock from comment #12)

Hacking in the perl.amf patch fixes the issue on my 13.0 laptop.  Nice find...
Comment 14 Andriy Gapon freebsd_committer 2021-04-09 17:30:05 UTC
Just for the record, I see same problem: when I start git gui it complains about aspell with exactly the same message. stable/13.
Comment 15 commit-hook freebsd_committer 2021-04-14 16:08:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ef24a782a2a4f9dce3b37ecbbb6aa1f798cc96b3

commit ef24a782a2a4f9dce3b37ecbbb6aa1f798cc96b3
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2021-04-14 15:44:51 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2021-04-14 15:52:19 +0000

    textproc/aspell: fix a bad regexp after location specifier

    PR:             253774

 textproc/aspell/Makefile                                      |  1 +
 textproc/aspell/files/patch-configure                         |  6 +++---
 textproc/aspell/files/patch-interfaces__cc__aspell.h          |  8 ++++----
 .../aspell/files/patch-modules__speller__default__affix.cpp   |  6 +++---
 .../aspell/files/patch-modules_filter_modes_perl.amf (new)    | 11 +++++++++++
 textproc/aspell/files/patch-prog__aspell.cpp                  |  8 ++++----
 textproc/aspell/files/patch-prog__checker_string.cpp          | 10 +++++-----
 textproc/aspell/files/patch-prog__checker_string.hpp          |  4 ++--
 8 files changed, 33 insertions(+), 21 deletions(-)
Comment 16 Thierry Thomas freebsd_committer 2021-04-14 16:12:01 UTC
Patch committed!
Thanks to everyone.
Comment 17 commit-hook freebsd_committer 2021-04-15 07:17:42 UTC
A commit in branch 2021Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5517597b8a0835b3799fcad6f6f796597bd7c200

commit 5517597b8a0835b3799fcad6f6f796597bd7c200
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2021-04-14 15:44:51 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2021-04-15 07:16:48 +0000

    textproc/aspell: fix a bad regexp after location specifier

    PR:             253774
    (cherry picked from commit ef24a782a2a4f9dce3b37ecbbb6aa1f798cc96b3)

 textproc/aspell/Makefile                                      |  1 +
 textproc/aspell/files/patch-configure                         |  6 +++---
 textproc/aspell/files/patch-interfaces__cc__aspell.h          |  8 ++++----
 .../aspell/files/patch-modules__speller__default__affix.cpp   |  6 +++---
 .../aspell/files/patch-modules_filter_modes_perl.amf (new)    | 11 +++++++++++
 textproc/aspell/files/patch-prog__aspell.cpp                  |  8 ++++----
 textproc/aspell/files/patch-prog__checker_string.cpp          | 10 +++++-----
 textproc/aspell/files/patch-prog__checker_string.hpp          |  4 ++--
 8 files changed, 33 insertions(+), 21 deletions(-)