All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes
@ 2019-01-16 11:20 Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
                   ` (27 more replies)
  0 siblings, 28 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Rodrigo Siqueira, Tvrtko Ursulin, Robert Foss

A random mishmash of changes based on static analysis results.

Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Petri Latvala (21):
  lib: Introduce igt_assume()
  lib/i915/gem_context: Help static analysis with execution flow
  lib/ioctl_wrappers: Help static analysis with execution flow
  lib/igt_kms: Use correct type for calloc
  tests: Use correct type for calloc
  lib: Avoid memcpying 0 bytes from NULL
  overlay: Write out the assumption for kernel-provided data
  benchmarks/wsim: Handle a parse error
  lib/igt_kms: Make igt_display_init require at least one plane
  tests/kms_color: Assert gamma look up table sizes
  lib/igt_kms: Assert that active crtcs have at least one plane
  benchmarks/gem_userptr_benchmark: Correctly free memory
  lib/igt_alsa: Remove dead assignment
  lib/igt_audio: Initialize freq in audio_signal_detect()
  igt_aux: Handle empty pm_test file gracefully
  lib/igt_core: Assert that optarg is present
  lib/igt_core: Handle all failures to read .igtrc
  lib/igt_core: Initialize fds in igt_system_quiet
  lib/igt_kms: Aid static analyzer with the control flow
  lib/igt_x86: Mock-use variable to silence static analysis
  lib/drmtest: Don't read from NULL in set_forced_driver

 benchmarks/gem_userptr_benchmark.c |  5 +++--
 benchmarks/gem_wsim.c              |  8 ++++++++
 lib/drmtest.c                      |  4 +++-
 lib/i915/gem_context.c             |  6 ++++--
 lib/igt_alsa.c                     |  2 --
 lib/igt_audio.c                    |  2 +-
 lib/igt_aux.c                      |  3 +++
 lib/igt_core.c                     | 10 ++++++----
 lib/igt_core.h                     | 15 +++++++++++++++
 lib/igt_kmod.c                     |  1 +
 lib/igt_kms.c                      |  5 +++--
 lib/igt_x86.c                      |  2 ++
 lib/ioctl_wrappers.c               | 12 +++++++++---
 overlay/gpu-perf.c                 |  1 +
 tests/kms_color.c                  | 13 +++++++++++--
 tests/kms_concurrent.c             |  2 +-
 tests/kms_plane_multiple.c         |  2 +-
 17 files changed, 72 insertions(+), 21 deletions(-)

-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume()
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 14:26   ` Chris Wilson
  2019-01-18 10:34   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
                   ` (26 subsequent siblings)
  27 siblings, 2 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

igt_assume() is an assert-like macro that is used to give hints to
static analysis of code. If static analysis is not used (as detected
by STATIC_ANALYSIS_BUILD), igt_assume() expands to a no-op statement,
otherwise expands to an assert().

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 lib/igt_core.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index 6f8c3852..82ec7973 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -30,6 +30,7 @@
 #ifndef IGT_CORE_H
 #define IGT_CORE_H
 
+#include <assert.h>
 #include <setjmp.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -54,6 +55,20 @@
 #endif
 #endif
 
+/**
+ * igt_assume:
+ * @expr: Condition to test
+ *
+ * An assert-like macro to be used for tautologies to give hints to
+ * static analysis of code. No-op if STATIC_ANALYSIS_BUILD is not
+ * defined, expands to an assert() if it is.
+ */
+#if STATIC_ANALYSIS_BUILD
+#define igt_assume(e) assert(e)
+#else
+#define igt_assume(e) do {} while(0)
+#endif
+
 extern const char* __igt_test_description __attribute__((weak));
 extern bool __igt_plain_output;
 extern char *igt_frame_dump_path;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 11:30   ` Chris Wilson
                     ` (2 more replies)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
                   ` (25 subsequent siblings)
  27 siblings, 3 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If an igt_ioctl fails, errno is set to non-zero, and static analysis
doesn't quite get it. Add an igt_assume() to help.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 lib/i915/gem_context.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/i915/gem_context.c b/lib/i915/gem_context.c
index 669bd318..781dea00 100644
--- a/lib/i915/gem_context.c
+++ b/lib/i915/gem_context.c
@@ -82,8 +82,10 @@ int __gem_context_create(int fd, uint32_t *ctx_id)
        memset(&create, 0, sizeof(create));
        if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create) == 0)
                *ctx_id = create.ctx_id;
-       else
-               err = -errno;
+       else {
+	       err = -errno;
+	       igt_assume(err != 0);
+       }
 
        errno = 0;
        return err;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: Help static analysis with execution flow
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
                   ` (24 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If an ioctl fails, errno is set to non-zero, and static analysis
doesn't quite get it. Add igt_assume()s where applicable.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 lib/ioctl_wrappers.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 9f255508..3fb57893 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -549,8 +549,10 @@ int __gem_create(int fd, uint64_t size, uint32_t *handle)
 
 	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create) == 0)
 		*handle = create.handle;
-	else
+	else {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 
 	errno = 0;
 	return err;
@@ -586,8 +588,10 @@ uint32_t gem_create(int fd, uint64_t size)
 int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 	errno = 0;
 	return err;
 }
@@ -616,8 +620,10 @@ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR, execbuf))
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR, execbuf)) {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 	errno = 0;
 	return err;
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (2 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-17  9:55   ` Abdiel Janulgue
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
                   ` (23 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The type mismatch was char vs. unsigned char, both being size 1 so
this didn't cause any actual issues other than noise in static
analysis that doesn't believe 1 is equal to another type of 1.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 684a599c..f926eafb 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1234,7 +1234,7 @@ init_cea_block(const unsigned char *edid, size_t length,
 
 	*new_length = length + 128;
 
-	new_edid.data = calloc(*new_length, sizeof(char));
+	new_edid.data = calloc(*new_length, sizeof(*new_edid.data));
 	igt_assert_f(new_edid.data, "Failed to allocate %zu bytes for edid\n", sizeof(new_length));
 	memcpy(new_edid.data, edid, length);
 	*new_edid_ptr = new_edid.data;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 05/21] tests: Use correct type for calloc
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (3 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 11:28   ` Kahola, Mika
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
                   ` (22 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

No actual difference, size of a pointer is the same as
pointer-to-pointer.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_concurrent.c     | 2 +-
 tests/kms_plane_multiple.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index c17b1fe6..af8ca70c 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -61,7 +61,7 @@ static void test_init(data_t *data, enum pipe pipe, int n_planes,
 	igt_plane_t *primary;
 	int ret;
 
-	data->plane = calloc(n_planes, sizeof(data->plane));
+	data->plane = calloc(n_planes, sizeof(*data->plane));
 	igt_assert_f(data->plane != NULL, "Failed to allocate memory for planes\n");
 
 	data->fb = calloc(n_planes, sizeof(struct igt_fb));
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 41024cb2..617054d9 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -69,7 +69,7 @@ static void test_init(data_t *data, enum pipe pipe, int n_planes)
 {
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
 
-	data->plane = calloc(n_planes, sizeof(data->plane));
+	data->plane = calloc(n_planes, sizeof(*data->plane));
 	igt_assert_f(data->plane != NULL, "Failed to allocate memory for planes\n");
 
 	data->fb = calloc(n_planes, sizeof(struct igt_fb));
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (4 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-17 11:14   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Petri Latvala
                   ` (21 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The behaviour of memcpying 0 bytes from NULL is semantically sound,
but still undefined behaviour.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 50d6008f..7c727edc 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -728,8 +728,9 @@ static int common_init(int *argc, char **argv,
 	all_opt_count += ARRAY_SIZE(long_options);
 
 	combined_opts = malloc(all_opt_count * sizeof(*combined_opts));
-	memcpy(combined_opts, extra_long_opts,
-	       extra_opt_count * sizeof(*combined_opts));
+	if (extra_opt_count > 0)
+		memcpy(combined_opts, extra_long_opts,
+		       extra_opt_count * sizeof(*combined_opts));
 
 	/* Copy the subtest long options (and the final NULL entry) */
 	memcpy(&combined_opts[extra_opt_count], long_options,
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (5 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-28 13:21   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
                   ` (20 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The code assumes (correctly) that perf_event_header's size is
non-zero. Write that out so static analysis also knows it.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 overlay/gpu-perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index 5629f826..7addd78d 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -494,6 +494,7 @@ int gpu_perf_update(struct gpu_perf *gp)
 			const struct perf_event_header *header;
 
 			header = (const struct perf_event_header *)(data + (tail & mask));
+			assert(header->size > 0);
 			if (header->size > head - tail)
 				break;
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (6 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 11:45   ` Tvrtko Ursulin
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
                   ` (19 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Tvrtko Ursulin

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_wsim.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index e0709487..5a4753d9 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -483,6 +483,14 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w)
 				goto add_step;
 			}
 
+			if (!field) {
+				if (verbose)
+					fprintf(stderr,
+						"Parse error at step %u!\n",
+						nr_steps);
+				return NULL;
+			}
+
 			tmp = atoi(field);
 			if (tmp < 0) {
 				if (verbose)
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (7 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 17:11   ` Robert Foss
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
                   ` (18 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Robert Foss, Petri Latvala

Not only will the following calloc call end up allocating 0 bytes
(undefined behaviour), but last_plane becomes (uint8_t)-1.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index f926eafb..b06acb2b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1932,7 +1932,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 			drmModeFreePlane(drm_plane);
 		}
 
-		igt_assert_lte(0, n_planes);
+		igt_assert_lt(0, n_planes);
 		pipe->planes = calloc(sizeof(igt_plane_t), n_planes);
 		igt_assert_f(pipe->planes, "Failed to allocate memory for %d planes\n", n_planes);
 		last_plane = n_planes - 1;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (8 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-28 13:04   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
                   ` (17 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If the properties for gamma tables exist, their sizes must be
non-zero.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/kms_color.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 913c70ca..decf3c2a 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -124,9 +124,13 @@ static void paint_rectangles(data_t *data,
 
 static double *generate_table(uint32_t lut_size, double exp)
 {
-	double *coeffs = malloc(sizeof(double) * lut_size);
+	double *coeffs;
 	uint32_t i;
 
+	igt_assert_lt(0, lut_size);
+
+	coeffs = malloc(sizeof(double) * lut_size);
+
 	for (i = 0; i < lut_size; i++)
 		coeffs[i] = powf((double) i * 1.0 / (double) (lut_size - 1), exp);
 
@@ -135,9 +139,12 @@ static double *generate_table(uint32_t lut_size, double exp)
 
 static double *generate_table_max(uint32_t lut_size)
 {
-	double *coeffs = malloc(sizeof(double) * lut_size);
+	double *coeffs;
 	uint32_t i;
 
+	igt_assert_lt(0, lut_size);
+
+	coeffs = malloc(sizeof(double) * lut_size);
 	coeffs[0] = 0.0;
 	for (i = 1; i < lut_size; i++)
 		coeffs[i] = 1.0;
@@ -868,6 +875,8 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 			igt_pipe_obj_get_prop(&data->display.pipes[p],
 					      IGT_CRTC_GAMMA_LUT_SIZE);
 
+		igt_assert_lt(0, data->degamma_lut_size);
+		igt_assert_lt(0, data->gamma_lut_size);
 		igt_display_require_output_on_pipe(&data->display, p);
 	}
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (9 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 11:30   ` Kahola, Mika
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Robert Foss, Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b06acb2b..1a91791c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1593,6 +1593,7 @@ static void kmstest_get_crtc(int device, enum pipe pipe, struct kmstest_crtc *cr
 
 				n = ftell(file);
 				crtc->n_planes = parse_planes(file, NULL);
+				igt_assert_lt(0, crtc->n_planes);
 				crtc->planes = calloc(crtc->n_planes, sizeof(*crtc->planes));
 				igt_assert_f(crtc->planes, "Failed to allocate memory for %d planes\n", crtc->n_planes);
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (10 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 11:48   ` Tvrtko Ursulin
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
                   ` (15 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Tvrtko Ursulin

if (p) free(p) does a useless check, free(NULL) is a valid call. Also
assign NULL so we don't end up double-freeing memory if anyone
reorders nr_bos to have a 0 after other values.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_userptr_benchmark.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
index f7716dfa..bef2ccc4 100644
--- a/benchmarks/gem_userptr_benchmark.c
+++ b/benchmarks/gem_userptr_benchmark.c
@@ -355,8 +355,9 @@ static void test_impact_overlap(int fd, const char *prefix)
 
 		for (i = 0; i < nr_bos[subtest]; i++)
 			gem_close(fd, handles[i]);
-		if (block)
-			free(block);
+
+		free(block);
+		block = NULL;
 	}
 }
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (11 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 14:14   ` Paul Kocialkowski
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
                   ` (14 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The execution can only reach the end (goto complete) or the new
unconditional assignment a few lines below before the value is read
again. Either it's really a dead assignment, or there's a bug with the
execution flow. Leaning on the former.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 lib/igt_alsa.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
index 3ad0521a..bb6682cc 100644
--- a/lib/igt_alsa.c
+++ b/lib/igt_alsa.c
@@ -523,8 +523,6 @@ int alsa_run(struct alsa *alsa, int duration_ms)
 			reached = false;
 
 			if (!output_ready) {
-				output_ready = true;
-
 				for (i = 0; i < alsa->output_handles_count; i++)
 					output_counts[i] = 0;
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect()
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (12 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 14:16   ` Paul Kocialkowski
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
                   ` (13 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

It's not clear to the static analyzer that freq is assigned when
handling the previous frame and then used in the next. In fact, it
wasn't clear to me either before staring at the code for some
minutes. Initializing it to something makes both of us happier.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 lib/igt_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_audio.c b/lib/igt_audio.c
index 229ce6c6..a0592d53 100644
--- a/lib/igt_audio.c
+++ b/lib/igt_audio.c
@@ -250,7 +250,7 @@ bool audio_signal_detect(struct audio_signal *signal, int channels,
 	int threshold;
 	bool above;
 	int error;
-	int freq;
+	int freq = 0;
 	int max;
 	int c, i, j;
 
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (13 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-28 13:18   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
                   ` (12 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
---
 lib/igt_aux.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 1250d5c5..e9bf0728 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -718,6 +718,9 @@ static enum igt_suspend_test get_suspend_test(int power_dir)
 			break;
 		}
 
+	if (!test_name)
+		return SUSPEND_TEST_NONE;
+
 	for (test = SUSPEND_TEST_NONE; test < SUSPEND_TEST_NUM; test++)
 		if (strcmp(suspend_test_name[test], test_name) == 0)
 			break;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (14 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-17 12:17   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
                   ` (11 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If getopt_long is told an argument is required, it will give it.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 7c727edc..26dd2789 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -760,6 +760,7 @@ static int common_init(int *argc, char **argv,
 				list_subtests = true;
 			break;
 		case OPT_RUN_SUBTEST:
+			assert(optarg);
 			if (!list_subtests)
 				run_single_subtest = strdup(optarg);
 			break;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (15 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 14:18   ` Paul Kocialkowski
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
                   ` (10 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Parse error is not the only way to fail loading the file. A common
other error is the file not existing. Handle all failures to read
.igtrc by releasing the key store immediately.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 26dd2789..0cae9b6a 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -591,7 +591,7 @@ static void common_init_config(void)
 	igt_key_file = g_key_file_new();
 	ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
 					G_KEY_FILE_NONE, &error);
-	if (error && error->code == G_KEY_FILE_ERROR) {
+	if (!ret) {
 		g_error_free(error);
 		g_key_file_free(igt_key_file);
 		igt_key_file = NULL;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (16 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-17  9:56   ` Abdiel Janulgue
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
                   ` (9 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

This avoids calling close() with uninitialized ints if some dup()
calls succeed and others don't.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
 lib/igt_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 0cae9b6a..49fbf70d 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -2391,7 +2391,7 @@ err:
  */
 int igt_system_quiet(const char *command)
 {
-	int stderr_fd_copy, stdout_fd_copy, status, nullfd;
+	int stderr_fd_copy = -1, stdout_fd_copy = -1, status, nullfd = -1;
 
 	/* redirect */
 	if ((nullfd = open("/dev/null", O_WRONLY)) == -1)
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (17 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-28 13:17   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
                   ` (8 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If we first find n amount of ':' in a string, the amount is still n
when we walk through it the second time.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 lib/igt_kmod.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 22c26021..91662eb3 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -86,6 +86,7 @@ static struct kmod_ctx *kmod_ctx(void)
 
 		p = config_paths_str;
 		for (i = 0; i < count; ++i) {
+			igt_assert(p != NULL);
 			config_paths[i] = p;
 
 			if ((p = strchr(p, ':')))
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (18 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-28 13:11   ` Arkadiusz Hiler
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
                   ` (7 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

x86_features_to_string() uses a repeatable pattern that increments a
pointer for each feature string, leaving a dead assignment for the
last one. Add a (void)line to the end just to silence static analysis.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_x86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_x86.c b/lib/igt_x86.c
index cb1e0a72..88e514df 100644
--- a/lib/igt_x86.c
+++ b/lib/igt_x86.c
@@ -175,6 +175,8 @@ char *igt_x86_features_to_string(unsigned features, char *line)
 	if (features & AVX2)
 		line += sprintf(line, ", avx2");
 
+	(void)line;
+
 	return ret;
 }
 #endif
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (19 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
@ 2019-01-16 11:20 ` Petri Latvala
  2019-01-16 12:15   ` Rodrigo Siqueira
  2019-01-16 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes Patchwork
                   ` (6 subsequent siblings)
  27 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Rodrigo Siqueira

The only caller so far never passes NULL so no effects today.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/drmtest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 7c124ac6..1964795a 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -134,8 +134,10 @@ static char _forced_driver[16] = "";
  */
 void __set_forced_driver(const char *name)
 {
-	if (!name)
+	if (!name) {
 		igt_warn("No driver specified, keep default behaviour\n");
+		return;
+	}
 
 	strncpy(_forced_driver, name, sizeof(_forced_driver) - 1);
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 05/21] tests: Use correct type for calloc
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
@ 2019-01-16 11:28   ` Kahola, Mika
  0 siblings, 0 replies; 58+ messages in thread
From: Kahola, Mika @ 2019-01-16 11:28 UTC (permalink / raw)
  To: igt-dev, Latvala, Petri

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:
> No actual difference, size of a pointer is the same as
> pointer-to-pointer.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  tests/kms_concurrent.c     | 2 +-
>  tests/kms_plane_multiple.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
> index c17b1fe6..af8ca70c 100644
> --- a/tests/kms_concurrent.c
> +++ b/tests/kms_concurrent.c
> @@ -61,7 +61,7 @@ static void test_init(data_t *data, enum pipe pipe,
> int n_planes,
>  	igt_plane_t *primary;
>  	int ret;
>  
> -	data->plane = calloc(n_planes, sizeof(data->plane));
> +	data->plane = calloc(n_planes, sizeof(*data->plane));
>  	igt_assert_f(data->plane != NULL, "Failed to allocate memory
> for planes\n");
>  
>  	data->fb = calloc(n_planes, sizeof(struct igt_fb));
> diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
> index 41024cb2..617054d9 100644
> --- a/tests/kms_plane_multiple.c
> +++ b/tests/kms_plane_multiple.c
> @@ -69,7 +69,7 @@ static void test_init(data_t *data, enum pipe pipe,
> int n_planes)
>  {
>  	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
> INTEL_PIPE_CRC_SOURCE_AUTO);
>  
> -	data->plane = calloc(n_planes, sizeof(data->plane));
> +	data->plane = calloc(n_planes, sizeof(*data->plane));
>  	igt_assert_f(data->plane != NULL, "Failed to allocate memory
> for planes\n");
>  
>  	data->fb = calloc(n_planes, sizeof(struct igt_fb));
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
@ 2019-01-16 11:30   ` Chris Wilson
  2019-01-16 14:22   ` Chris Wilson
  2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
  2 siblings, 0 replies; 58+ messages in thread
From: Chris Wilson @ 2019-01-16 11:30 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Petri Latvala

Quoting Petri Latvala (2019-01-16 11:20:31)
> If an igt_ioctl fails, errno is set to non-zero, and static analysis
> doesn't quite get it. Add an igt_assume() to help.

Since we install a custom ioctl func, we could just state it returns
long / ERR_VALUE, matching the kernel ioctl syscall...
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
@ 2019-01-16 11:30   ` Kahola, Mika
  0 siblings, 0 replies; 58+ messages in thread
From: Kahola, Mika @ 2019-01-16 11:30 UTC (permalink / raw)
  To: igt-dev, Latvala, Petri; +Cc: robert.foss

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Robert Foss <robert.foss@collabora.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_kms.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index b06acb2b..1a91791c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1593,6 +1593,7 @@ static void kmstest_get_crtc(int device, enum
> pipe pipe, struct kmstest_crtc *cr
>  
>  				n = ftell(file);
>  				crtc->n_planes = parse_planes(file,
> NULL);
> +				igt_assert_lt(0, crtc->n_planes);
>  				crtc->planes = calloc(crtc->n_planes,
> sizeof(*crtc->planes));
>  				igt_assert_f(crtc->planes, "Failed to
> allocate memory for %d planes\n", crtc->n_planes);
>  
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
@ 2019-01-16 11:45   ` Tvrtko Ursulin
  2019-01-16 12:03     ` Petri Latvala
  0 siblings, 1 reply; 58+ messages in thread
From: Tvrtko Ursulin @ 2019-01-16 11:45 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Tvrtko Ursulin


On 16/01/2019 11:20, Petri Latvala wrote:
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   benchmarks/gem_wsim.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index e0709487..5a4753d9 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -483,6 +483,14 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w)
>   				goto add_step;
>   			}
>   
> +			if (!field) {

field has already been checked to be valid in this block:

		if ((field = strtok_r(fstart, ".", &fctx))) {

Regards,

Tvrtko

> +				if (verbose)
> +					fprintf(stderr,
> +						"Parse error at step %u!\n",
> +						nr_steps);
> +				return NULL;
> +			}
> +
>   			tmp = atoi(field);
>   			if (tmp < 0) {
>   				if (verbose)
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
@ 2019-01-16 11:48   ` Tvrtko Ursulin
  0 siblings, 0 replies; 58+ messages in thread
From: Tvrtko Ursulin @ 2019-01-16 11:48 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Tvrtko Ursulin


On 16/01/2019 11:20, Petri Latvala wrote:
> if (p) free(p) does a useless check, free(NULL) is a valid call. Also
> assign NULL so we don't end up double-freeing memory if anyone
> reorders nr_bos to have a 0 after other values.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   benchmarks/gem_userptr_benchmark.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
> index f7716dfa..bef2ccc4 100644
> --- a/benchmarks/gem_userptr_benchmark.c
> +++ b/benchmarks/gem_userptr_benchmark.c
> @@ -355,8 +355,9 @@ static void test_impact_overlap(int fd, const char *prefix)
>   
>   		for (i = 0; i < nr_bos[subtest]; i++)
>   			gem_close(fd, handles[i]);
> -		if (block)
> -			free(block);
> +
> +		free(block);
> +		block = NULL;
>   	}
>   }
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error
  2019-01-16 11:45   ` Tvrtko Ursulin
@ 2019-01-16 12:03     ` Petri Latvala
  2019-01-16 12:07       ` Chris Wilson
  2019-01-16 12:08       ` Tvrtko Ursulin
  0 siblings, 2 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-16 12:03 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: igt-dev, Tvrtko Ursulin

On Wed, Jan 16, 2019 at 11:45:38AM +0000, Tvrtko Ursulin wrote:
> 
> On 16/01/2019 11:20, Petri Latvala wrote:
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   benchmarks/gem_wsim.c | 8 ++++++++
> >   1 file changed, 8 insertions(+)
> > 
> > diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> > index e0709487..5a4753d9 100644
> > --- a/benchmarks/gem_wsim.c
> > +++ b/benchmarks/gem_wsim.c
> > @@ -483,6 +483,14 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w)
> >   				goto add_step;
> >   			}
> > +			if (!field) {
> 
> field has already been checked to be valid in this block:
> 
> 		if ((field = strtok_r(fstart, ".", &fctx))) {


field will be assigned again in the above if blocks. An example test
case for this is:

# cat foo.wsim
a

# gem_wsim_bench -n 1 -w foo.wsim
Segmentation fault


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error
  2019-01-16 12:03     ` Petri Latvala
@ 2019-01-16 12:07       ` Chris Wilson
  2019-01-16 12:08       ` Tvrtko Ursulin
  1 sibling, 0 replies; 58+ messages in thread
From: Chris Wilson @ 2019-01-16 12:07 UTC (permalink / raw)
  To: Petri Latvala, Tvrtko Ursulin; +Cc: igt-dev, Tvrtko Ursulin

Quoting Petri Latvala (2019-01-16 12:03:06)
> # gem_wsim_bench -n 1 -w foo.wsim
> Segmentation fault

Can we please fix the random name changes, surely meson is fixed now?
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error
  2019-01-16 12:03     ` Petri Latvala
  2019-01-16 12:07       ` Chris Wilson
@ 2019-01-16 12:08       ` Tvrtko Ursulin
  1 sibling, 0 replies; 58+ messages in thread
From: Tvrtko Ursulin @ 2019-01-16 12:08 UTC (permalink / raw)
  To: igt-dev, Tvrtko Ursulin; +Cc: Petri Latvala


On 16/01/2019 12:03, Petri Latvala wrote:
> On Wed, Jan 16, 2019 at 11:45:38AM +0000, Tvrtko Ursulin wrote:
>>
>> On 16/01/2019 11:20, Petri Latvala wrote:
>>> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> ---
>>>    benchmarks/gem_wsim.c | 8 ++++++++
>>>    1 file changed, 8 insertions(+)
>>>
>>> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
>>> index e0709487..5a4753d9 100644
>>> --- a/benchmarks/gem_wsim.c
>>> +++ b/benchmarks/gem_wsim.c
>>> @@ -483,6 +483,14 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w)
>>>    				goto add_step;
>>>    			}
>>> +			if (!field) {
>>
>> field has already been checked to be valid in this block:
>>
>> 		if ((field = strtok_r(fstart, ".", &fctx))) {
> 
> 
> field will be assigned again in the above if blocks. An example test
> case for this is:
> 
> # cat foo.wsim
> a
> 
> # gem_wsim_bench -n 1 -w foo.wsim
> Segmentation fault

Ah.. my bad. I need to improve this loop.. But fix is then definitely valid:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (20 preceding siblings ...)
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
@ 2019-01-16 12:12 ` Patchwork
  2019-01-16 22:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-16 12:12 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from IGT_4774 -> IGTPW_2245
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2245 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_hangcheck:
    - fi-icl-u3:          PASS -> INCOMPLETE [fdo#108569]

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@prime_vgem@basic-fence-flip:
    - fi-ilk-650:         PASS -> FAIL [fdo#104008]

  
#### Possible fixes ####

  * igt@kms_busy@basic-flip-a:
    - fi-gdg-551:         FAIL [fdo#103182] -> PASS

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       FAIL [fdo#108767] -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS +1

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271


Participating hosts (49 -> 44)
------------------------------

  Missing    (5): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 


Build changes
-------------

    * IGT: IGT_4774 -> IGTPW_2245

  CI_DRM_5434: f7277432c1bb671177bdef59755cb88c4ad9f75f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2245/
  IGT_4774: 8477ed9aeeaa8afb491d73a4c53d1b7dc64413c6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2245/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
@ 2019-01-16 12:15   ` Rodrigo Siqueira
  0 siblings, 0 replies; 58+ messages in thread
From: Rodrigo Siqueira @ 2019-01-16 12:15 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On 01/16, Petri Latvala wrote:
> The only caller so far never passes NULL so no effects today.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  lib/drmtest.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 7c124ac6..1964795a 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -134,8 +134,10 @@ static char _forced_driver[16] = "";
>   */
>  void __set_forced_driver(const char *name)
>  {
> -	if (!name)
> +	if (!name) {
>  		igt_warn("No driver specified, keep default behaviour\n");
> +		return;
> +	}
>  
>  	strncpy(_forced_driver, name, sizeof(_forced_driver) - 1);
>  }
> -- 
> 2.19.1
> 

Hi,

I tried to apply the patch, and it does not applied directly (I updated
my master before test). I got the following error:

 error: patch failed: lib/drmtest.c:134
 error: lib/drmtest.c: patch does not apply

Anyway, for me, everything is fine with the changes. Additionally, I
tested the patch with:

 Commands:

 IGT_FORCE_DRIVER=vkms ./tests/kms_flip  --run-subtest basic-flip-vs-wf_vblank
 IGT_FORCE_DRIVER= ./tests/kms_flip  --run-subtest basic-flip-vs-wf_vblank
 ./tests/kms_flip  --run-subtest basic-flip-vs-wf_vblank

 Environment:

 -> Qemu VM with Arch linux
 -> GPUs drivers: Bosch (card0) and vkms (card1)
 -> Kernel - 5.0.0-rc1

Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>

-- 
Rodrigo Siqueira
https://siqueira.tech
Graduate Student
Department of Computer Science
University of São Paulo
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
@ 2019-01-16 14:14   ` Paul Kocialkowski
  0 siblings, 0 replies; 58+ messages in thread
From: Paul Kocialkowski @ 2019-01-16 14:14 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

Hi,

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:
> The execution can only reach the end (goto complete) or the new
> unconditional assignment a few lines below before the value is read
> again. Either it's really a dead assignment, or there's a bug with the
> execution flow. Leaning on the former.

It is indeed a dead assignment and your understanding is correct!

Thanks for the fixup.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
>  lib/igt_alsa.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
> index 3ad0521a..bb6682cc 100644
> --- a/lib/igt_alsa.c
> +++ b/lib/igt_alsa.c
> @@ -523,8 +523,6 @@ int alsa_run(struct alsa *alsa, int duration_ms)
>  			reached = false;
>  
>  			if (!output_ready) {
> -				output_ready = true;
> -
>  				for (i = 0; i < alsa->output_handles_count; i++)
>  					output_counts[i] = 0;
>  
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect()
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
@ 2019-01-16 14:16   ` Paul Kocialkowski
  0 siblings, 0 replies; 58+ messages in thread
From: Paul Kocialkowski @ 2019-01-16 14:16 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:
> It's not clear to the static analyzer that freq is assigned when
> handling the previous frame and then used in the next. In fact, it
> wasn't clear to me either before staring at the code for some
> minutes. Initializing it to something makes both of us happier.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

> ---
>  lib/igt_audio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_audio.c b/lib/igt_audio.c
> index 229ce6c6..a0592d53 100644
> --- a/lib/igt_audio.c
> +++ b/lib/igt_audio.c
> @@ -250,7 +250,7 @@ bool audio_signal_detect(struct audio_signal *signal, int channels,
>  	int threshold;
>  	bool above;
>  	int error;
> -	int freq;
> +	int freq = 0;
>  	int max;
>  	int c, i, j;
>  
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
@ 2019-01-16 14:18   ` Paul Kocialkowski
  0 siblings, 0 replies; 58+ messages in thread
From: Paul Kocialkowski @ 2019-01-16 14:18 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:
> Parse error is not the only way to fail loading the file. A common
> other error is the file not existing. Handle all failures to read
> .igtrc by releasing the key store immediately.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

> ---
>  lib/igt_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 26dd2789..0cae9b6a 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -591,7 +591,7 @@ static void common_init_config(void)
>  	igt_key_file = g_key_file_new();
>  	ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
>  					G_KEY_FILE_NONE, &error);
> -	if (error && error->code == G_KEY_FILE_ERROR) {
> +	if (!ret) {
>  		g_error_free(error);
>  		g_key_file_free(igt_key_file);
>  		igt_key_file = NULL;
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
  2019-01-16 11:30   ` Chris Wilson
@ 2019-01-16 14:22   ` Chris Wilson
  2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
  2 siblings, 0 replies; 58+ messages in thread
From: Chris Wilson @ 2019-01-16 14:22 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Petri Latvala

Quoting Petri Latvala (2019-01-16 11:20:31)
> If an igt_ioctl fails, errno is set to non-zero, and static analysis
> doesn't quite get it. Add an igt_assume() to help.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> ---
>  lib/i915/gem_context.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/i915/gem_context.c b/lib/i915/gem_context.c
> index 669bd318..781dea00 100644
> --- a/lib/i915/gem_context.c
> +++ b/lib/i915/gem_context.c
> @@ -82,8 +82,10 @@ int __gem_context_create(int fd, uint32_t *ctx_id)
>         memset(&create, 0, sizeof(create));
>         if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create) == 0)
>                 *ctx_id = create.ctx_id;
> -       else
> -               err = -errno;
> +       else {
> +              err = -errno;
> +              igt_assume(err != 0);
> +       }

Just make sure each branch takes { } and
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
for the three (or how many nearly identical patches it was!).
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume()
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
@ 2019-01-16 14:26   ` Chris Wilson
  2019-01-18 10:34   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
  1 sibling, 0 replies; 58+ messages in thread
From: Chris Wilson @ 2019-01-16 14:26 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Petri Latvala

Quoting Petri Latvala (2019-01-16 11:20:30)
> igt_assume() is an assert-like macro that is used to give hints to
> static analysis of code. If static analysis is not used (as detected
> by STATIC_ANALYSIS_BUILD), igt_assume() expands to a no-op statement,
> otherwise expands to an assert().
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> ---
>  lib/igt_core.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/lib/igt_core.h b/lib/igt_core.h
> index 6f8c3852..82ec7973 100644
> --- a/lib/igt_core.h
> +++ b/lib/igt_core.h
> @@ -30,6 +30,7 @@
>  #ifndef IGT_CORE_H
>  #define IGT_CORE_H
>  
> +#include <assert.h>
>  #include <setjmp.h>
>  #include <stdbool.h>
>  #include <stdint.h>
> @@ -54,6 +55,20 @@
>  #endif
>  #endif
>  
> +/**
> + * igt_assume:
> + * @expr: Condition to test
> + *
> + * An assert-like macro to be used for tautologies to give hints to
> + * static analysis of code. No-op if STATIC_ANALYSIS_BUILD is not
> + * defined, expands to an assert() if it is.
> + */
> +#if STATIC_ANALYSIS_BUILD
> +#define igt_assume(e) assert(e)
> +#else
> +#define igt_assume(e) do {} while(0)
> +#endif

Fair enough. You should definitely steal

/*
 * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
 * expression but avoids the generation of any code, even if that expression
 * has side-effects.
 */
#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))

so that #else becomes
#define igt_assume(e) BUILD_BUG_ON_INVALID(e)
so that we plebs don't feed garbage to the static analyzer.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
@ 2019-01-16 17:11   ` Robert Foss
  0 siblings, 0 replies; 58+ messages in thread
From: Robert Foss @ 2019-01-16 17:11 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

Reviewed-by: Robert Foss <robert.foss@collabora.com>

On 1/16/19 12:20 PM, Petri Latvala wrote:
> Not only will the following calloc call end up allocating 0 bytes
> (undefined behaviour), but last_plane becomes (uint8_t)-1.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Robert Foss <robert.foss@collabora.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>   lib/igt_kms.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index f926eafb..b06acb2b 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1932,7 +1932,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>   			drmModeFreePlane(drm_plane);
>   		}
>   
> -		igt_assert_lte(0, n_planes);
> +		igt_assert_lt(0, n_planes);
>   		pipe->planes = calloc(sizeof(igt_plane_t), n_planes);
>   		igt_assert_f(pipe->planes, "Failed to allocate memory for %d planes\n", n_planes);
>   		last_plane = n_planes - 1;
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for Static analysis: misc cleanups and fixes
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (21 preceding siblings ...)
  2019-01-16 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes Patchwork
@ 2019-01-16 22:20 ` Patchwork
  2019-01-18 11:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4) Patchwork
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-16 22:20 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from IGT_4774_full -> IGTPW_2245_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2245_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_pwrite_pread@display-copy-performance:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]

  * igt@i915_suspend@shrink:
    - shard-glk:          NOTRUN -> DMESG-WARN [fdo#109244]

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-hsw:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
    - shard-glk:          PASS -> FAIL [fdo#108145]

  * igt@kms_content_protection@atomic:
    - shard-apl:          NOTRUN -> FAIL [fdo#108597]

  * igt@kms_cursor_crc@cursor-128x128-onscreen:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +2

  * igt@kms_cursor_crc@cursor-128x128-suspend:
    - shard-kbl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_cursor_crc@cursor-256x85-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +7

  * igt@kms_cursor_crc@cursor-64x21-onscreen:
    - shard-glk:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-sliding:
    - shard-glk:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
    - shard-glk:          NOTRUN -> FAIL [fdo#103167]
    - shard-apl:          PASS -> FAIL [fdo#103167] +1
    - shard-kbl:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
    - shard-glk:          PASS -> FAIL [fdo#103167] +9

  * igt@kms_plane@pixel-format-pipe-c-planes:
    - shard-glk:          NOTRUN -> FAIL [fdo#103166]

  * igt@kms_plane@plane-position-covered-pipe-c-planes:
    - shard-apl:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
    - shard-glk:          NOTRUN -> FAIL [fdo#108145] +1

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
    - shard-glk:          PASS -> FAIL [fdo#103166] +3

  * igt@perf_pmu@busy-idle-check-all-vcs0:
    - shard-snb:          PASS -> INCOMPLETE [fdo#105411] / [fdo#107469]

  * igt@sw_sync@sync_busy_fork:
    - shard-glk:          PASS -> INCOMPLETE [fdo#103359] / [k.org#198133]

  
#### Possible fixes ####

  * igt@gem_softpin@noreloc-s3:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS

  * igt@gem_sync@basic-all:
    - shard-snb:          INCOMPLETE [fdo#105411] -> PASS

  * igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
    - shard-glk:          FAIL [fdo#108145] -> PASS +1

  * igt@kms_color@pipe-b-degamma:
    - shard-kbl:          FAIL [fdo#104782] -> PASS
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-128x42-onscreen:
    - shard-glk:          FAIL [fdo#103232] -> PASS +6

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +3

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-kbl:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-blt:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-none:
    - shard-glk:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-apl:          FAIL [fdo#103166] -> PASS +4

  * igt@kms_universal_plane@universal-plane-pipe-b-functional:
    - shard-kbl:          FAIL [fdo#103166] -> PASS

  * igt@perf_pmu@rc6:
    - shard-kbl:          {SKIP} [fdo#109271] -> PASS

  
#### Warnings ####

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - shard-kbl:          FAIL [fdo#103191] / [fdo#103232] -> DMESG-WARN [fdo#103313]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#107469]: https://bugs.freedesktop.org/show_bug.cgi?id=107469
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108597]: https://bugs.freedesktop.org/show_bug.cgi?id=108597
  [fdo#109244]: https://bugs.freedesktop.org/show_bug.cgi?id=109244
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * IGT: IGT_4774 -> IGTPW_2245

  CI_DRM_5434: f7277432c1bb671177bdef59755cb88c4ad9f75f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2245: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2245/
  IGT_4774: 8477ed9aeeaa8afb491d73a4c53d1b7dc64413c6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2245/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
@ 2019-01-17  9:55   ` Abdiel Janulgue
  0 siblings, 0 replies; 58+ messages in thread
From: Abdiel Janulgue @ 2019-01-17  9:55 UTC (permalink / raw)
  To: Petri Latvala, igt-dev


On 01/16/2019 01:20 PM, Petri Latvala wrote:
> The type mismatch was char vs. unsigned char, both being size 1 so
> this didn't cause any actual issues other than noise in static
> analysis that doesn't believe 1 is equal to another type of 1.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>


Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>

> ---
>  lib/igt_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 684a599c..f926eafb 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1234,7 +1234,7 @@ init_cea_block(const unsigned char *edid, size_t length,
>  
>  	*new_length = length + 128;
>  
> -	new_edid.data = calloc(*new_length, sizeof(char));
> +	new_edid.data = calloc(*new_length, sizeof(*new_edid.data));
>  	igt_assert_f(new_edid.data, "Failed to allocate %zu bytes for edid\n", sizeof(new_length));
>  	memcpy(new_edid.data, edid, length);
>  	*new_edid_ptr = new_edid.data;
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
@ 2019-01-17  9:56   ` Abdiel Janulgue
  0 siblings, 0 replies; 58+ messages in thread
From: Abdiel Janulgue @ 2019-01-17  9:56 UTC (permalink / raw)
  To: Petri Latvala, igt-dev



On 01/16/2019 01:20 PM, Petri Latvala wrote:
> This avoids calling close() with uninitialized ints if some dup()
> calls succeed and others don't.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>


>  lib/igt_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 0cae9b6a..49fbf70d 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -2391,7 +2391,7 @@ err:
>   */
>  int igt_system_quiet(const char *command)
>  {
> -	int stderr_fd_copy, stdout_fd_copy, status, nullfd;
> +	int stderr_fd_copy = -1, stdout_fd_copy = -1, status, nullfd = -1;
>  
>  	/* redirect */
>  	if ((nullfd = open("/dev/null", O_WRONLY)) == -1)
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
@ 2019-01-17 11:14   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-17 11:14 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:35PM +0200, Petri Latvala wrote:
> The behaviour of memcpying 0 bytes from NULL is semantically sound,
> but still undefined behaviour.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
@ 2019-01-17 12:17   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-17 12:17 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:45PM +0200, Petri Latvala wrote:
> If getopt_long is told an argument is required, it will give it.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t v2 01/21] lib: Introduce igt_assume()
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
  2019-01-16 14:26   ` Chris Wilson
@ 2019-01-18 10:34   ` Petri Latvala
  2019-01-21 11:33     ` [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() Petri Latvala
  1 sibling, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-18 10:34 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

igt_assume() is an assert-like macro that is used to give hints to
static analysis of code. If static analysis is not used (as detected
by STATIC_ANALYSIS_BUILD), igt_assume() expands to a no-op statement,
otherwise expands to an assert().

v2: Make sure the expression in igt_assume is still parsed without
    static analysis. (Chris)

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 lib/igt_core.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index 6f8c3852..4fdac1b8 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -30,6 +30,7 @@
 #ifndef IGT_CORE_H
 #define IGT_CORE_H
 
+#include <assert.h>
 #include <setjmp.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -54,6 +55,21 @@
 #endif
 #endif
 
+/**
+ * igt_assume:
+ * @expr: Condition to test
+ *
+ * An assert-like macro to be used for tautologies to give hints to
+ * static analysis of code. No-op if STATIC_ANALYSIS_BUILD is not
+ * defined, expands to an assert() if it is.
+ */
+#if STATIC_ANALYSIS_BUILD
+#define igt_assume(e) assert(e)
+#else
+/* Make sure the expression is still parsed even though it generates no code */
+#define igt_assume(e) ((void)(sizeof((long)(e))))
+#endif
+
 extern const char* __igt_test_description __attribute__((weak));
 extern bool __igt_plain_output;
 extern char *igt_frame_dump_path;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t v2 02/21] lib/i915/gem_context: Help static analysis with execution flow
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
  2019-01-16 11:30   ` Chris Wilson
  2019-01-16 14:22   ` Chris Wilson
@ 2019-01-18 10:42   ` Petri Latvala
  2 siblings, 0 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-18 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If an igt_ioctl fails, errno is set to non-zero, and static analysis
doesn't quite get it. Add an igt_assume() to help.

v2: Braces on both branches of an if (Chris)

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/i915/gem_context.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/i915/gem_context.c b/lib/i915/gem_context.c
index 669bd318..16004685 100644
--- a/lib/i915/gem_context.c
+++ b/lib/i915/gem_context.c
@@ -80,10 +80,12 @@ int __gem_context_create(int fd, uint32_t *ctx_id)
        int err = 0;
 
        memset(&create, 0, sizeof(create));
-       if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create) == 0)
+       if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create) == 0) {
                *ctx_id = create.ctx_id;
-       else
-               err = -errno;
+       } else {
+	       err = -errno;
+	       igt_assume(err != 0);
+       }
 
        errno = 0;
        return err;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t v2 03/21] lib/ioctl_wrappers: Help static analysis with execution flow
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
@ 2019-01-18 10:42   ` Petri Latvala
  0 siblings, 0 replies; 58+ messages in thread
From: Petri Latvala @ 2019-01-18 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If an ioctl fails, errno is set to non-zero, and static analysis
doesn't quite get it. Add igt_assume()s where applicable.

v2: Braces on both branches of an if (Chris)

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/ioctl_wrappers.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 19e59794..404c2fbf 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -547,10 +547,12 @@ int __gem_create(int fd, uint64_t size, uint32_t *handle)
 	};
 	int err = 0;
 
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create) == 0)
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create) == 0) {
 		*handle = create.handle;
-	else
+	} else {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 
 	errno = 0;
 	return err;
@@ -586,8 +588,10 @@ uint32_t gem_create(int fd, uint64_t size)
 int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf)) {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 	errno = 0;
 	return err;
 }
@@ -616,8 +620,10 @@ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR, execbuf))
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR, execbuf)) {
 		err = -errno;
+		igt_assume(err != 0);
+	}
 	errno = 0;
 	return err;
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4)
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (22 preceding siblings ...)
  2019-01-16 22:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-01-18 11:22 ` Patchwork
  2019-01-18 12:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-18 11:22 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes (rev4)
URL   : https://patchwork.freedesktop.org/series/55289/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5447 -> IGTPW_2259
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_2259 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2259, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/4/mbox/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_2259:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7567u:       PASS -> WARN

  
Known issues
------------

  Here are the changes found in IGTPW_2259 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@cs-compute:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#108094]

  * igt@amdgpu/amd_prime@amd-to-i915:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#107341]

  * igt@i915_selftest@live_hangcheck:
    - fi-bwr-2160:        PASS -> DMESG-FAIL [fdo#108735]

  * igt@kms_busy@basic-flip-b:
    - fi-gdg-551:         PASS -> FAIL [fdo#103182]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       PASS -> DMESG-WARN [fdo#102614]

  
#### Possible fixes ####

  * igt@amdgpu/amd_basic@userptr:
    - fi-kbl-8809g:       DMESG-WARN [fdo#108965] -> PASS

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-blb-e6850:       INCOMPLETE [fdo#107718] -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#107362] -> PASS

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS +2

  * igt@prime_vgem@basic-fence-flip:
    - fi-ilk-650:         FAIL [fdo#104008] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
  [fdo#107341]: https://bugs.freedesktop.org/show_bug.cgi?id=107341
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
  [fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
  [fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278


Participating hosts (47 -> 44)
------------------------------

  Additional (1): fi-skl-6260u 
  Missing    (4): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan 


Build changes
-------------

    * IGT: IGT_4778 -> IGTPW_2259

  CI_DRM_5447: 1fb7b31e074e222be369480ecef1c5c3a48991c9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2259: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
  IGT_4778: 0c80bd7f2a964605f307e0220c6bb756685582b9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev4)
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (23 preceding siblings ...)
  2019-01-18 11:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4) Patchwork
@ 2019-01-18 12:44 ` Patchwork
  2019-01-18 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-18 12:44 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes (rev4)
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5447 -> IGTPW_2259
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/4/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2259 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@cs-compute:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#108094]

  * igt@amdgpu/amd_prime@amd-to-i915:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#107341]

  * igt@i915_selftest@live_hangcheck:
    - fi-bwr-2160:        PASS -> DMESG-FAIL [fdo#108735]

  * igt@kms_busy@basic-flip-b:
    - fi-gdg-551:         PASS -> FAIL [fdo#103182]

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7567u:       PASS -> WARN [fdo#109380]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       PASS -> DMESG-WARN [fdo#102614]

  
#### Possible fixes ####

  * igt@amdgpu/amd_basic@userptr:
    - fi-kbl-8809g:       DMESG-WARN [fdo#108965] -> PASS

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-blb-e6850:       INCOMPLETE [fdo#107718] -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#107362] -> PASS

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS +2

  * igt@prime_vgem@basic-fence-flip:
    - fi-ilk-650:         FAIL [fdo#104008] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
  [fdo#107341]: https://bugs.freedesktop.org/show_bug.cgi?id=107341
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
  [fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
  [fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109380]: https://bugs.freedesktop.org/show_bug.cgi?id=109380


Participating hosts (47 -> 44)
------------------------------

  Additional (1): fi-skl-6260u 
  Missing    (4): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan 


Build changes
-------------

    * IGT: IGT_4778 -> IGTPW_2259

  CI_DRM_5447: 1fb7b31e074e222be369480ecef1c5c3a48991c9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2259: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
  IGT_4778: 0c80bd7f2a964605f307e0220c6bb756685582b9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for Static analysis: misc cleanups and fixes (rev4)
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (24 preceding siblings ...)
  2019-01-18 12:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2019-01-18 17:48 ` Patchwork
  2019-01-21 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5) Patchwork
  2019-01-21 16:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-18 17:48 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes (rev4)
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5447_full -> IGTPW_2259_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/4/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2259_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_cursor_crc@cursor-64x21-onscreen:
    - shard-glk:          PASS -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +3

  * igt@kms_cursor_crc@cursor-64x64-dpms:
    - shard-apl:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-size-change:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +2

  * igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
    - shard-glk:          PASS -> FAIL [fdo#105454] / [fdo#106509]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-apl:          PASS -> FAIL [fdo#103167] +3

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
    - shard-kbl:          PASS -> FAIL [fdo#103167] +2

  * igt@kms_frontbuffer_tracking@fbc-1p-rte:
    - shard-kbl:          PASS -> FAIL [fdo#103167] / [fdo#105682]
    - shard-apl:          PASS -> FAIL [fdo#103167] / [fdo#105682]

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          PASS -> FAIL [fdo#103167] +9

  * igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
    - shard-glk:          PASS -> INCOMPLETE [fdo#103359] / [k.org#198133]

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
    - shard-glk:          PASS -> FAIL [fdo#103166] +3

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
    - shard-apl:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_setmode@basic:
    - shard-apl:          PASS -> FAIL [fdo#99912]

  
#### Possible fixes ####

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_color@pipe-b-degamma:
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +3

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-kbl:          DMESG-WARN [fdo#103313] / [fdo#105345] -> PASS +1

  * igt@kms_cursor_crc@cursor-64x64-offscreen:
    - shard-hsw:          DMESG-FAIL [fdo#102614] / [fdo#103232] -> PASS +1

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-glk:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
    - shard-glk:          FAIL [fdo#104873] -> PASS

  * igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions:
    - shard-hsw:          DMESG-WARN [fdo#102614] -> PASS +2

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
    - shard-apl:          FAIL [fdo#103167] -> PASS +2
    - shard-kbl:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-shrfb-plflip-blt:
    - shard-hsw:          DMESG-FAIL [fdo#102614] / [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_plane@pixel-format-pipe-a-planes:
    - shard-kbl:          FAIL [fdo#103166] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-apl:          FAIL [fdo#103166] -> PASS +3
    - shard-glk:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_rotation_crc@sprite-rotation-180:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS

  * igt@perf@oa-exponents:
    - shard-glk:          FAIL [fdo#105483] -> PASS

  * igt@testdisplay:
    - shard-kbl:          DMESG-WARN [fdo#105345] -> PASS

  
#### Warnings ####

  * igt@i915_suspend@shrink:
    - shard-kbl:          INCOMPLETE [fdo#103665] / [fdo#106886] -> DMESG-WARN [fdo#109244]
    - shard-hsw:          DMESG-WARN [fdo#109244] -> INCOMPLETE [fdo#103540] / [fdo#106886]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
  [fdo#105345]: https://bugs.freedesktop.org/show_bug.cgi?id=105345
  [fdo#105454]: https://bugs.freedesktop.org/show_bug.cgi?id=105454
  [fdo#105483]: https://bugs.freedesktop.org/show_bug.cgi?id=105483
  [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
  [fdo#106509]: https://bugs.freedesktop.org/show_bug.cgi?id=106509
  [fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#109244]: https://bugs.freedesktop.org/show_bug.cgi?id=109244
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * IGT: IGT_4778 -> IGTPW_2259
    * Piglit: piglit_4509 -> None

  CI_DRM_5447: 1fb7b31e074e222be369480ecef1c5c3a48991c9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2259: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
  IGT_4778: 0c80bd7f2a964605f307e0220c6bb756685582b9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2259/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume()
  2019-01-18 10:34   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
@ 2019-01-21 11:33     ` Petri Latvala
  2019-01-21 11:41       ` Chris Wilson
  0 siblings, 1 reply; 58+ messages in thread
From: Petri Latvala @ 2019-01-21 11:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

BUILD_BUG_ON_INVALID() is a macro that, like the kernel counterpart,
expands to an expression that generates no code. Useful for making
sure an expression is valid code while producing no side effects.

igt_assume() is an assert-like macro that is used to give hints to
static analysis of code. If static analysis is not used (as detected
by STATIC_ANALYSIS_BUILD), igt_assume() expands to a
BUILD_BUG_ON_INVALID, otherwise expands to an assert().

v2: Make sure the expression in igt_assume is still parsed without
    static analysis. (Chris)

v3: Also introduce BUILD_BUG_ON_INVALID as standalone

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 lib/igt_core.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index 6f8c3852..0d02c90b 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -30,6 +30,7 @@
 #ifndef IGT_CORE_H
 #define IGT_CORE_H
 
+#include <assert.h>
 #include <setjmp.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -54,6 +55,30 @@
 #endif
 #endif
 
+/**
+ * BUILD_BUG_ON_INVALID:
+ * @expr: Expression
+ *
+ * A macro that takes an expression and generates no code. Used for
+ * checking at build-time that an expression is valid code.
+ */
+#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((long)(e))))
+
+/**
+ * igt_assume:
+ * @expr: Condition to test
+ *
+ * An assert-like macro to be used for tautologies to give hints to
+ * static analysis of code. No-op if STATIC_ANALYSIS_BUILD is not
+ * defined, expands to an assert() if it is.
+ */
+#if STATIC_ANALYSIS_BUILD
+#define igt_assume(e) assert(e)
+#else
+/* Make sure the expression is still parsed even though it generates no code */
+#define igt_assume(e) BUILD_BUG_ON_INVALID(e)
+#endif
+
 extern const char* __igt_test_description __attribute__((weak));
 extern bool __igt_plain_output;
 extern char *igt_frame_dump_path;
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume()
  2019-01-21 11:33     ` [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() Petri Latvala
@ 2019-01-21 11:41       ` Chris Wilson
  0 siblings, 0 replies; 58+ messages in thread
From: Chris Wilson @ 2019-01-21 11:41 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Petri Latvala

Quoting Petri Latvala (2019-01-21 11:33:38)
> BUILD_BUG_ON_INVALID() is a macro that, like the kernel counterpart,
> expands to an expression that generates no code. Useful for making
> sure an expression is valid code while producing no side effects.
> 
> igt_assume() is an assert-like macro that is used to give hints to
> static analysis of code. If static analysis is not used (as detected
> by STATIC_ANALYSIS_BUILD), igt_assume() expands to a
> BUILD_BUG_ON_INVALID, otherwise expands to an assert().
> 
> v2: Make sure the expression in igt_assume is still parsed without
>     static analysis. (Chris)
> 
> v3: Also introduce BUILD_BUG_ON_INVALID as standalone
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5)
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (25 preceding siblings ...)
  2019-01-18 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-01-21 12:09 ` Patchwork
  2019-01-21 16:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-21 12:09 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes (rev5)
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5458 -> IGTPW_2264
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/5/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2264 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_hangcheck:
    - fi-bwr-2160:        NOTRUN -> DMESG-FAIL [fdo#108735]
    - fi-icl-u2:          PASS -> INCOMPLETE [fdo#108569]

  * igt@kms_busy@basic-flip-b:
    - fi-gdg-551:         PASS -> FAIL [fdo#103182]

  * igt@kms_chamelium@dp-hpd-fast:
    - fi-kbl-7500u:       PASS -> DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105602]

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362]

  
#### Possible fixes ####

  * igt@i915_module_load@reload-no-display:
    - fi-bwr-2160:        INCOMPLETE -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
  [fdo#108903]: https://bugs.freedesktop.org/show_bug.cgi?id=108903
  [fdo#108904]: https://bugs.freedesktop.org/show_bug.cgi?id=108904
  [fdo#108905]: https://bugs.freedesktop.org/show_bug.cgi?id=108905
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278


Participating hosts (46 -> 40)
------------------------------

  Missing    (6): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-pnv-d510 fi-icl-y fi-byt-n2820 


Build changes
-------------

    * IGT: IGT_4779 -> IGTPW_2264

  CI_DRM_5458: 74ec7792af09018594097356ddc79d87cb9504f9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2264: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2264/
  IGT_4779: d4199510374514489b1ab56e3416f53f6c1d6291 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2264/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for Static analysis: misc cleanups and fixes (rev5)
  2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
                   ` (26 preceding siblings ...)
  2019-01-21 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5) Patchwork
@ 2019-01-21 16:21 ` Patchwork
  27 siblings, 0 replies; 58+ messages in thread
From: Patchwork @ 2019-01-21 16:21 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Static analysis: misc cleanups and fixes (rev5)
URL   : https://patchwork.freedesktop.org/series/55289/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5458_full -> IGTPW_2264_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/55289/revisions/5/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2264_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_suspend@fence-restore-untiled:
    - shard-kbl:          PASS -> INCOMPLETE [fdo#103665]

  * igt@kms_atomic_interruptible@universal-setplane-primary:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]

  * igt@kms_available_modes_crc@available_mode_test_crc:
    - shard-glk:          PASS -> FAIL [fdo#106641]

  * igt@kms_busy@extended-pageflip-hang-newfb-render-b:
    - shard-apl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
    - shard-glk:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
    - shard-apl:          PASS -> FAIL [fdo#106510] / [fdo#108145]
    - shard-kbl:          PASS -> FAIL [fdo#107725] / [fdo#108145]

  * igt@kms_color@pipe-a-ctm-max:
    - shard-kbl:          PASS -> FAIL [fdo#108147]
    - shard-apl:          PASS -> FAIL [fdo#108147]

  * igt@kms_color@pipe-a-legacy-gamma:
    - shard-apl:          PASS -> FAIL [fdo#104782] / [fdo#108145] +1

  * igt@kms_color@pipe-c-legacy-gamma:
    - shard-apl:          PASS -> FAIL [fdo#104782]

  * igt@kms_cursor_crc@cursor-128x128-onscreen:
    - shard-glk:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-128x128-suspend:
    - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]
    - shard-kbl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x21-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +8
    - shard-kbl:          PASS -> FAIL [fdo#103232] +2

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          PASS -> FAIL [fdo#105767]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-pgflip-blt:
    - shard-snb:          PASS -> INCOMPLETE [fdo#105411]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-apl:          PASS -> FAIL [fdo#103167] +4

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-glk:          PASS -> FAIL [fdo#103167]
    - shard-kbl:          PASS -> FAIL [fdo#103167] +1

  * igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108145] / [fdo#108590]

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-glk:          PASS -> FAIL [fdo#108145] +1

  * igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
    - shard-kbl:          PASS -> FAIL [fdo#103166] +1

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-apl:          PASS -> FAIL [fdo#103166] +4
    - shard-glk:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_setmode@basic:
    - shard-apl:          PASS -> FAIL [fdo#99912]

  * igt@kms_vblank@pipe-b-wait-forked-busy:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#103558] / [fdo#105602] +13

  
#### Possible fixes ####

  * igt@gem_ctx_isolation@vecs0-s3:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@gem_exec_reuse@contexts:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS

  * igt@kms_color@pipe-c-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +2
    - shard-kbl:          FAIL [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-256x85-random:
    - shard-glk:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_flip@dpms-vs-vblank-race-interruptible:
    - shard-glk:          FAIL [fdo#103060] -> PASS

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-apl:          FAIL [fdo#102887] / [fdo#105363] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-apl:          FAIL [fdo#103167] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
    - shard-glk:          FAIL [fdo#108948] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-glk:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
    - shard-apl:          FAIL [fdo#103166] -> PASS

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-apl:          DMESG-FAIL [fdo#108950] -> PASS

  * igt@perf_pmu@rc6:
    - shard-kbl:          {SKIP} [fdo#109271] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
  [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#106510]: https://bugs.freedesktop.org/show_bug.cgi?id=106510
  [fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108590]: https://bugs.freedesktop.org/show_bug.cgi?id=108590
  [fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
  [fdo#108950]: https://bugs.freedesktop.org/show_bug.cgi?id=108950
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * IGT: IGT_4779 -> IGTPW_2264
    * Piglit: piglit_4509 -> None

  CI_DRM_5458: 74ec7792af09018594097356ddc79d87cb9504f9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2264: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2264/
  IGT_4779: d4199510374514489b1ab56e3416f53f6c1d6291 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2264/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
@ 2019-01-28 13:04   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-28 13:04 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:39PM +0200, Petri Latvala wrote:
> If the properties for gamma tables exist, their sizes must be
> non-zero.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>  tests/kms_color.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 913c70ca..decf3c2a 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -124,9 +124,13 @@ static void paint_rectangles(data_t *data,
>  
>  static double *generate_table(uint32_t lut_size, double exp)
>  {
> -	double *coeffs = malloc(sizeof(double) * lut_size);
> +	double *coeffs;
>  	uint32_t i;
>  
> +	igt_assert_lt(0, lut_size);

Asserts like that never parse well for me, especiall that
assert_gt(value, 0) seems to be overall more common...

Meybe we should introduce it to IGT?

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
@ 2019-01-28 13:11   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-28 13:11 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:49PM +0200, Petri Latvala wrote:
> x86_features_to_string() uses a repeatable pattern that increments a
> pointer for each feature string, leaving a dead assignment for the
> last one. Add a (void)line to the end just to silence static analysis.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
@ 2019-01-28 13:17   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-28 13:17 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:48PM +0200, Petri Latvala wrote:
> If we first find n amount of ':' in a string, the amount is still n
> when we walk through it the second time.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
@ 2019-01-28 13:18   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-28 13:18 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:44PM +0200, Petri Latvala wrote:
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data
  2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Petri Latvala
@ 2019-01-28 13:21   ` Arkadiusz Hiler
  0 siblings, 0 replies; 58+ messages in thread
From: Arkadiusz Hiler @ 2019-01-28 13:21 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Wed, Jan 16, 2019 at 01:20:36PM +0200, Petri Latvala wrote:
> The code assumes (correctly) that perf_event_header's size is
> non-zero. Write that out so static analysis also knows it.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2019-01-28 13:21 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
2019-01-16 14:26   ` Chris Wilson
2019-01-18 10:34   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-21 11:33     ` [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() Petri Latvala
2019-01-21 11:41       ` Chris Wilson
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
2019-01-16 11:30   ` Chris Wilson
2019-01-16 14:22   ` Chris Wilson
2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
2019-01-17  9:55   ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
2019-01-16 11:28   ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
2019-01-17 11:14   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Petri Latvala
2019-01-28 13:21   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
2019-01-16 11:45   ` Tvrtko Ursulin
2019-01-16 12:03     ` Petri Latvala
2019-01-16 12:07       ` Chris Wilson
2019-01-16 12:08       ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
2019-01-16 17:11   ` Robert Foss
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
2019-01-28 13:04   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
2019-01-16 11:30   ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
2019-01-16 11:48   ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
2019-01-16 14:14   ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
2019-01-16 14:16   ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
2019-01-28 13:18   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
2019-01-17 12:17   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
2019-01-16 14:18   ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
2019-01-17  9:56   ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
2019-01-28 13:17   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
2019-01-28 13:11   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
2019-01-16 12:15   ` Rodrigo Siqueira
2019-01-16 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes Patchwork
2019-01-16 22:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-18 11:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4) Patchwork
2019-01-18 12:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-01-18 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-21 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5) Patchwork
2019-01-21 16:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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.