GNU libunistring - Bugs: bug #54453, abort in u8_possible_linebreaks in...
You are not allowed to post comments on this tracker with your current authentication level.
bug #54453: abort in u8_possible_linebreaks in libunistring 0.9.10
Submitter: | Natanael Copa <ncopa> | ||
Submitted: | Mon 06 Aug 2018 10:48:26 AM UTC | ||
Category: | unilbrk | Severity: | 3 - Normal |
Item Group: | None | Status: | Fix Released |
Privacy: | Public | Assigned to: | haible |
Open/Closed: | Closed |
Jump to the original submission
Mon 03 Jan 2022 06:04:51 PM UTC, comment #8: |
Bruno Haible <haible> |
Thu 09 Aug 2018 07:21:58 PM UTC, comment #7: Turns out to be a bug in gettext which bundles an old copy of libunistring. The shared, system, libunistring code is used but ends up use the data table from the bundled, older libunistring and things goes wrong.
|
Natanael Copa <ncopa> |
Thu 09 Aug 2018 03:10:06 PM UTC, comment #6: The binaries comes from official Alpine Linux x86_64 builder:
|
Natanael Copa <ncopa> |
Thu 09 Aug 2018 02:45:42 PM UTC, comment #5: The gettext testsuite failures that you posted in https://lists.gnu.org/archive/html/bug-gettext/2018-08/msg00008.html also point to a broken u8_possible_linebreaks function.
|
Bruno Haible <haible> |
Thu 09 Aug 2018 09:01:36 AM UTC, comment #4: all tests in gettext-0.19.8.1 testsuite also passes with libunistring-0.9.9. |
Natanael Copa <ncopa> |
Thu 09 Aug 2018 08:52:28 AM UTC, comment #3: Interestingly, gettext-0.19.8.1's testsuite has 21 failing tests when its built with libunistring-0.9.10, which all passed when built with libunistring-0.9.7. |
Natanael Copa <ncopa> |
Thu 09 Aug 2018 08:39:18 AM UTC, comment #2: Another backtrace, with lt_TO.po:
|
Natanael Copa <ncopa> |
Mon 06 Aug 2018 12:15:45 PM UTC, comment #1: Can you please attach the files he_IL.po.new and filezilla.pot that are mentioned in the command-line? Without these files, I have little chance of reproducing the issue. |
Bruno Haible <haible> |
Mon 06 Aug 2018 10:48:26 AM UTC, original submission:
Hi,
|
Natanael Copa <ncopa> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 11 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2023-01-04 | haible | Status | Fixed | Fix Released | |
2022-01-03 | haible | Status | Need Info | Fixed | |
Assigned to | None | haible | |||
Open/Closed | Open | Closed | |||
2021-12-16 | haible | Category | None | unilbrk | |
2018-08-09 | haible | Status | None | Need Info | |
2018-08-09 | ncopa | Attached File | - | Added test-suite.log, #44755 | |
2018-08-09 | ncopa | Attached File | - | Added libunistring-0.9.10-r0.log, #44754 | |
2018-08-09 | ncopa | Attached File | - | Added lt_LT.po, #44753 | |
2018-08-09 | ncopa | Attached File | - | Added he_IL.po, #44751 | |
Attached File | - | Added filezilla.pot, #44752 |
Powered by Savane 3.13-758e.
Corresponding source code
I think the root cause of the problem is that Alpine packages get built with deficient versions of 'sed', 'join' and other POSIX utilities.
Here's my complete analysis:
1) I built, on a glibc system, the packages that you mention: gettext 0.19.8.1, against libunistring 0.9.10.
2) The symbols in the libunistring.so.2.1.0 that I built and the one in https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/libunistring-0.9.10-r1.apk are different:
The Ubuntu binary packages have these symbols:
With the Alpine apk, however, the symbols are different:
3) A program like msgmerge is linked against these libraries, in order:
This means, by the usual ELF rules, symbols in libgettextsrc or libgettextlib will override symbols in libunistring.
The invocation chain, with binary location, of your example is:
On Alpine Linux:
Whereas on Ubuntu and other distros it is:
4) The libunistring/lib/Makefile.am contains logic to make the libunistring library namespace-clean, that is, to avoid collisions with symbols that may possibly occur in executables and other libraries. This is done by prefixing all internal symbols of the library with 'libunistring_'. unilbrkprop, unilbrk_table are such symbols. This is what, e.g. on Ubuntu, avoids a collision between 'unilbrk_table' (in libgettextlib) and 'libunistring_unilbrk_table' (in libunistring).
This explains why the crash is seen on Alpine Linux but not on other OSes.
5) From the lack of 'libunistring_' prefix in the Alpine binaries one can infer that the logic in libunistring/lib/Makefile.am did not work right. That is, the libunistring.sym file that it composed was incorrect.
In the mean time, there have been two improvements to this logic, to work around deficient versions of 'join' and 'sed' on Alpine Linux.
For 'join', the problem is described in https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00041.html , and the workaround is in https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=commitdiff;h=ca45f9feb81f5c3eb8aeecb4902e3a828c216767 .
For 'sed', one of the problems is described in http://lists.busybox.net/pipermail/busybox/2022-January/089400.html , and the workaround is in https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=commitdiff;h=facdea659083095a6ec8bcc7aa322f683898739b .
This explains why the symbol list was wrong on Alpine Linux and correct everywhere else.
6) The build recipe in Alpine looks reasonable. https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/libunistring/APKBUILD . There's no apparent bug here.
In summary, it costs me time (two workarounds already, and this bug report here), to deal with the deficient utilities in Alpine Linux. Things would be simpler if Alpine Linux packages would be built with GNU coreutils and GNU sed in $PATH.