Bug#1012457: calibre: segfault on startup for different locales

2022-06-08 Thread yokota
Tags: confirmed

It also reproduce with other non-UTF-8 locales.

1. Edit "/etc/locale.gen" and setup non-UTF-8 locale
2. Use non-UTF-8 locale for Calibre
  $ LANG=ja_JP.EUC-JP calibre
  $ LANG=en_US.ISO-8859-15 calibre
3. Segmentation fault

>   If LC_CTYPE=ro_RO then calibre segfaults on startup
>   If LC_CTYPE is unset (or LC_ALL=C) then calibre starts and works normally.

> Locale: LANG=en_GB.UTF-8, LC_CTYPE=ro_RO (charmap=ISO-8859-2), 
> LANGUAGE=en_GB:en

Current Linux system recommends UTF-8 based locale.
"ro_RO" uses legacy encoding "ISO-8859-2" and it's not recommended for
modern Linux systems.
Use UTF-8 based ro_RO locale "ro_RO.UTF-8" to avoids this bug.

1. Edit "/etc/locale.gen" and adds "ro_RO.UTF-8" locale support.
Use "dpkg-reconfigure locales" command for easy setup.
It also drops legacy locale support.
 # dpkg-reconfigure locales
2. Use "ro_RO.UTF-8" for Calibre
 $ LC_CTYPE=ro_RO.UTF-8 calibre
 $ LANG=ro_RO.UTF-8 calibre
3. Works well.

> The offcial calibre version 5.43.0 does not segfault on the same machine.
> This is a debian specific issue.

Official calibre uses embedded Python, and not uses system Python.
Embedded Python uses limited locale support, and this avoids locale problems.

--
YOKOTA Hiroshi



Bug#1012457: calibre: segfault on startup for different locales

2022-06-07 Thread Emil
Package: calibre
Version: 5.43.0+dfsg-1
Severity: normal

  If LC_CTYPE=ro_RO then calibre segfaults on startup
  If LC_CTYPE is unset (or LC_ALL=C) then calibre starts and works normally.

  The culprit seems to be a Python script in oeb/polish
  I've attached an strace of the crash.

The offcial calibre version 5.43.0 does not segfault on the same machine.
This is a debian specific issue.


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (900, 'testing'), (700, 'unstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.269 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=ro_RO (charmap=ISO-8859-2), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages calibre depends on:
ii  calibre-bin5.43.0+dfsg-1
ii  dpkg   1.21.8
ii  fonts-liberation2  2.1.5-1
ii  libjpeg-turbo-progs1:2.1.2-1
ii  libjxr-tools   1.2~git20170615.f752187-5
ii  optipng0.7.7-2
ii  poppler-utils  22.02.0-3
ii  python33.10.4-1+b1
ii  python3-apsw   3.36.0-r1-2+b1
ii  python3-bs44.11.1-1
ii  python3-chardet4.0.0-2
ii  python3-chm0.8.6-3+b1
ii  python3-css-parser 1.0.7-1
ii  python3-cssselect  1.1.0+ds-3
ii  python3-dateutil   2.8.1-6
ii  python3-feedparser 6.0.8-2
ii  python3-html2text  2020.1.16-1
ii  python3-html5-parser   0.4.10-5
ii  python3-html5lib   1.1-3
ii  python3-jeepney0.8.0-1
ii  python3-lxml   4.8.0-1
ii  python3-markdown   3.3.7-1
ii  python3-mechanize  1:0.4.8+pypi-3
ii  python3-msgpack1.0.3-1
ii  python3-netifaces  0.11.0-1+b1
ii  python3-pil9.0.1-1
ii  python3-pkg-resources  59.6.0-1.2
ii  python3-py7zr  0.11.3+dfsg-4
ii  python3-pygments   2.11.2+dfsg-2
ii  python3-pyparsing  3.0.7-2
ii  python3-pyqt5  5.15.6+dfsg-1+b2
ii  python3-pyqt5.qtsvg5.15.6+dfsg-1+b2
ii  python3-pyqt5.qtwebengine  5.15.5-1+b1
ii  python3-pyqt5.sip  12.10.1-1
ii  python3-regex  0.1.2020-1
ii  python3-routes 2.5.1-1
ii  python3-speechd0.11.1-3
ii  python3-zeroconf   0.38.6-2
ii  python3.10 3.10.4-1
ii  xdg-utils  1.1.3-4.1

Versions of packages calibre recommends:
ii  python3-dnspython  2.2.1-1
ii  python3-ipython7.31.1-1
ii  udisks22.9.4-1

Versions of packages calibre suggests:
pn  python3-openssl   
pn  python3-unrardll  

-- no debconf information