After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698014 - evolution-data-server-3.8.1: /libebook/test-query/sexp/eqphone/gb test aborted
evolution-data-server-3.8.1: /libebook/test-query/sexp/eqphone/gb test aborted
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
3.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2013-04-14 18:54 UTC by Pacho Ramos
Modified: 2013-04-17 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build.log.xz (52.11 KB, application/octet-stream)
2013-04-14 18:55 UTC, Pacho Ramos
Details

Description Pacho Ramos 2013-04-14 18:54:08 UTC
We get the following error while running tests:
/libebook/test-query/sexp/endswith: OK
/libebook/test-query/sexp/eqphone/us: OK
/libebook/test-query/sexp/eqphone/gb: **
ERROR:test-query.c:44:test_query: assertion failed (test->sexp == sexp): ("(or (eqphone \"phone\" \"+1-2215423789\" \"en_GB.UTF-8\") (eqphone_national
 \"phone\" \"2215423789\" \"en_GB.UTF-8\") (eqphone_short \"phone\" \"5423789\" \"en_GB.UTF-8\") )" == "(or (eqphone \"phone\" \"+1-2215423789\" \"en_
US.UTF-8\") (eqphone_national \"phone\" \"2215423789\" \"en_US.UTF-8\") (eqphone_short \"phone\" \"5423789\" \"en_US.UTF-8\") )")
/bin/sh: línea 5: 16945 Abortado                ${dir}$tst
FAIL: test-query
Comment 1 Pacho Ramos 2013-04-14 18:55:02 UTC
Created attachment 241517 [details]
build.log.xz
Comment 2 Matthew Barnes 2013-04-14 22:05:54 UTC
I get that failure too.  The E-D-S code is correct, afaict, but the second setlocale(LC_ADDRESS, ...) call doesn't seem to take.
Comment 3 Mathias Hasselmann (IRC: tbf) 2013-04-15 15:52:34 UTC
Are locales are working properly on your system?

#include <stdio.h>
#include <locale.h>

int main()
{
	printf("%s\n", setlocale(LC_ALL, NULL));
	printf("%s\n", setlocale(LC_ALL, ""));
	printf("%s\n", setlocale(LC_ALL, NULL));
	printf("%s\n", setlocale(LC_ALL, "en_US.UTF-8"));
	printf("%s\n", setlocale(LC_ALL, NULL));
	printf("%s\n", setlocale(LC_ALL, "en_GB.UTF-8"));
	printf("%s\n", setlocale(LC_ALL, NULL));
	return 0;
}

/*

$ make sl
cc     sl.c   -o sl
$ ./sl 
C
de_DE.UTF-8
de_DE.UTF-8
en_US.UTF-8
en_US.UTF-8
en_GB.UTF-8
en_GB.UTF-8

*/
Comment 4 Matthew Barnes 2013-04-15 16:14:46 UTC
That program works, this program crashes:

#include <stdio.h>
#include <locale.h>

int main()
{
	printf("%s\n", setlocale(LC_ADDRESS, NULL));
	printf("%s\n", setlocale(LC_ADDRESS, ""));
	printf("%s\n", setlocale(LC_ADDRESS, NULL));
	printf("%s\n", setlocale(LC_ADDRESS, "en_US.UTF-8"));
	printf("%s\n", setlocale(LC_ADDRESS, NULL));
	printf("%s\n", setlocale(LC_ADDRESS, "en_GB.UTF-8"));
	printf("%s\n", setlocale(LC_ADDRESS, NULL));
	return 0;
}

(gdb) run
C
en_US.UTF-8
en_US.UTF-8
en_US.UTF-8
en_US.UTF-8

Program received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:31
31	../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory.
(gdb) backtrace
  • #0 __strlen_sse2
    at ../sysdeps/x86_64/multiarch/../strlen.S line 31
  • #1 _IO_puts
    at ioputs.c line 36
  • #2 main


That's consistent with the test-query program, since it's only setting LC_ADDRESS, not LC_ALL.  Should the test just use LC_ALL?
Comment 5 Matthew Barnes 2013-04-15 16:54:44 UTC
The crash above is actually just from setlocale(LC_ADDRESS, "en_GB.UTF-8") returning NULL.

Also relevant: bug 660624

LC_ADDRESS is non-standard and apparently not defined on OpenBSD.

I think EVO_PHONENUMBER_SUPPORT should test for LC_ADDRESS as well.

CC'ing Antoine since we could use some cross-platform testing help here.
Comment 6 Antoine Jacoutot 2013-04-15 17:02:50 UTC
(In reply to comment #5)
> The crash above is actually just from setlocale(LC_ADDRESS, "en_GB.UTF-8")
> returning NULL.
> 
> Also relevant: bug 660624
> 
> LC_ADDRESS is non-standard and apparently not defined on OpenBSD.

This is correct.

> I think EVO_PHONENUMBER_SUPPORT should test for LC_ADDRESS as well.
> 
> CC'ing Antoine since we could use some cross-platform testing help here.

Well, I actually have 4 patches where I "if 0" all calls to
setlocale (LC_ADDRESS,...).

Sorry I haven't had time to properly make something commitable yet, that's why you haven't heard from me on this yet. They all have a "XXX fix and push upstream" comment though ;-)

This is the list of locale definitions that we do _not_ provide:
LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION

So I think e-d-s shoud indeed test for LC_ADDRESS.
Comment 7 Matthew Barnes 2013-04-17 17:06:25 UTC
I fixed all the unconditional LC_ADDRESS usage, and also made the relevant test cases fail gracefully if setlocale() fails.

Fixed for E-D-S 3.9.1 and 3.8.2 in:

https://git.gnome.org/browse/evolution-data-server/commit/?id=6a440ebb07a846ba40920c746bfb846992d6133a

https://git.gnome.org/browse/evolution-data-server/commit/?h=gnome-3-8&id=0076314596c1c0315884a181b9ae9daa21d38840
Comment 8 Antoine Jacoutot 2013-04-17 17:28:18 UTC
Matthew, that's great. I can confirm e-d-s builds fine on OpenBSD with
these patches and I'll merge them into our package until 3.8.2 comes out.
Thank you!
Comment 9 Matthew Barnes 2013-04-17 18:47:22 UTC
Good!  I wrote the patches on OpenBSD.  :)