Bug 96605

Summary: [IGT] [BXT / KBL] gem_close_race / basic-threads & basic-process fail [regresion]
Product: DRI Reporter: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez>
Component: IGTAssignee: Marius Vlad <marius.c.vlad>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: highest CC: intel-gfx-bugs
Version: XOrg git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: BXT, KBL i915 features: display/Other
Attachments:
Description Flags
dmesg.log none

Description Humberto Israel Perez Rodriguez 2016-06-20 22:28:49 UTC
Created attachment 124628 [details]
dmesg.log

Regresion
============================================
Yes

latest know good commits 

for kernel
commit eb158325d91be87cdac8cf85aa2162a5895c2dd0
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Mon Jun 13 16:48:17 2016 +0100

    drm-intel-nightly: 2016y-06m-13d-15h-47m-56s UTC integration manifest

for igt
  tag : intel-gpu-tools-1.15 
  commit : 3ce58b6 


Steps to reproduce
============================================
./gem_close_race --run-subtest basic-process --debug
./gem_close_race --run-subtest basic-threads --debug

Actual result
============================================
test fail

Expected results
============================================
test must pass

Attachments
============================================
dmesg.log

test output
=============================================
./gem_close_race --run-subtest basic-threads --debug

IGT-Version: 1.15-gc344044 
(x86_64) (Linux: 4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+ x86_64)
(gem_close_race:3893) igt-core-DEBUG: Test requirement passed: !igt_run_in_simulation()
(gem_close_race:3893) drmtest-DEBUG: Test requirement passed: fd >= 0
(gem_close_race:3893) igt-core-DEBUG: Starting subtest: basic-threads
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ioctl_wrappers.c:556:
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Failed assertion: igt_ioctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Last errno: 9, Bad file descriptor
(gem_close_race:3893) ioctl-wrappers-CRITICAL: error: -1 != 0
Stack trace:
  #0 [__igt_fail_assert+0x101]
  #1 [gem_create+0x90]
  #2 [<unknown>+0x90]
Subtest basic-threads failed.
**** DEBUG ****
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ioctl_wrappers.c:556:
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Failed assertion: igt_ioctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
(gem_close_race:3893) ioctl-wrappers-CRITICAL: Last errno: 9, Bad file descriptor
(gem_close_race:3893) ioctl-wrappers-CRITICAL: error: -1 != 0
****  END  ****
Subtest basic-threads: FAIL (0.002s)
(gem_close_race:3893) igt-core-DEBUG: Exiting with status code 99


for this one looks like that is missing some file or directory 
./gem_close_race --run-subtest basic-process --debug

IGT-Version: 1.15-gc344044 (x86_64) (Linux: 4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+ x86_64)
(gem_close_race:3934) igt-core-DEBUG: Test requirement passed: !igt_run_in_simulation()
(gem_close_race:3934) drmtest-DEBUG: Test requirement passed: fd >= 0
(gem_close_race:3934) igt-core-DEBUG: Starting subtest: basic-process
(gem_close_race:3936) CRITICAL: Test assertion failure function process, file gem_close_race.c:149:
(gem_close_race:3936) CRITICAL: Failed assertion: fd != -1
(gem_close_race:3936) CRITICAL: Last errno: 2, No such file or directory
(gem_close_race:3936) CRITICAL: error: -1 == -1
Stack trace:
  #0 [__igt_fail_assert+0x101]
  #1 [process+0xb6]
  #2 [__real_main210+0x1dd]
  #3 [main+0x23]
  #4 [__libc_start_main+0xf0]
  #5 [_start+0x29]
  #6 [<unknown>+0x29]
child 0 failed with exit status 99
Subtest basic-process failed.
No log.
Subtest basic-process: FAIL (0.005s)
(gem_close_race:3934) igt-core-DEBUG: Exiting with status code 99


additional info
======================
no relevant dmesg info, only dmesg info in dmesg.log


 Software information
============================================
Kernel version                  : 4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+
Linux distribution              : Ubuntu 16.04 LTS
Architecture                    : 64-bit
Bios revision                   : 138.25
KSC revision                    : 1.12


 --> Component : drm 
	 url : http://cgit.freedesktop.org/mesa/drm 
	 tag : libdrm-2.4.68 
	 commit : fc09c5a 
 --> Component : cairo 
	 url : http://cgit.freedesktop.org/cairo 
	 tag : 1.15.2 
	 commit : db8a7f1 
 --> Component : intel-gpu-tools 
	 url : http://cgit.freedesktop.org/xorg/app/intel-gpu-tools 
	 tag : intel-gpu-tools-1.15-29-gc344044 
	 commit : c344044 


 Hardware information
============================================
Platform                        : BXT-P
Motherboard model               : Broxton P
Motherboard type                : NOTEBOOK Hand Held
Motherboard manufacturer        : Intel Corp.
CPU family                      : B1
CPU information                 : 06/5c
GPU Card                        : Intel Corporation Device 5a84 (rev 0a) (prog-if 00 [VGA controller])
Memory ram                      : 16 GB

 Firmwares information
============================================
DMC fw loaded                   : yes
DMC version                     : 1.7
GUC fw loaded                   : SUCCESS
GUC version wanted              : 8.7
GUC version found               : 8.7


kernel
============================================
commit f586720edd865745aaca6f612615ef14c77e6091
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Jun 20 15:25:16 2016 +0200

    drm-intel-nightly: 2016y-06m-20d-13h-24m-46s UTC integration manifest
Comment 1 Luis Botello 2016-06-20 22:41:10 UTC
Same issue observed on KBL with the same config:

Hardware information
=====================
Platform		KBL
Motherboard model	RVP 7
Motherboard manufacturer	Intel Corp.
GPU Card	Intel Corporation Device 5a84 (rev 03) (prog-if 00 [VGA controller])
Comment 2 yann 2016-06-21 07:14:24 UTC
Commit id e63a0681d95a7288faff19a624548f96dbc73341 
tests/gem_close_race: Use drm_open_driver helper
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

introduced the regression due to removal of line
-		sprintf(device, "/dev/dri/card%d", drm_get_card());

device is not defined anymore. So I may recommend to use 
fd = drm_open_driver(DRIVER_INTEL);

anywhere we need to open the device
Comment 3 Chris Wilson 2016-06-21 07:39:43 UTC
commit 85d6566c4e61348e4c9ede606c4937912f62e652
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jun 21 08:34:04 2016 +0100

    igt/gem_close_race: Complete conversion to drm_open_driver()
    
    commit e63a0681d95a ("tests/gem_close_race: Use drm_open_driver helper")
    left a few raw open() behind. Eliminate them as well!
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=96605
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 4 Hector Velazquez 2017-09-08 17:45:53 UTC
Verified the following tests PASS on KBL 

Tests List:

igt@gem_close_race@basic-process
igt@gem_close_race@basic-threads

======================================
        Output Sample
======================================
...
((gem_close_race:1871) ioctl-wrappers-DEBUG: Test requirement passed: err == 0
(gem_close_race:1871) igt-core-DEBUG: Starting subtest: basic-threads
(gem_close_race:1871) drmtest-DEBUG: Test requirement passed: !(fd<0)
...
(gem_close_race:1871) drmtest-DEBUG: Test requirement passed: !(fd<0)
Subtest basic-threads: SUCCESS (1.076s)
(gem_close_race:1871) igt-core-DEBUG: Exiting with status code 0
...
---
...
(gem_close_race:1866) igt-core-DEBUG: Starting subtest: basic-process
(gem_close_race:1868) drmtest-DEBUG: Test requirement passed: !(fd<0)
Subtest basic-process: SUCCESS (0.001s)
(gem_close_race:1866) igt-core-DEBUG: Exiting with status code 0
...

This is my configuration:

======================================
        Graphic stack
======================================

Component: drm
    tag: libdrm-2.4.81-53-gd55d080
    commit: d55d0804f9e37637d7510f38f97e07a50c6b7baa

Component: cairo
    tag: 1.15.6-30-gc29db4f
    commit: c29db4f0de52727406a8b62f4da9a382084b5a79

Component: intel-gpu-tools
    tag: intel-gpu-tools-1.19-252-gd5de89e
    commit: d5de89eb17938484718be1144f5957f05ab44dc2

Component: piglit
    tag: piglit-v1
    commit: dab15137044c34023b1a843e72e781b03b17548b


======================================
             Software
======================================
kernel version              : 4.13.0-drm-tip-ww36-commit-16fef66+
hostname                    : KBL-2
architecture                : x86_64
os version                  : Ubuntu 16.10
os codename                 : yakkety
kernel driver               : i915
bios revision               : 5.6
bios release date           : 05/03/2017
ksc                         : 8.1
hardware acceleration       : disabled
swap partition              : enabled on (/dev/sda3)

======================================
        Graphic drivers
======================================
grep: /opt/X11R7/var/log/Xorg.0.log: No such file or directory
libdrm                      : 2.4.83
cairo                       : 1.15.9
intel-gpu-tools (tag)       : intel-gpu-tools-1.19-252-gd5de89e
intel-gpu-tools (commit)    : d5de89e

======================================
             Hardware
======================================
motherboard id             : NUC7i5BNB
form factor                : Desktop
cpu family                 : Core i5
cpu family id              : 6
cpu information            : Intel(R) Core(TM) i5-7260U CPU @ 2.20GHz
gpu card                   : Intel Corporation Device 5926 (rev 06) (prog-if 00 [VGA controller])
memory ram                 : 15.57 GB
max memory ram             : 32 GB
cpu thread                 : 4
cpu core                   : 2
cpu model                  : 142
cpu stepping               : 9
socket                     : Other
signature                  : Type 0, Family 6, Model 142, Stepping 9
hard drive                 : 447GiB (480GB)
current cd clock frequency : 337500 kHz
maximum cd clock frequency : 675000 kHz
displays connected         : DP-1 DP-2

======================================
             Firmware
======================================
dmc fw loaded             : yes
dmc version               : 1.1
guc fw loaded             : SUCCESS
guc version wanted        : 9.14
guc version found         : 9.14

======================================
             kernel parameters
======================================
quiet drm.debug=0x1e pci=pcie_bus_safe intel_iommu=igfx_off auto panic=1 i915.alpha_support=1 i915.enable_guc_loading=2 nmi_watchdog=panic i915.enable_guc_submission=2 resume=/dev/sda3 fastboot
Comment 5 Hector Velazquez 2017-09-08 19:19:49 UTC
Verified the following tests PASS on BXT 

Tests List:

igt@gem_close_race@basic-process
igt@gem_close_race@basic-threads

======================================
        Output Sample
======================================
...
(gem_close_race:683) ioctl-wrappers-DEBUG: Test requirement passed: err == 0
(gem_close_race:683) igt-core-DEBUG: Starting subtest: basic-process
(gem_close_race:686) drmtest-DEBUG: Test requirement passed: !(fd<0)
Subtest basic-process: SUCCESS (0.023s)
(gem_close_race:683) igt-core-DEBUG: Exiting with status code 0
...
---
...
(gem_close_race:697) ioctl-wrappers-DEBUG: Test requirement passed: err == 0
(gem_close_race:697) igt-core-DEBUG: Starting subtest: basic-threads
(gem_close_race:697) drmtest-DEBUG: Test requirement passed: !(fd<0)
...
(gem_close_race:697) drmtest-DEBUG: Test requirement passed: !(fd<0)
Subtest basic-threads: SUCCESS (1.077s)
(gem_close_race:697) igt-core-DEBUG: Exiting with status code 0
...

This is my configuration:

======================================
        Graphic stack
======================================

Component: drm
    tag: libdrm-2.4.81-53-gd55d080
    commit: d55d0804f9e37637d7510f38f97e07a50c6b7baa

Component: cairo
    tag: 1.15.6-30-gc29db4f
    commit: c29db4f0de52727406a8b62f4da9a382084b5a79

Component: intel-gpu-tools
    tag: intel-gpu-tools-1.19-252-gd5de89e
    commit: d5de89eb17938484718be1144f5957f05ab44dc2

Component: piglit
    tag: piglit-v1
    commit: dab15137044c34023b1a843e72e781b03b17548b

======================================
             Software
======================================
kernel version              : 4.13.0-drm-tip-ww36-commit-16fef66+
hostname                    : BXT-3
architecture                : x86_64
os version                  : Ubuntu 16.10
os codename                 : yakkety
kernel driver               : i915
bios revision               : 5.6
bios release date           : 06/19/2017
ksc                         : 18.0
hardware acceleration       : disabled
swap partition              : enabled on (/dev/sda3)

======================================
        Graphic drivers
======================================
grep: /opt/X11R7/var/log/Xorg.0.log: No such file or directory
libdrm                      : 2.4.83
cairo                       : 1.15.9
intel-gpu-tools (tag)       : intel-gpu-tools-1.19-252-gd5de89e
intel-gpu-tools (commit)    : d5de89e

======================================
             Hardware
======================================
motherboard model          : NUC6CAYS
motherboard id             : NUC6CAYB
form factor                : Desktop
manufacturer               : Intelcorporation
cpu family                 : Celeron
cpu family id              : 6
cpu information            : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
gpu card                   : Intel Corporation Device 5a85 (rev 0b) (prog-if 00 [VGA controller])
memory ram                 : 15.54 GB
max memory ram             : 32 GB
cpu thread                 : 4
cpu core                   : 4
cpu model                  : 92
cpu stepping               : 9
socket                     : Other
signature                  : Type 0, Family 6, Model 92, Stepping 9
hard drive                 : 279GiB (300GB)
current cd clock frequency : 288000 kHz
maximum cd clock frequency : 624000 kHz
displays connected         : DP-1 DP-2

======================================
             Firmware
======================================
dmc fw loaded             : yes
dmc version               : 1.7
guc fw loaded             : SUCCESS
guc version wanted        : 8.7
guc version found         : 8.7
huc fw loaded             : yes

======================================
             kernel parameters
======================================
quiet drm.debug=0x1e i915.enable_guc_loading=2 i915.enable_guc_submission=2 auto panic=1 nmi_watchdog=panic intel_iommu=igfx_off resume=/dev/sda3 fastboot

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.