hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger-web: crashes with German symbols in descriptions

Open m-ildefons opened this issue 3 years ago • 5 comments

Dear hledger devs,

I found a bug in hledger-web where the server would sometimes crash while adding a new transaction or just viewing transactions with German special symbols (ßäöüÄÖÜ) in the descriptions. Sometimes after reloading, it also wouldn't render them properly. I know that my editor saves files utf-8 encoded by default and displays the journals contents correctly, so the file seems to be fine in itself.

Reproducer:

2022-06-07 Rent Fußballstraße 11
    assets:cash              -582,36
    expenses:rent              582,36

Version: hledger 1.26.99-gb32b13004-20220818, linux-x86_64 Platform: Linux GLaDOS.fritz.box 5.14.21-150400.19-default #1 SMP PREEMPT_DYNAMIC Wed Apr 20 08:32:52 UTC 2022 (d6fb753) x86_64 x86_64 x86_64 GNU/Linux

NAME="openSUSE Leap"
VERSION="15.4 Beta"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.4"
PRETTY_NAME="openSUSE Leap 15.4 Beta"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.4"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"

m-ildefons avatar Aug 19 '22 09:08 m-ildefons

Thanks for the report. Strange, I can't reproduce locally with hledger-web 1.26-ged1d08dc2-20220604, mac-aarch64, or at https://demo.hledger.org with hledger-web 1.21.99 (can't build a newer version there just at the moment).

What is your system locale ? Mine is

$ locale                                                                                                                                                  
LANG=en_US.UTF-8                                                                                                                                                                             
LANGUAGE=                                                                                                                                                                                    
LC_CTYPE="en_US.UTF-8"                                                                                                                                                                       
LC_NUMERIC="en_US.UTF-8"                                                                                                                                                                     
LC_TIME="en_US.UTF-8"                                                                                                                                                                        
LC_COLLATE="en_US.UTF-8"                                                                                                                                                                     
LC_MONETARY="en_US.UTF-8"                                                                                                                                                                    
LC_MESSAGES="en_US.UTF-8"                                                                                                                                                                    
LC_PAPER="en_US.UTF-8"                                                                                                                                                                       
LC_NAME="en_US.UTF-8"                                                                                                                                                                        
LC_ADDRESS="en_US.UTF-8"                                                                                                                                                                     
LC_TELEPHONE="en_US.UTF-8"                                                                                                                                                                   
LC_MEASUREMENT="en_US.UTF-8"                                                                                                                                                                 
LC_IDENTIFICATION="en_US.UTF-8"                                                                                                                                                              
LC_ALL=                                                                                                                                                                                      

on GNU/linux and similar on mac.

What is the size of the file containing just the reproducer above ? Maybe it contains a utf-8 BOM ? (Which we are supposed to support, but it might be relevant).

"Sometimes" is also odd. I would expect it to be deterministic. Is it possible you have multiple hledger-web processes running ?

simonmichael avatar Aug 20 '22 00:08 simonmichael

PS if you have any older versions installed, it would be useful to check those too.

simonmichael avatar Aug 20 '22 00:08 simonmichael

Hey Simon, thanks for the quick reply. My locale is this:

│ ~ │► locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

The file is about 4k in size and does not have a BOM. I say sometimes since I haven't found a way to reliably reproduce it. However it's happening often enough that it is annoying. I have hledger installed from source, so I can just recompile and run an older version too if you like. Which one should I try?

m-ildefons avatar Aug 22 '22 09:08 m-ildefons

It's probably not worth the trouble of testing an old version, perhaps just keep looking for a repeatable reproducer.

simonmichael avatar Aug 22 '22 11:08 simonmichael

Any luck reproducing this ?

simonmichael avatar Sep 15 '22 18:09 simonmichael

Hi @m-ildefons .. following up to see if you can still produce this crash. Current hledger-web version is 1.28.

simonmichael avatar Dec 24 '22 18:12 simonmichael

Presuming resolved.

simonmichael avatar Apr 29 '23 03:04 simonmichael

(If reproducible, please reopen.)

simonmichael avatar Apr 29 '23 03:04 simonmichael