Ubuntu 20.04&Mac OS X, unstable Concordance result
To reproduce 1
import the TRS source file:
<?xml version="1.0" encoding="utf-8"?>
<!doctype trans system "trans-14.dtd">
<trans>
<speakers>
<speaker id="guest2669" name="guest2669" type="unknown" dialect="native" accent="" scope="local"/>
<speaker id="guest437" name="guest437" type="unknown" dialect="native" accent="" scope="local"/>
</speakers>
<episode>
<section topic="20/03/1957" type="spirotechnique, télévision pour la recherche sous marine" resume="tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést " starttime="404" endtime="476" synchronized="true">
<turn starttime="410.53" endtime="411.56" speaker="guest437">
<sync time="410.53"/>
<w starttime="410.53" endtime="410.72" conf="0.97" pos="p" punct="none" case="uc" ne="">au</w>
<w starttime="410.77" endtime="411.18" conf="0.97" pos="n" punct="none" case="uc" ne="">havre</w>
<w starttime="411.21" endtime="411.34" conf="0.99" pos="p" punct="none" case="o" ne="">au</w>
<w starttime="411.34" endtime="411.56" conf="0.99" pos="n" punct="point" case="o" ne="">pied</w>
<w starttime="411.56" endtime="411.56" punct="point">.</w>
</turn>
</section>
</episode>
</trans>
compute a concordance of
[_.div_resume=".*é.*"%cd]
cqp error messages (patched to display the string) :
cl: major error, invalid utf8 string passed to cl_string_canonical: tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést
[bis bis bis]
cl: major error, invalid utf8 string passed to cl_string_canonical: tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést tést
to reproduce 2
on ubuntu 20.04 with corpus af-voix-off-v… corpus:
démarrage de txm 0.8.2 (2021-11-17 16h09)…
txm est prêt.
concordance de <<div>[((_.div_titre-propre=".*(mutilé|blessé).*"%cd | _.div_resume=".*(mutilé|blessé).*"%cd | _.div_resume=".*invalide.*" | _.div_sequences=".*(mutilé|blessé).*"%cd | _.div_sequences=".*invalide.*") & _.div_descripteurs-aff-lig=".*((guerre mondiale)|(guerre d'algérie)|(guerre d'indochine)).*"%cd) | (_.div_titre-propre=".*grands? (mutilé|invalide)s?.*"%cd | _.div_resume=".*grands? (mutilé|invalide)s?.*"%cd | _.div_sequences=".*grands? (mutilé|invalide)s?.*"%cd) | (_.div_id="afe85006160|afe85003073|afe86000295")]> dans le corpus af-voix-off-v4-2021-05-19...
16 occurrences.
concordance de <<div>[((_.div_titre-propre=".*(mutilé|blessé).*"%cd | _.div_resume=".*(mutilé|blessé).*"%cd | _.div_resume=".*invalide.*" | _.div_sequences=".*(mutilé|blessé).*"%cd | _.div_sequences=".*invalide.*") & _.div_descripteurs-aff-lig=".*((guerre mondiale)|(guerre d'algérie)|(guerre d'indochine)).*"%cd) | (_.div_titre-propre=".*grands? (mutilé|invalide)s?.*"%cd | _.div_resume=".*grands? (mutilé|invalide)s?.*"%cd | _.div_sequences=".*grands? (mutilé|invalide)s?.*"%cd) | (_.div_id="afe85006160|afe85003073|afe86000295")]> dans le corpus af-voix-off-v4-2021-05-19...
17 occurrences.
concordance de <<div>[((_.div_titre-propre=".*(mutilé|blessé).*"%cd | _.div_resume=".*(mutilé|blessé).*"%cd | _.div_resume=".*invalide.*" | _.div_sequences=".*(mutilé|blessé).*"%cd | _.div_sequences=".*invalide.*") & _.div_descripteurs-aff-lig=".*((guerre mondiale)|(guerre d'algérie)|(guerre d'indochine)).*"%cd) | (_.div_titre-propre=".*grands? (mutilé|invalide)s?.*"%cd | _.div_resume=".*grands? (mutilé|invalide)s?.*"%cd | _.div_sequences=".*grands? (mutilé|invalide)s?.*"%cd) | (_.div_id="afe85006160|afe85003073|afe86000295")]> dans le corpus af-voix-off-v4-2021-05-19...
19 occurrences.
etc. etc.
bug: a different number of matches is given for each call.
diagnostic
used glib library by a linux txm :
sudo cat /proc/25936/maps |grep "glib"
7f20d03d3000-7f20d03f5000 r--p 00000000 fd:01 24774453 /usr/share/locale-langpack/fr/lc_messages/glib20.mo
7f20d1402000-7f20d141e000 r--p 00000000 fd:01 22290140 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
7f20d141e000-7f20d14a2000 r-xp 0001c000 fd:01 22290140 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
7f20d14a2000-7f20d1528000 r--p 000a0000 fd:01 22290140 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
7f20d1528000-7f20d1529000 r--p 00125000 fd:01 22290140 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
7f20d1529000-7f20d152a000 rw-p 00126000 fd:01 22290140 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
the console produces the following critical error message:
cl: major error, invalid utf8 string passed to cl_string_canonical...
cl: major error, invalid utf8 string passed to cl_string_canonical...
cl: major error, invalid utf8 string passed to cl_string_canonical...
etc. etc.
cqp source analysis
this message comes from the special-chars.c
cqp source file (extract):
<code class="c
if (charset == utf8) {
/* pointers for UTF8 processing */
gchar *string = NULL;
gchar *precomposed = NULL;
gchar *folded = NULL;
gchar *current_char;
gchar *next_char_begins;
int icase = (flags & IGNORE_CASE) != 0;
int idiac = (flags & IGNORE_DIAC) != 0;
/* UTF8 accent folding */
if (idiac) {
if (NULL == (string = g_utf8_normalize((gchar *)s, -1, G_NORMALIZE_NFD)) ) {
fprintf(stdout, "CL: major error, invalid UTF8 string passed to cl_string_canonical...\n");
return;
}
for (current_char = string; *current_char != '\0'; /* increment is done in-loop */) {
next_char_begins = g_utf8_next_char(current_char);
if (g_unichar_ismark(g_utf8_get_char(current_char))) {
/* downcopy to overwrite the mark character */
strcpy(current_char, next_char_begins);
/* and keep current_char the same */
}
else
current_char = next_char_begins;
}
}
/* end of accent folding */
else
string = (gchar *)s;
/* UTF8 precomposing -- always happens */
/* precomposed = g_utf8_normalize(string, -1, G_NORMALIZE_NFC); */ /* -- duplicate call to g_utf8_normalize() removed */
if (NULL == (precomposed = g_utf8_normalize(string, -1, G_NORMALIZE_NFC)) ) {
fprintf(stdout, "CL: major error, invalid UTF8 string passed to cl_string_canonical...\n");
return;
}
...
The message is displayed in two cases: with or without using the ‘%d’
CQL modifier (if (idiac)…).
This function comes from the glib library:
https://docs.gtk.org/glib/func.utf8\_normalize.html.
In each case, the `g_utf8_normalize` function doesn’t work (returns
NULL).
**diagnostic \#1**
The CL error is catastrophic: the Java code receiving the result of this
function should ABORT THE COMMAND in this case.
TO DO: add abort code to the Java calling code.
**Binary Analysis**
The debug/LibrariesVersions TXM macro lists the following TXM dynamic
libraries:
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libziso
/usr/lib/TXM-0.8.2beta/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.800.v20180827-1352/eclipse_1705.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libnet.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libnio.so
/home/sheiden/.TXM-0.8.2/configuration/org.eclipse.osgi/142/0/.cp/libswt-gtk-4919.so
/home/sheiden/.TXM-0.8.2/configuration/org.eclipse.osgi/142/0/.cp/libswt-pi3-gtk-4919.so
/home/sheiden/.TXM-0.8.2/configuration/org.eclipse.osgi/142/0/.cp/libswt-cairo-gtk-4919.so
/home/sheiden/.TXM-0.8.2/configuration/org.eclipse.osgi/142/0/.cp/libswt-atk-gtk-4919.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libawt_xawt.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libawt.so
/home/sheiden/.TXM-0.8.2/plugins/org.txm.libs.cqlinux_1.1.0.202111241119/res/linux64/libcqpjni.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libsunec.so
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libfontmanager.so
/home/sheiden/.TXM-0.8.2/configuration/org.eclipse.osgi/142/0/.cp/libswt-webkit-gtk-4919.so
Of which,
`/home/sheiden/.TXM-0.8.2/plugins/org.txm.libs.cqlinux_1.1.0.202111241119/res/linux64/libcqpjni.so`
corresponds to CQP.
Which effectively needs the `g_utf8_normalize` function from glib:
$ nm -e /home/sheiden/.TXM-0.8.2/plugins/org.txm.libs.cqlinux_1.1.0.202111241119/res/linux64/libcqpjni.so | grep ' g_'
U g_access
U g_dir_close
U g_dir_open
U g_dir_read_name
U g_strreverse
U g_unichar_ismark
U g_utf8_casefold
U g_utf8_collate
U g_utf8_get_char
U g_utf8_normalize
U g_utf8_skip
U g_utf8_strreverse
U g_utf8_validate
**Which glib library version is used in TXM 0.8.2beta on Ubuntu 20.04?**
$ locate libglib|grep '^/usr/lib'
/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libglib-lite.so
/usr/lib/cli/glib-sharp-2.0/libglibsharpglue-2.so
/usr/lib/i386-linux-gnu/libglib-2.0.so.0
/usr/lib/i386-linux-gnu/libglib-2.0.so.0.6400.6
/usr/lib/x86_64-linux-gnu/libglib-2.0.a
/usr/lib/x86_64-linux-gnu/libglib-2.0.so
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1.3.0
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1.3.0
`/usr/lib/TXM-0.8.2beta/jre/lib/amd64/libglib-lite.so` is the usual
suspect.
And effectively, this library provides the binary text for
`g_utf8_normalize`:
nm -e /usr/lib/TXM-0.8.2beta/jre/lib/amd64/libglib-lite.so|grep g_utf8_normalize
0000000000073ede T g_utf8_normalize
0000000000073b01 T _g_utf8_normalize_wc
**Diagnostic \#2**
Is the version of this `glib-lite` compatible with libcqpjni.so?
*(from redmine: issue id 3207, created on 2022/01/18 by Serge Heiden)*
* Relations:
* relates #3211