Your message dated Sat, 21 Nov 2020 00:19:06 +0000
with message-id <[email protected]>
and subject line Bug#975339: fixed in clinfo 3.0.20.11.20-1
has caused the Debian Bug report #975339,
regarding clinfo: Uninitialised value cause print of random characters
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
975339: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975339
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: clinfo
Version: 2.2.18.04.06-1
Severity: normal
Tags: patch
X-Debbugs-Cc: [email protected]

Hi,

I see that clinfo have a very strange result

if I run
$ clinfo

I don't note nothing unusual

if I run
$ clinfo > /tmp/clinfo.txt
$ cat /tmp/clinfo.txt
[...]
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   P�b�U
[...]

I noted that in the row clGetDeviceIDs there are "strange" characters, who 
don't show up if you run clinfo from xterm.

Each time I rerun clinfo those "strange" characters are different.

Note: this error make piglit fails

Note: I'm using Debian Bullseye (testing), so I have done all the the following 
on the testing source. I have see, when I have try to report the but the 1st 
time, that there is a new version in Sid, but looking at the source
https://sources.debian.org/src/clinfo/2.2.18.04.06-2/src/clinfo.c/
I believe that the bug is still present.

So I run valgind:

$ valgrind --track-origins=yes --leak-check=full  clinfo
[...]
  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
==17199== Conditional jump or move depends on uninitialised value(s)
==17199==    at 0x483BCE5: __strlen_sse2 (in 
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==17199==    by 0x48F0ECD: __vfprintf_internal (vfprintf-internal.c:1688)
==17199==    by 0x4990CC6: __printf_chk (printf_chk.c:33)
==17199==    by 0x115D0C: printf (stdio2.h:107)
==17199==    by 0x115D0C: checkNullGetDevices (clinfo.c:2739)
==17199==    by 0x116E6C: checkNullBehavior (clinfo.c:2917)
==17199==    by 0x10E70A: main (clinfo.c:3216)
==17199==  Uninitialised value was created by a heap allocation
==17199==    at 0x483877F: malloc (in 
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==17199==    by 0x115B5C: realloc_strbuf (strbuf.h:38)
==17199==    by 0x115B5C: checkNullGetDevices (clinfo.c:2655)
==17199==    by 0x116E6C: checkNullBehavior (clinfo.c:2917)
==17199==    by 0x10E70A: main (clinfo.c:3216)
==17199== 
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in 
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in 
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in 
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found 
in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in 
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in 
platform
[...]

I have try to investigate and I found that, as say valgrind, there are 
uninitialized variables.
---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--
--- clinfo-2.2.18.04.06/src/clinfo.c    2018-04-06 07:50:01.000000000 +0200
+++ src/clinfo.c        2020-11-20 17:40:36.453403905 +0100
@@ -100,6 +100,7 @@
        plist->dev_offset = NULL;
        plist->pdata = NULL;
        plist->platform_checks = NULL;
+       plist->max_sname_len=0; /* not initialized */
 }
 
 void plist_devs_reserve(struct platform_list *plist, cl_uint amount)
@@ -2653,6 +2654,8 @@
        cl_uint numdevs = 0;
 
        INIT_RET(ret, "null get devices");
+       (&ret.err_str)->buf[0]='\0';
+       (&ret.str)->buf[0]='\0';
 
        reset_loc(&loc, __func__);
        loc.sname = "device IDs";
---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--

the first one is an uninitialized values that don't cause the problem above.
As you can see I have made a fast initialization to check if this solve the 
problem. For sure the upstream will do a better job.
Probably it was better to wrote "ret.err_str.>buf[0]='\0';" but I have started 
from the instruction that generate the error: RET_BUF(ret)->buf

After that valgrind report no more problem in that point, but the result of 
problems and possible problems are not zero:

$ valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all  clinfo
[...]
==110314== LEAK SUMMARY:
==110314==    definitely lost: 140 bytes in 4 blocks
==110314==    indirectly lost: 0 bytes in 0 blocks
==110314==      possibly lost: 1,600 bytes in 4 blocks
==110314==    still reachable: 250,744 bytes in 2,085 blocks
==110314==         suppressed: 32 bytes in 1 blocks
==110314== 
==110314== For lists of detected and suppressed errors, rerun with: -s
==110314== ERROR SUMMARY: 10 errors from 7 contexts (suppressed: 0 from 0)

Ciao
Davide


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.9.6-dp-20201119 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=it_IT.utf8, LC_CTYPE=it_IT.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages clinfo depends on:
ii  libc6                            2.31-4
ii  ocl-icd-libopencl1 [libopencl1]  2.2.13-1

clinfo recommends no packages.

clinfo suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: clinfo
Source-Version: 3.0.20.11.20-1
Done: Andreas Beckmann <[email protected]>

We believe that the bug you reported is fixed in the latest version of
clinfo, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Beckmann <[email protected]> (supplier of updated clinfo package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 21 Nov 2020 00:58:39 +0100
Source: clinfo
Architecture: source
Version: 3.0.20.11.20-1
Distribution: unstable
Urgency: medium
Maintainer: Debian OpenCL Maintainers <[email protected]>
Changed-By: Andreas Beckmann <[email protected]>
Closes: 975339
Changes:
 clinfo (3.0.20.11.20-1) unstable; urgency=medium
 .
   * New upstream release.  (Closes: #975339)
Checksums-Sha1:
 2e87c4185dadfbae245f5598227bc74469f6b0b0 2028 clinfo_3.0.20.11.20-1.dsc
 9361881830caf2dd5a79ce7f073597becd1a1612 49196 clinfo_3.0.20.11.20.orig.tar.gz
 7e14a5451aaa7cc1ae089fa801d5ca5af86545a5 5708 
clinfo_3.0.20.11.20-1.debian.tar.xz
 268e70da9db70e491d5a0539d89a76dc71af318c 5840 
clinfo_3.0.20.11.20-1_source.buildinfo
Checksums-Sha256:
 4aeed6a5c75ea1dec2f8c9903d995748702d62a9c0e92419a89e96a245e6040e 2028 
clinfo_3.0.20.11.20-1.dsc
 3c506083e72e9ee09fc7d5de513be7c5eff0284f198a60fb60ab493f6f0a549a 49196 
clinfo_3.0.20.11.20.orig.tar.gz
 36664529a2ef862bb72093e6fa56edbdb2d9501ce10b1db03354838ae230a0bd 5708 
clinfo_3.0.20.11.20-1.debian.tar.xz
 19f60440967ed32fae78fd8c1aa8dce803e0ece901768e4d8ca95ab4203b0971 5840 
clinfo_3.0.20.11.20-1_source.buildinfo
Files:
 6d15e1617126420b627d5f77a88ff8ce 2028 admin optional clinfo_3.0.20.11.20-1.dsc
 aaab525c67cf7ec3ce8870ed1a4f4dcd 49196 admin optional 
clinfo_3.0.20.11.20.orig.tar.gz
 986ee8f25fce37e86444d5826ff0d96a 5708 admin optional 
clinfo_3.0.20.11.20-1.debian.tar.xz
 8aa849d8aacecdf9a63e9bd80fac3e21 5840 admin optional 
clinfo_3.0.20.11.20-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE6/MKMKjZxjvaRMaUX7M/k1np7QgFAl+4WOIQHGFuYmVAZGVi
aWFuLm9yZwAKCRBfsz+TWentCIkpD/wK/sKP5Ea2jcJQkUrKHsSiyT+DnWFeQxYN
R/ZNm691URXCMaodsol9/Wnvw4xJ7NTCZVJhwRrCrPLrH14+nxg8xdmsRgWE9o32
68u/vl+IUOnkst+OUD2KrZ8/WXNQxZ4OKKwF5yilygvcw/zTx4PSxU8aT1rs+5zZ
VdnLrO/UBCeaUPp4wcJx1FoBrubgGhnHwc5ng7C11qv4BzOKsfykSyCtJvBZsXu+
/sDMSUxzx/Mk6qFWmWsRLuvyXpfn2XJO6Gb/WL1U68K5AZac3aA9+toZlmnaIuJc
Ldw9mjxslndoyuV1tQS1tGb+VIpxHnyAoKf2UWy3jAD4LEn6FWpKllJW9aq/SFmf
JX8fW76csRdw0QTZVfwEXdauc1/4lTilE2P4NMfsvvDBAU4lLnt59sMigYeCdgo7
YTtJkzzZzNLQbTaCMuF8YMzze666HMu1quCQ1jWQRtU4i6rbkVM8m3YBu020x+mX
SsUqcLc8fZGHO6sf1UCValyP77bQorUWlQDPfnA0RLhnSF6LTiJMTzfQPGIXH1AV
IhOE2ku1UO+/J+EeEmsBj4T7fllzdHm0AHoI1cVaNjz/V85Qyw7r9F+h5ggL9hLG
7MYGOS91CBo6w1os5RNqoJQAFxASn+OfZ4oaalPjhPgUW/q6LMWB4hv87Ft9oGe3
bsJVSdi3Rg==
=YJqh
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to