From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH -rc] gcov: Protect from uninitialized number of functions provided by GCC
Date: Fri, 28 Aug 2020 05:08:09 +0800 [thread overview]
Message-ID: <202008280403.LLYe8qx5%lkp@intel.com> (raw)
In-Reply-To: <20200827133932.3338519-1-leon@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 4564 bytes --]
Hi Leon,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on hnaz-linux-mm/master]
[also build test ERROR on linux/master linus/master v5.9-rc2 next-20200827]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Leon-Romanovsky/gcov-Protect-from-uninitialized-number-of-functions-provided-by-GCC/20200827-214008
base: https://github.com/hnaz/linux-mm master
config: m68k-randconfig-s032-20200827 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
kernel/gcov/gcc_4_7.c: In function 'gcov_info_dup':
>> kernel/gcov/gcc_4_7.c:284:19: error: 'i' undeclared (first use in this function)
284 | for (fi_idx = 0; i < GCOV_COUNTERS; i++)
| ^
kernel/gcov/gcc_4_7.c:284:19: note: each undeclared identifier is reported only once for each function it appears in
# https://github.com/0day-ci/linux/commit/9087d4a9ebf3be8ae595ecef237b57270d78b4cb
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Leon-Romanovsky/gcov-Protect-from-uninitialized-number-of-functions-provided-by-GCC/20200827-214008
git checkout 9087d4a9ebf3be8ae595ecef237b57270d78b4cb
vim +/i +284 kernel/gcov/gcc_4_7.c
260
261 /**
262 * gcov_info_dup - duplicate profiling data set
263 * @info: profiling data set to duplicate
264 *
265 * Return newly allocated duplicate on success, %NULL on error.
266 */
267 struct gcov_info *gcov_info_dup(struct gcov_info *info)
268 {
269 struct gcov_info *dup;
270 struct gcov_ctr_info *dci_ptr; /* dst counter info */
271 struct gcov_ctr_info *sci_ptr; /* src counter info */
272 unsigned int active;
273 unsigned int fi_idx; /* function info idx */
274 unsigned int ct_idx; /* counter type idx */
275 size_t fi_size; /* function info size */
276 size_t cv_size; /* counter values size */
277
278 dup = kzalloc(sizeof(*dup), GFP_KERNEL);
279 if (!dup)
280 return NULL;
281
282 dup->version = info->version;
283 dup->stamp = info->stamp;
> 284 for (fi_idx = 0; i < GCOV_COUNTERS; i++)
285 dup->merge[i] = info->merge[i];
286 dup->n_functions = info->n_functions;
287
288 dup->filename = kstrdup_const(info->filename, GFP_KERNEL);
289 if (!dup->filename)
290 goto err_free;
291
292 dup->functions =
293 kcalloc(info->n_functions, sizeof(struct gcov_fn_info *),
294 GFP_KERNEL | __GFP_NOWARN);
295 if (!dup->functions)
296 goto err_free;
297
298 active = num_counter_active(info);
299 fi_size = sizeof(struct gcov_fn_info);
300 fi_size += sizeof(struct gcov_ctr_info) * active;
301
302 for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) {
303 dup->functions[fi_idx] = kzalloc(fi_size, GFP_KERNEL);
304 if (!dup->functions[fi_idx])
305 goto err_free;
306
307 *(dup->functions[fi_idx]) = *(info->functions[fi_idx]);
308
309 sci_ptr = info->functions[fi_idx]->ctrs;
310 dci_ptr = dup->functions[fi_idx]->ctrs;
311
312 for (ct_idx = 0; ct_idx < active; ct_idx++) {
313
314 cv_size = sizeof(gcov_type) * sci_ptr->num;
315
316 dci_ptr->values = vmalloc(cv_size);
317
318 if (!dci_ptr->values)
319 goto err_free;
320
321 dci_ptr->num = sci_ptr->num;
322 memcpy(dci_ptr->values, sci_ptr->values, cv_size);
323
324 sci_ptr++;
325 dci_ptr++;
326 }
327 }
328
329 return dup;
330 err_free:
331 gcov_info_free(dup);
332 return NULL;
333 }
334
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 22846 bytes --]
next prev parent reply other threads:[~2020-08-27 21:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-27 13:39 [RFC PATCH -rc] gcov: Protect from uninitialized number of functions provided by GCC Leon Romanovsky
2020-08-27 15:13 ` Leon Romanovsky
2020-08-27 21:08 ` kernel test robot [this message]
2020-08-29 14:12 ` Colin Ian King
2020-08-30 6:45 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202008280403.LLYe8qx5%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.