soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
6.83k stars 387 forks source link

Internal error with gawk 5.2.0 #463

Closed mark2185 closed 1 year ago

mark2185 commented 1 year ago

I get an error on my linux desktop, it happens on the second translation, which causes the program to crash.

$> gawk --version
GNU Awk 5.2.0, API 3.2, PMA Avon 7, (GNU MPFR 4.1.0-p13, GNU MP 6.2.1)
Copyright (C) 1989, 1991-2022 Free Software Foundation.

This is how it crashes (I input 1, and then 2):

$> trans         
1
1

See also
    1,2-naphthoquinone, 1,4-naphthoquinone
2
gawk: /dev/fd/63:93: fatal: internal error: file interpret.h, line 254: unexpected parameter type Node_val

Additional info:

$> trans -V
Translate Shell       0.9.7-git:3dcc122

platform              Linux
terminal type         xterm-256color
bi-di emulator        [N/A]
gawk (GNU Awk)        5.2.0
fribidi (GNU FriBidi) 1.0.12
audio player          mpv --no-config
terminal pager        less
web browser           xdg-open
user locale           en_US.UTF-8 (English)
host language         en
source language       auto
target language       en
translation engine    auto
proxy                 [NONE]
user-agent            Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 Edg/104.0.1293.54
ip version            [DEFAULT]
theme                 default
init file             [NONE]

Report bugs to:       https://github.com/soimort/translate-shell/issues
0fflineuser commented 1 year ago

Same problem on a fresh arch install

mjkloeckner commented 1 year ago

Same error here, though I can't even run trans -V.

0fflineuser commented 1 year ago

If on arch you can downgrade gawk with : sudo pacman -U https://archive.archlinux.org/packages/g/gawk/gawk-5.1.1-1-x86_64.pkg.tar.zst This is the latest version that I found still works for me. Then if you want you can uncomment and add gawk to the IgnorePkg line in /etc/pacman.conf as to not update gawk it until it is resolved : IgnorePkg = gawk

soimort commented 1 year ago

Despite multiple reports here, I'm also on Arch Linux upgraded with gawk 5.2.0-3, and I have not been able to reproduce this error yet. Pretty strange.

More information is welcome if anyone else encountered this issue.

mjkloeckner commented 1 year ago

Downgrading gawk worked for me, thanks @0fflineuser.

The weird thing is that I have two computers running arch linux with the same version of gawk 5.2.0-3, and in one computer works but not in the other.

kririae commented 1 year ago

I encountered the same problem with gawk 5.2.0-3 on ArchLinux, and downgrading the gawk also works for me. When I clone the repo and execute the code as follows,

$ ./translate -e bing :zh test
gawk: ./include/Commons.awk:290: fatal: internal error: file interpret.h, line 254: unexpected parameter type Node_val

It seems that the error is raised when executing the function unparameterize(), and the behavior is weird. You could directly add print typeof(string) at the beginning of the function, and the problem is just gone, though it is not a solution. Anyway, this is the behavior. Hopefully, the problem can be figured out and fixed!

Translate Shell       0.9.7-git:a3bba39

platform              Linux
terminal type         xterm-256color
bi-di emulator        [N/A]
gawk (GNU Awk)        5.2.0
fribidi (GNU FriBidi) 1.0.12
audio player          mpv --no-config
terminal pager        less
web browser           xdg-open
user locale           en_US.UTF-8 (English)
host language         en
source language       auto
target language       en
translation engine    auto
proxy                 [NONE]
user-agent            Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 Edg/104.0.1293.54
ip version            [DEFAULT]
theme                 default
init file             [NONE]

Report bugs to:       https://github.com/soimort/translate-shell/issues
mogando668 commented 1 year ago

i don't think it's a linux or translate shell problem. i'm on macOS, and the gawk 5.2.0 would sometimes randomly give a similar error message, for random stuff i run. but run the exact same code again with no changes then it magically goes through. it's definitely something the gnu team need to take a look

soimort commented 1 year ago

Hi all,

It is now confirmed that this was due to a bug in gawk 5.2.0: (not on the translate-shell side) https://lists.gnu.org/archive/html/bug-gawk/2022-09/msg00055.html which has already been fixed by http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=2848045aed5ccfd7b582808288f7fcc18d319952

If you wish, just build gawk from the current master branch (on Arch Linux you can simply use gawk-git from AUR).

I'll keep this issue open for informational purposes until the next stable release of gawk happens.