Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector.
@ 2021-05-31 15:39 Lee Shawn C
  2021-06-04 18:48 ` Mark Yacoub
  2021-06-21 10:57 ` [Intel-gfx] [igt-dev] " Petri Latvala
  0 siblings, 2 replies; 4+ messages in thread
From: Lee Shawn C @ 2021-05-31 15:39 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: markyacoub, charlton.lin

Got SIGSEGV fault while running kms_dp_dsc test but did not
connect DP DSC capable monitor on eDP/DP port. This test daemon
should "SKIP" test without any problem. We found kms_dp_dsc
can't get proper drmModeConnector and caused this SIGSEGV fault
when release it. Make sure drmModeConnector is available before
free it can avoid this issue.

Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
---
 tests/kms_dp_dsc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
index 2446fd82bba3..ea7c9f4f72ce 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dp_dsc.c
@@ -262,7 +262,7 @@ igt_main
 	data_t data = {};
 	igt_output_t *output;
 	drmModeRes *res;
-	drmModeConnector *connector;
+	drmModeConnector *connector = NULL;
 	int i, test_conn_cnt, test_cnt;
 	int tests[] = {DRM_MODE_CONNECTOR_eDP, DRM_MODE_CONNECTOR_DisplayPort};
 
@@ -311,7 +311,8 @@ igt_main
 	}
 
 	igt_fixture {
-		drmModeFreeConnector(connector);
+		if (connector)
+			drmModeFreeConnector(connector);
 		drmModeFreeResources(res);
 		close(data.debugfs_fd);
 		close(data.drm_fd);
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector.
  2021-05-31 15:39 [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector Lee Shawn C
@ 2021-06-04 18:48 ` Mark Yacoub
  2021-06-07 18:59   ` Mark Yacoub
  2021-06-21 10:57 ` [Intel-gfx] [igt-dev] " Petri Latvala
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Yacoub @ 2021-06-04 18:48 UTC (permalink / raw)
  To: Lee Shawn C; +Cc: igt-dev, intel-gfx, charlton.lin

On Mon, May 31, 2021 at 11:34 AM Lee Shawn C <shawn.c.lee@intel.com> wrote:
>
> Got SIGSEGV fault while running kms_dp_dsc test but did not
> connect DP DSC capable monitor on eDP/DP port. This test daemon
> should "SKIP" test without any problem. We found kms_dp_dsc
> can't get proper drmModeConnector and caused this SIGSEGV fault
> when release it. Make sure drmModeConnector is available before
> free it can avoid this issue.
>
Tested on ChromeOS on TGL (Delbin) and JSL (Drawlat).
Tested-by: Mark Yacoub <markyacoub@chromium.org>
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> ---
>  tests/kms_dp_dsc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
> index 2446fd82bba3..ea7c9f4f72ce 100644
> --- a/tests/kms_dp_dsc.c
> +++ b/tests/kms_dp_dsc.c
> @@ -262,7 +262,7 @@ igt_main
>         data_t data = {};
>         igt_output_t *output;
>         drmModeRes *res;
> -       drmModeConnector *connector;
> +       drmModeConnector *connector = NULL;
>         int i, test_conn_cnt, test_cnt;
>         int tests[] = {DRM_MODE_CONNECTOR_eDP, DRM_MODE_CONNECTOR_DisplayPort};
>
> @@ -311,7 +311,8 @@ igt_main
>         }
>
>         igt_fixture {
> -               drmModeFreeConnector(connector);
> +               if (connector)
> +                       drmModeFreeConnector(connector);
>                 drmModeFreeResources(res);
>                 close(data.debugfs_fd);
>                 close(data.drm_fd);
> --
> 2.17.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector.
  2021-06-04 18:48 ` Mark Yacoub
@ 2021-06-07 18:59   ` Mark Yacoub
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Yacoub @ 2021-06-07 18:59 UTC (permalink / raw)
  To: Lee Shawn C; +Cc: igt-dev, intel-gfx, Lin, Charlton

On Fri, Jun 4, 2021 at 2:48 PM Mark Yacoub <markyacoub@chromium.org> wrote:
>
> On Mon, May 31, 2021 at 11:34 AM Lee Shawn C <shawn.c.lee@intel.com> wrote:
> >
> > Got SIGSEGV fault while running kms_dp_dsc test but did not
> > connect DP DSC capable monitor on eDP/DP port. This test daemon
> > should "SKIP" test without any problem. We found kms_dp_dsc
> > can't get proper drmModeConnector and caused this SIGSEGV fault
> > when release it. Make sure drmModeConnector is available before
> > free it can avoid this issue.
> >
> Tested on ChromeOS on TGL (Delbin) and JSL (Drawlat).
Tested on ChromeOS AMD (Zork) with Kernel 5.4
> Tested-by: Mark Yacoub <markyacoub@chromium.org>
> > Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> > ---
> >  tests/kms_dp_dsc.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
> > index 2446fd82bba3..ea7c9f4f72ce 100644
> > --- a/tests/kms_dp_dsc.c
> > +++ b/tests/kms_dp_dsc.c
> > @@ -262,7 +262,7 @@ igt_main
> >         data_t data = {};
> >         igt_output_t *output;
> >         drmModeRes *res;
> > -       drmModeConnector *connector;
> > +       drmModeConnector *connector = NULL;
> >         int i, test_conn_cnt, test_cnt;
> >         int tests[] = {DRM_MODE_CONNECTOR_eDP, DRM_MODE_CONNECTOR_DisplayPort};
> >
> > @@ -311,7 +311,8 @@ igt_main
> >         }
> >
> >         igt_fixture {
> > -               drmModeFreeConnector(connector);
> > +               if (connector)
> > +                       drmModeFreeConnector(connector);
> >                 drmModeFreeResources(res);
> >                 close(data.debugfs_fd);
> >                 close(data.drm_fd);
> > --
> > 2.17.1
> >
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector.
  2021-05-31 15:39 [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector Lee Shawn C
  2021-06-04 18:48 ` Mark Yacoub
@ 2021-06-21 10:57 ` Petri Latvala
  1 sibling, 0 replies; 4+ messages in thread
From: Petri Latvala @ 2021-06-21 10:57 UTC (permalink / raw)
  To: Lee Shawn C; +Cc: igt-dev, intel-gfx, charlton.lin

On Mon, May 31, 2021 at 11:39:22PM +0800, Lee Shawn C wrote:
> Got SIGSEGV fault while running kms_dp_dsc test but did not
> connect DP DSC capable monitor on eDP/DP port. This test daemon
> should "SKIP" test without any problem. We found kms_dp_dsc
> can't get proper drmModeConnector and caused this SIGSEGV fault
> when release it. Make sure drmModeConnector is available before
> free it can avoid this issue.
> 
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  tests/kms_dp_dsc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
> index 2446fd82bba3..ea7c9f4f72ce 100644
> --- a/tests/kms_dp_dsc.c
> +++ b/tests/kms_dp_dsc.c
> @@ -262,7 +262,7 @@ igt_main
>  	data_t data = {};
>  	igt_output_t *output;
>  	drmModeRes *res;
> -	drmModeConnector *connector;
> +	drmModeConnector *connector = NULL;
>  	int i, test_conn_cnt, test_cnt;
>  	int tests[] = {DRM_MODE_CONNECTOR_eDP, DRM_MODE_CONNECTOR_DisplayPort};
>  
> @@ -311,7 +311,8 @@ igt_main
>  	}
>  
>  	igt_fixture {
> -		drmModeFreeConnector(connector);
> +		if (connector)
> +			drmModeFreeConnector(connector);
>  		drmModeFreeResources(res);
>  		close(data.debugfs_fd);
>  		close(data.drm_fd);
> -- 
> 2.17.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2021-06-21 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 15:39 [Intel-gfx] [PATCH i-g-t] tests/kms_dp_dsc: Avoid SIGSEGV when release DRM connector Lee Shawn C
2021-06-04 18:48 ` Mark Yacoub
2021-06-07 18:59   ` Mark Yacoub
2021-06-21 10:57 ` [Intel-gfx] [igt-dev] " Petri Latvala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox