All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [V2 i-g-t] tests/kms_cursor_crc: Fix SIGABRT in dynamic subtests
Date: Tue, 15 Nov 2022 10:22:26 +0530	[thread overview]
Message-ID: <4dec50df-8e99-a983-bbc3-fc043ad26b3a@intel.com> (raw)
In-Reply-To: <878rkdpadj.wl-ashutosh.dixit@intel.com>

Hi Ashutosh,

On Tue-15-11-2022 01:38 am, Dixit, Ashutosh wrote:
> On Thu, 03 Nov 2022 19:00:05 -0700, Bhanuprakash Modem wrote:
>>
> 
> Hi Bhanu, could you please fix the compile warnings below. Thanks.
> 
> 
>> @@ -700,65 +700,78 @@ static void test_rapid_movement(data_t *data)
>> 	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>   }
>>
>> -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>> -			   int w, int h)
>> +static void run_size_tests(data_t *data, int w, int h)
>>   {
>> 	enum pipe pipe;
>> +	struct {
>> +		const char *name;
>> +		void (*testfunc)(data_t *);
>> +		const char *desc;
>> +	} size_tests[] = {
>> +		{ "cursor-onscreen", test_crc_onscreen,
>> +			"Check if a given-size cursor is well-positioned inside the screen." },
>> +		{ "cursor-offscreen", test_crc_offscreen,
>> +			"Check if a given-size cursor is well-positioned outside the screen." },
>> +		{ "cursor-sliding", test_crc_sliding,
>> +			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>> +		{ "cursor-random", test_crc_random,
>> +			"Check random placement of a cursor with given size." },
>> +		{ "cursor-rapid-movement", test_rapid_movement,
>> +			"Check the rapid update of given-size cursor movements." },
>> +	};
>> +	int i;
>> +	char name[16];
>>
>> 	if (w == 0 && h == 0) {
>> 		w = data->cursor_max_w;
>> 		h = data->cursor_max_h;
>>
>> -		/*
>> -		 * No point in doing the "max-size" test if
>> -		 * it was already covered by the other tests.
>> -		 */
>> -		if ((w == h) && (w <= 512) && (h <= 512) &&
>> -		    is_power_of_two(w) && is_power_of_two(h)) {
>> -			igt_info("Cursor max size %dx%d already covered by other tests\n", w, h);
>> -			return;
>> -		}
>> +		strcpy(name, "max-size");
>> +	} else {
>> +		snprintf(name, sizeof(name), "%dx%d", w, h);
> 
> [305/1132] Compiling C object tests/kms_cursor_crc.p/kms_cursor_crc.c.o
> ../tests/kms_cursor_crc.c: In function ‘run_size_tests.constprop’:
> ../tests/kms_cursor_crc.c:731:50: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 4 and 14 [-Wformat-truncation=]
>    731 |                 snprintf(name, sizeof(name), "%dx%d", w, h);
>        |                                                  ^~
> ../tests/kms_cursor_crc.c:731:46: note: directive argument in the range [-2147483648, 1024]
>    731 |                 snprintf(name, sizeof(name), "%dx%d", w, h);
>        |                                              ^~~~~~~

Somehow this warning is not coming in local workspace, also not caught 
in CI.
It seems, -Wformat-truncation flag is missing.

$ meson -Drunner=enabled build && ninja -C build && ninja -C build test

truncated...

Compiler for C supports arguments -Wbad-function-cast: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wimplicit-fallthrough=0: YES
Compiler for C supports arguments -Wlogical-op: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wredundant-decls: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wuninitialized: YES
Compiler for C supports arguments -Wunused: YES
Compiler for C supports arguments -Wno-clobbered: YES
Compiler for C supports arguments -Wno-maybe-uninitialized: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-pointer-arith: YES
Compiler for C supports arguments -Wno-address-of-packed-member: YES
Compiler for C supports arguments -Wno-sign-compare: YES
Compiler for C supports arguments -Wno-type-limits: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -Wno-unused-result: YES
Compiler for C supports arguments -Werror=address: YES
Compiler for C supports arguments -Werror=array-bounds: YES
Compiler for C supports arguments -Werror=implicit: YES
Compiler for C supports arguments -Werror=init-self: YES
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES
Compiler for C supports arguments -Werror=main: YES
Compiler for C supports arguments -Werror=missing-braces: YES
Compiler for C supports arguments -Werror=nonnull: YES
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=sequence-point: YES
Compiler for C supports arguments -Werror=trigraphs: YES
Compiler for C supports arguments -Werror=write-strings: YES
Compiler for C supports arguments -fno-builtin-malloc: YES
Compiler for C supports arguments -fno-builtin-calloc: YES
Compiler for C supports arguments -fcommon: YES

truncated...

Compiler for C supports arguments -Wno-declaration-after-statement: YES
Compiler for C supports arguments -Wno-discarded-qualifiers: YES
Compiler for C supports arguments -Wno-missing-format-attribute: YES
Compiler for C supports arguments -Wno-old-style-definition: YES
Compiler for C supports arguments -Wno-redundant-decls: YES
Compiler for C supports arguments -Wno-shadow: YES
Compiler for C supports arguments 
-Wno-incompatible-pointer-types-discards-qualifiers: NO

truncated...

Found ninja-1.10.0 at /usr/bin/ninja
ninja: Entering directory `build'
[1234/1234] Linking target tests/core_hotunplug
ninja: Entering directory `build'

truncated...

Ok:                 332
Expected Fail:      4
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

- Bhanu

> In file included from /usr/include/stdio.h:894,
> 		 from ../lib/igt_core.h:41,
> 		 from ../lib/drmtest.h:39,
> 		 from ../lib/igt.h:27,
> 		 from ../tests/kms_cursor_crc.c:25:
> In function ‘snprintf’,
>      inlined from ‘run_size_tests.constprop’ at ../tests/kms_cursor_crc.c:731:3:
> /usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 4 and 24 bytes into a destination of size 16
>     71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
>        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     72 |                                    __glibc_objsize (__s), __fmt,
>        |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     73 |                                    __va_arg_pack ());
>        |                                    ~~~~~~~~~~~~~~~~~

  reply	other threads:[~2022-11-15  4:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 11:04 [igt-dev] [i-g-t] tests/kms_cursor_crc: Fix SIGABRT in dynamic subtests Bhanuprakash Modem
2022-11-02 12:11 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2022-11-02 12:28 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-11-02 17:32 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-04  2:00 ` [igt-dev] [V2 i-g-t] " Bhanuprakash Modem
2022-11-07  5:36   ` Modem, Bhanuprakash
2022-11-08 16:19     ` aemad
2022-11-08 16:21     ` aemad
2022-11-07 22:47   ` Melissa Wen
2022-11-08 16:18     ` Melissa Wen
2022-11-14 20:08   ` Dixit, Ashutosh
2022-11-15  4:52     ` Modem, Bhanuprakash [this message]
2022-11-04  2:55 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: Fix SIGABRT in dynamic subtests (rev2) Patchwork
2022-11-04 20:49 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=4dec50df-8e99-a983-bbc3-fc043ad26b3a@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.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.