Skip to contentSkip to conversation

lib/igt_core: Reinitialize print mutex in child process

PATCH In review Zbigniew Kempczyński 3 participants 4 messages Sep 29, 2020 – Sep 30, 2020 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib/igt_core: Reinitialize print mutex in child process

IGT are prone to deadlock in igt_log() in following scenario:

1. Parent process creates additional thread which for example is doing endless loop.
2. Thread sometimes is logging to console using igt_info(). This locks and unlocks print_mutex.
3. If in the meantime parent process will spawn child process it can be created having print_mutex locked (thread entered igt_vlog() function and entered critical section). When child will try to log it will deadlock.

We should reinitialize print_mutex in child process to avoid use inherited value.

---
 lib/igt_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/igt_core.c +3 -2
index cedd8168..b358173f 100644
@@ -2271,6 +2271,8 @@ static void children_exit_handler(int sig)
 		;
 }
 
+static pthread_mutex_t print_mutex = PTHREAD_MUTEX_INITIALIZER;
+
 bool __igt_fork(void)
 {
 	internal_assert(!test_with_subtests || in_subtest,
@@ -2300,6 +2302,7 @@ bool __igt_fork(void)
 		igt_assert(0);
 	case 0:
 		test_child = true;
+		pthread_mutex_init(&print_mutex, NULL);
 		exit_handler_count = 0;
 		reset_helper_process_list();
 		oom_adjust_for_doom();
@@ -2737,8 +2740,6 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 		"NONE"
 	};
 
-	static pthread_mutex_t print_mutex = PTHREAD_MUTEX_INITIALIZER;
-
 	assert(format);
 
 #ifdef __GLIBC__
Signature · 6 lines
2.26.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for lib/igt_core: Reinitialize print mutex in child process (rev3)

== Series Details ==

== Series Details ==

Series: lib/igt_core: Reinitialize print mutex in child process (rev3)
URL : https://patchwork.freedesktop.org/series/82154/
State : success

== Summary ==

CI Bug Log - changes from IGT_5791 -> IGTPW_5024
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-byt-j1900: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-byt-j1900/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-byt-j1900/igt@[email protected]

#### Possible fixes ####

* {igt@core_hotunplug@unbind-rebind}:
- fi-kbl-x1275: [DMESG-WARN][3] ([i915#62] / [i915#92]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-kbl-x1275/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-kbl-x1275/igt@[email protected]

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-n3050: [DMESG-WARN][5] ([i915#1982]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-bsw-n3050/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-bsw-n3050/igt@[email protected]
- fi-bsw-kefka: [DMESG-WARN][7] ([i915#1982]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-bsw-kefka/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-bsw-kefka/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][9] ([i915#1982]) -> [PASS][10] +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-icl-u2/igt@[email protected]

* igt@kms_force_connector_basic@force-connector-state:
- {fi-tgl-dsi}: [DMESG-WARN][11] ([i915#402]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-tgl-dsi/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-tgl-dsi/igt@[email protected]

#### Warnings ####

* igt@i915_module_load@reload:
- fi-icl-u2: [DMESG-WARN][13] ([i915#289]) -> [DMESG-WARN][14] ([i915#1982] / [i915#289])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-icl-u2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-icl-u2/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-x1275: [DMESG-WARN][15] ([i915#62] / [i915#92]) -> [DMESG-WARN][16] ([i915#62] / [i915#92] / [i915#95]) +1 similar issue
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-kbl-x1275/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-kbl-x1275/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c:
- fi-kbl-x1275: [DMESG-WARN][17] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][18] ([i915#62] / [i915#92]) +3 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/fi-kbl-x1275/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/fi-kbl-x1275/igt@[email protected]

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

[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#289]: https://gitlab.freedesktop.org/drm/intel/issues/289
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (46 -> 39)
------------------------------

Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* IGT: IGT_5791 -> IGTPW_5024

CI-20190529: 20190529
CI_DRM_9072: cbd61a1eb61b1919ff10dd826525b4352c10da47 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5024: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html
IGT_5791: d089599869755e80accd16d3018b5f9ace139588 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for lib/igt_core: Reinitialize print mutex in child process (rev3)

In reply to Zbigniew Kempczyński
== Series Details ==

== Series Details ==

Series: lib/igt_core: Reinitialize print mutex in child process (rev3)
URL : https://patchwork.freedesktop.org/series/82154/
State : success

== Summary ==

CI Bug Log - changes from IGT_5791_full -> IGTPW_5024_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html

New tests
---------

New tests have been introduced between IGT_5791_full and IGTPW_5024_full:

### New IGT tests (1) ###

* igt@gem_exec_parallel@userptr:
- Statuses :
- Exec time: [None] s

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_schedule@pi-ringfull@vcs0:
- shard-apl: [PASS][1] -> [INCOMPLETE][2] ([i915#1635])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl7/igt@gem_exec_schedule@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl2/igt@gem_exec_schedule@[email protected]

* igt@gem_exec_whisper@basic-fds-forked-all:
- shard-glk: [PASS][3] -> [DMESG-WARN][4] ([i915#118] / [i915#95]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-glk6/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-glk2/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- shard-tglb: [PASS][5] -> [SKIP][6] ([i915#2190])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb7/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb6/igt@[email protected]

* igt@i915_module_load@reload:
- shard-tglb: [PASS][7] -> [DMESG-WARN][8] ([i915#1982]) +4 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb2/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-64x64-random:
- shard-kbl: [PASS][9] -> [FAIL][10] ([i915#54])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl1/igt@[email protected]
- shard-apl: [PASS][11] -> [FAIL][12] ([i915#1635] / [i915#54])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl1/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl6/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: [PASS][13] -> [FAIL][14] ([i915#96])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-hsw6/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-hsw1/igt@[email protected]

* igt@kms_draw_crc@draw-method-xrgb2101010-pwrite-untiled:
- shard-apl: [PASS][15] -> [DMESG-WARN][16] ([i915#1635] / [i915#1982]) +1 similar issue
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl6/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-render:
- shard-glk: [PASS][17] -> [FAIL][18] ([i915#49])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-glk2/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-render.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-glk7/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-render.html

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][19] -> [DMESG-WARN][20] ([i915#180]) +3 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl3/igt@[email protected]

* igt@kms_panel_fitting@atomic-fastset:
- shard-tglb: [PASS][21] -> [FAIL][22] ([i915#83])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb1/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb5/igt@[email protected]
- shard-iclb: [PASS][23] -> [FAIL][24] ([i915#83])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb6/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb2/igt@[email protected]

* igt@kms_plane_scaling@pipe-c-scaler-with-clipping-clamping:
- shard-iclb: [PASS][25] -> [DMESG-WARN][26] ([i915#1982])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb3/igt@[email protected]

* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [PASS][27] -> [SKIP][28] ([fdo#109441]) +4 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb1/igt@kms_psr@psr2_primary_mmap_cpu.html

* igt@kms_vblank@pipe-c-wait-busy:
- shard-kbl: [PASS][29] -> [DMESG-WARN][30] ([i915#1982])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl3/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl1/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_reloc@basic-many-active@vecs0:
- shard-glk: [FAIL][31] ([i915#2389]) -> [PASS][32] +2 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-glk5/igt@gem_exec_reloc@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-glk7/igt@gem_exec_reloc@[email protected]

* igt@i915_selftest@mock@contexts:
- shard-apl: [INCOMPLETE][33] ([i915#1635] / [i915#2278]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl3/igt@i915_selftest@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl4/igt@i915_selftest@[email protected]

* {igt@kms_async_flips@async-flip-with-page-flip-events}:
- shard-kbl: [FAIL][35] ([i915#2521]) -> [PASS][36] +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl3/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl6/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-256x85-sliding:
- shard-kbl: [FAIL][37] ([i915#54]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl3/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl6/igt@[email protected]
- shard-apl: [FAIL][39] ([i915#1635] / [i915#54]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl6/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl8/igt@[email protected]

* igt@kms_cursor_legacy@2x-flip-vs-cursor-legacy:
- shard-glk: [FAIL][41] ([i915#72]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-glk1/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-glk1/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: [FAIL][43] ([i915#96]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-hsw6/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-hsw1/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
- shard-kbl: [DMESG-WARN][45] ([i915#180]) -> [PASS][46] +5 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl6/igt@kms_flip@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl6/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite:
- shard-kbl: [DMESG-WARN][47] ([i915#1982]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-kbl4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite.html

* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-wc:
- shard-tglb: [DMESG-WARN][49] ([i915#1982]) -> [PASS][50] +3 similar issues
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb3/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-wc.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb7/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-wc.html

* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [SKIP][51] ([fdo#109642] / [fdo#111068]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb3/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb2/igt@[email protected]

* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [SKIP][53] ([fdo#109441]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb3/igt@kms_psr@psr2_cursor_plane_onoff.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html

* igt@kms_vblank@pipe-c-accuracy-idle:
- shard-glk: [DMESG-WARN][55] ([i915#1982]) -> [PASS][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-glk5/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-glk5/igt@[email protected]

#### Warnings ####

* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [FAIL][57] ([i915#454]) -> [FAIL][58] ([i915#1899])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-iclb4/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-iclb1/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-tglb: [DMESG-WARN][59] ([i915#2411]) -> [DMESG-WARN][60] ([i915#1982] / [i915#2411])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb3/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb3/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
- shard-apl: [DMESG-FAIL][61] ([fdo#108145] / [i915#1635] / [i915#1982]) -> [FAIL][62] ([fdo#108145] / [i915#1635] / [i915#265])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl1/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl3/igt@[email protected]

* igt@kms_psr@suspend:
- shard-tglb: [INCOMPLETE][63] ([i915#1436] / [i915#1602] / [i915#1887] / [i915#456]) -> [DMESG-WARN][64] ([i915#2411])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-tglb3/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-tglb7/igt@[email protected]

* igt@runner@aborted:
- shard-apl: [FAIL][65] ([i915#1635] / [i915#2439]) -> [FAIL][66] ([i915#1610] / [i915#1635] / [i915#2439])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5791/shard-apl3/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/shard-apl2/igt@[email protected]

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

[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1887]: https://gitlab.freedesktop.org/drm/intel/issues/1887
[i915#1899]: https://gitlab.freedesktop.org/drm/intel/issues/1899
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2278]: https://gitlab.freedesktop.org/drm/intel/issues/2278
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
[i915#2439]: https://gitlab.freedesktop.org/drm/intel/issues/2439
[i915#2519]: https://gitlab.freedesktop.org/drm/intel/issues/2519
[i915#2520]: https://gitlab.freedesktop.org/drm/intel/issues/2520
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
[i915#83]: https://gitlab.freedesktop.org/drm/intel/issues/83
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
[i915#96]: https://gitlab.freedesktop.org/drm/intel/issues/96

Participating hosts (8 -> 8)
------------------------------

No changes in participating hosts

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

* CI: CI-20190529 -> None
* IGT: IGT_5791 -> IGTPW_5024

CI-20190529: 20190529
CI_DRM_9072: cbd61a1eb61b1919ff10dd826525b4352c10da47 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5024: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html
IGT_5791: d089599869755e80accd16d3018b5f9ace139588 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5024/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v2 1/1
#3 lore raw
In reply to Zbigniew Kempczyński
Quoted 11 lines · Zbigniew Kempczyński

IGT are prone to deadlock in igt_log() in following scenario:

1. Parent process creates additional thread which for example is doing endless loop.
2. Thread sometimes is logging to console using igt_info(). This locks and unlocks print_mutex.
3. If in the meantime parent process will spawn child process it can be created having print_mutex locked (thread entered igt_vlog() function and entered critical section). When child will try to log it will deadlock.

Quoted 5 lines

We should reinitialize print_mutex in child process to avoid use inherited value.

Quoted 37 lines
---
 lib/igt_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/igt_core.c +3 -2
index cedd8168..b358173f 100644
@@ -2271,6 +2271,8 @@ static void children_exit_handler(int sig)
 		;
 }
 
+static pthread_mutex_t print_mutex = PTHREAD_MUTEX_INITIALIZER;
+
 bool __igt_fork(void)
 {
 	internal_assert(!test_with_subtests || in_subtest,
@@ -2300,6 +2302,7 @@ bool __igt_fork(void)
 		igt_assert(0);
 	case 0:
 		test_child = true;
+		pthread_mutex_init(&print_mutex, NULL);
 		exit_handler_count = 0;
 		reset_helper_process_list();
 		oom_adjust_for_doom();
@@ -2737,8 +2740,6 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 		"NONE"
 	};
 
-	static pthread_mutex_t print_mutex = PTHREAD_MUTEX_INITIALIZER;
-
 	assert(format);
 
 #ifdef __GLIBC__
Signature · 1 line
2.26.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev