Re: [Maria-discuss] Maria/Aria unit test failures
On 4/14/2012 1:31 AM, Oleksandr Byelkin wrote:
11.04.2012 23:51, Brian Evans написал:
I'm trying to pin down why unit tests fail for the 5.1, 5.2 and 5.3 series of the (m)aria engine.
My build tool runs 'make test-unit' and the following errors appear. The build tool does strip out some environment variables, but running from bash directly doesn't change anything.
Can anyone provide pointers?
Thanks
(This is from MariaDB 5.1.62)
[16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... 73/830 Failed test '../storage/maria/unittest/../ma_test2 -s -htmp -m10000 -e4096 -K ' (loop iteration 8.) at line 316 (errcode: 256, test: 83) [16:34:05] ../storage/maria/unittest/ma_test_all-t .....................
Could you describe condition of running (OS, 32/64 bit and so on). I can't repeat it so need more information.
[skip]
Sure. This is output from my build tool which lists important libraries and the environment used. OS is Gentoo Linux. Architecture is x86_64. Portage 2.1.10.49 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.13-r4, 2.6.38-gentoo-r6 x86_64) ================================================================= System uname: Linux-2.6.38-gentoo-r6-x86_64-Intel-R-_Xeon-TM-_CPU_3.40GHz-with-gentoo-2.0.3 Timestamp of tree: Thu, 29 Mar 2012 19:30:01 +0000 app-shells/bash: 4.2_p20 dev-lang/python: 2.7.2-r3, 3.1.4-r3, 3.2.2 dev-util/cmake: 2.8.6-r4 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.9.8.4 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.68 sys-devel/automake: 1.9.6-r3, 1.11.1 sys-devel/binutils: 2.21.1-r1 sys-devel/gcc: 4.5.3-r1 sys-devel/gcc-config: 1.5-r2 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 3.1 (virtual/os-headers) sys-libs/glibc: 2.13-r4 CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=nocona" CHOST="x86_64-pc-linux-gnu" CXXFLAGS="-O2 -pipe -march=nocona" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5"
On 4/16/2012 9:08 AM, Brian Evans wrote:
On 4/14/2012 1:31 AM, Oleksandr Byelkin wrote:
11.04.2012 23:51, Brian Evans написал:
I'm trying to pin down why unit tests fail for the 5.1, 5.2 and 5.3 series of the (m)aria engine.
My build tool runs 'make test-unit' and the following errors appear. The build tool does strip out some environment variables, but running from bash directly doesn't change anything.
Can anyone provide pointers?
Thanks
(This is from MariaDB 5.1.62)
[16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... 73/830 Failed test '../storage/maria/unittest/../ma_test2 -s -htmp -m10000 -e4096 -K ' (loop iteration 8.) at line 316 (errcode: 256, test: 83) [16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... Could you describe condition of running (OS, 32/64 bit and so on). I can't repeat it so need more information.
[skip] Sure. This is output from my build tool which lists important libraries and the environment used. OS is Gentoo Linux. Architecture is x86_64.
Portage 2.1.10.49 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.13-r4, 2.6.38-gentoo-r6 x86_64) ================================================================= System uname: Linux-2.6.38-gentoo-r6-x86_64-Intel-R-_Xeon-TM-_CPU_3.40GHz-with-gentoo-2.0.3 Timestamp of tree: Thu, 29 Mar 2012 19:30:01 +0000 app-shells/bash: 4.2_p20 dev-lang/python: 2.7.2-r3, 3.1.4-r3, 3.2.2 dev-util/cmake: 2.8.6-r4 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.9.8.4 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.68 sys-devel/automake: 1.9.6-r3, 1.11.1 sys-devel/binutils: 2.21.1-r1 sys-devel/gcc: 4.5.3-r1 sys-devel/gcc-config: 1.5-r2 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 3.1 (virtual/os-headers) sys-libs/glibc: 2.13-r4 CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=nocona" CHOST="x86_64-pc-linux-gnu" CXXFLAGS="-O2 -pipe -march=nocona" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5"
It seems as if the C(XX)FLAGS when set to -O2 causes the test failure. -O1 does not fail.
Hi, (I wasn't subscribed to the list when the thread started, so the reply might get misplaced, sorry about it. I'm answering this: https://lists.launchpad.net/maria-discuss/msg00601.html)
My build tool runs 'make test-unit' and the following errors appear.
[16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... 73/830 Failed test '../storage/maria/unittest/../ma_test2 -s -htmp -m10000 -e4096 -K ' (loop iteration 8.) at line 316 (errcode: 256, test: 83)
From what I see, ma_test2 has the array key3[5000], used in a loop which sets n3=rnd(5000); and then reads key3[n3] == ... while rnd(uint max_value) is return (uint) ((rand() & 32767)/32767.0*max_value); which means with some luck it can return max_value itself. Luck happens, rnd returns 5000, key3[n3] reads something entirely wrong (in my case the value of 'silent' variable which is int and set to 1 as the unit test is launched with -s), the entire condition check with key3[n3] gets twisted, the bogus error occurs. The following change fixes the problem for me, although maybe there are more elegant solutions. === modified file 'storage/maria/ma_test2.c' --- storage/maria/ma_test2.c 2011-02-25 12:55:40 +0000 +++ storage/maria/ma_test2.c 2012-04-20 10:05:45 +0000 @@ -259,7 +259,7 @@ for (i=0 ; i < recant ; i++) { ulong blob_length; - n1=rnd(1000); n2=rnd(100); n3=rnd(5000); + n1=rnd(1000); n2=rnd(100); n3=rnd(4999); sprintf((char*) record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); int4store(record+STANDARD_LENGTH-4,(long) i); fix_length(record,(uint) STANDARD_LENGTH+rnd(60)); Regards, Elena
On 4/19/2012 10:30 PM, Elena Stepanova wrote:
Hi,
My build tool runs 'make test-unit' and the following errors appear.
[16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... 73/830 Failed test '../storage/maria/unittest/../ma_test2 -s -htmp -m10000 -e4096 -K ' (loop iteration 8.) at line 316 (errcode: 256, test: 83)
From what I see, ma_test2 has the array key3[5000], used in a loop which sets n3=rnd(5000); and then reads key3[n3] == ...
while rnd(uint max_value) is return (uint) ((rand() & 32767)/32767.0*max_value);
which means with some luck it can return max_value itself. Luck happens, rnd returns 5000, key3[n3] reads something entirely wrong (in my case the value of 'silent' variable which is int and set to 1 as the unit test is launched with -s), the entire condition check with key3[n3] gets twisted, the bogus error occurs.
That patch led me in the right direction. The attached patch also lists a second possible index issue below what you pointed out. I'll file a bug to get this included in the future. Brian
participants (2)
-
Brian Evans
-
Elena Stepanova