tools/intel_reg: Fix segfault in intel_reg dump
PATCH 1/1 tools/intel_reg: Fix segfault in intel_reg dump
We need to zero out the builtin reg spec we are parsing into. Otherwise engine will be uninitialized and we segfault when trying to find engine and accessing reg->engine in later stage.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
--- tools/intel_reg_decode.c | 2 ++ 1 file changed, 2 insertions(+)
tools/intel_reg_decode.c +2 -0
@@ -2748,6 +2748,8 @@ static ssize_t get_regs(struct reg **regs, size_t *nregs, ssize_t index, &known_registers[i].regs[j];struct reg reg; +memset (®,0 ,sizeof (reg)); +/* XXX: Could be optimized. */ parse_port_desc (®,NULL );
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Mika Kuoppala
We need to zero out the builtin reg spec we are parsing into. Otherwise engine will be uninitialized and we segfault when trying to find engine and accessing
reg->enginein later stage.Fixes 7f0be0e7d9be ("tools/intel_reg: Add reading and writing registers through engine")Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
Cc Chris Wilson <[email protected]>Cc Marta Löfstedt <[email protected]>Cc Jani Nikula <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>
Personal preference, I would've gone for = {} but this is fine.
Quoted 16 lines
--- tools/intel_reg_decode.c | 2 ++ 1 file changed, 2 insertions(+)tools/intel_reg_decode.c +2
-0@@ -2748,6 +2748,8 @@ static ssize_t get_regs(struct reg **regs, size_t *nregs, ssize_t index, &known_registers[i].regs[j];struct reg reg; +memset (®,0 ,sizeof (reg)); +/* XXX: Could be optimized. */ parse_port_desc (®,NULL );
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for tools/intel_reg: Fix segfault in intel_reg dump
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: tools/intel_reg: Fix segfault in intel_reg dump
URL : https://patchwork.freedesktop.org/series/37537/
State : success
== Summary ==
IGT patchset tested on top of latest successful build a20a69e25a18ec63236633b804d89cc0c0cea259 overlay: fix invalid pointer access
with latest DRM-Tip kernel build CI_DRM_3716e1b21c16bfaf drm-tip: 2018y-02m-02d-08h-21m-34s UTC integration manifest
No testlist changes.
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:417s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:373s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:488s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:282s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:486s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:469s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:454s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:571s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:281s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:511s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:390s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:398s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:412s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:453s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:413s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:455s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:497s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:452s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:501s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:580s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:426s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:502s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:524s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:491s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:483s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:414s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:431s fi-snb-2520m total:245 pass:211 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:398s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:467s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_853/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for tools/intel_reg: Fix segfault in intel_reg dump
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: tools/intel_reg: Fix segfault in intel_reg dump
URL : https://patchwork.freedesktop.org/series/37537/
State : success
== Summary ==
Test kms_cursor_legacy:
Subgroup flip-vs-cursor-toggle:
pass -> FAIL (shard-snb) fdo#102670
Test perf:
Subgroup blocking:
fail -> PASS (shard-hsw) fdo#102252
Test tools_test:
Subgroup tools_test:
fail -> PASS (shard-apl) fdo#104895
Test kms_vblank:
Subgroup pipe-a-ts-continuation-suspend:
fail -> PASS (shard-hsw) fdo#104783
Test pm_rc6_residency:
Subgroup rc6-accuracy:
skip -> PASS (shard-snb)
Test kms_atomic_transition:
Subgroup plane-all-transition:
skip -> PASS (shard-snb)
Test gem_eio:
Subgroup in-flight:
fail -> PASS (shard-hsw) fdo#104676fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#104895 https://bugs.freedesktop.org/show_bug.cgi?id=104895
fdo#104783 https://bugs.freedesktop.org/show_bug.cgi?id=104783
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
shard-apl total:2836 pass:1750 dwarn:1 dfail:0 fail:21 skip:1064 time:12450s shard-hsw total:2836 pass:1734 dwarn:1 dfail:0 fail:10 skip:1090 time:11698s shard-snb total:2836 pass:1328 dwarn:1 dfail:0 fail:11 skip:1496 time:6446s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_853/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 tools/intel_reg: Fix segfault in intel_reg dump
In reply to Mika KuoppalaWe need to zero out the builtin reg spec we are parsing into. Otherwise engine will be uninitialized and we segfault when trying to find engine and accessing reg->engine in later stage.
v2: use {} (Jani)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
--- tools/intel_reg_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg_decode.c +1 -1
@@ -2746,7 +2746,7 @@ static ssize_t get_regs(struct reg **regs, size_t *nregs, ssize_t index,for (j =0 ; j < known_registers[i].count; j++) {const struct reg_debug *reg_in = &known_registers[i].regs[j]; -struct reg reg; +struct reg reg = {};/* XXX: Could be optimized. */ parse_port_desc (®,NULL );
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Mika Kuoppala
We need to zero out the builtin reg spec we are parsing into. Otherwise engine will be uninitialized and we segfault when trying to find engine and accessing
reg->enginein later stage.
Chris combined both file and builting based fixes. We can omit this. -Mika
Quoted 28 lines
v2: use {} (Jani)
Fixes 7f0be0e7d9be ("tools/intel_reg: Add reading and writing registers through engine")Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
Cc Chris Wilson <[email protected]>Cc Marta Löfstedt <[email protected]>Cc Jani Nikula <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>Reviewed-by Jani Nikula <[email protected]>--- tools/intel_reg_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/intel_reg_decode.c +1
-1@@ -2746,7 +2746,7 @@ static ssize_t get_regs(struct reg **regs, size_t *nregs, ssize_t index,for (j =0 ; j < known_registers[i].count; j++) {const struct reg_debug *reg_in = &known_registers[i].regs[j]; -struct reg reg; +struct reg reg = {};/* XXX: Could be optimized. */ parse_port_desc (®,NULL );Signature · 1 line
2.14.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for tools/intel_reg: Fix segfault in intel_reg dump (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: tools/intel_reg: Fix segfault in intel_reg dump (rev2)
URL : https://patchwork.freedesktop.org/series/37537/
State : success
== Summary ==
IGT patchset tested on top of latest successful build a20a69e25a18ec63236633b804d89cc0c0cea259 overlay: fix invalid pointer access
with latest DRM-Tip kernel build CI_DRM_3716e1b21c16bfaf drm-tip: 2018y-02m-02d-08h-21m-34s UTC integration manifest
No testlist changes.
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:417s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:422s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:373s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:495s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:282s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:482s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:469s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:463s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:571s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:421s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:278s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:512s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:390s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:398s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:412s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:460s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:420s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:459s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:494s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:454s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:502s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:577s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:426s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:511s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:526s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:490s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:481s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:415s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:430s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:529s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:397s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:472s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_857/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: warning for tools/intel_reg: Fix segfault in intel_reg dump (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: tools/intel_reg: Fix segfault in intel_reg dump (rev2)
URL : https://patchwork.freedesktop.org/series/37537/
State : warning
== Summary ==
Test kms_flip_tiling:
Subgroup flip-changes-tiling-yf:
pass -> FAIL (shard-apl) fdo#103822
Test drv_suspend:
Subgroup debugfs-reader:
pass -> SKIP (shard-snb)
Test kms_atomic_transition:
Subgroup plane-all-transition:
skip -> PASS (shard-snb)
Test kms_flip:
Subgroup modeset-vs-vblank-race:
pass -> FAIL (shard-hsw) fdo#103060
Test tools_test:
Subgroup tools_test:
fail -> PASS (shard-apl) fdo#104895
Test testdisplay:
pass -> DMESG-WARN (shard-apl) fdo#104727
Test kms_frontbuffer_tracking:
Subgroup fbc-modesetfrombusy:
pass -> FAIL (shard-apl) fdo#103167
Test kms_vblank:
Subgroup pipe-a-ts-continuation-suspend:
fail -> PASS (shard-hsw) fdo#104783
Test perf:
Subgroup oa-exponents:
fail -> PASS (shard-apl) fdo#102254
Subgroup blocking:
fail -> PASS (shard-hsw) fdo#102252
Test gem_eio:
Subgroup in-flight:
fail -> PASS (shard-hsw) fdo#104676fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#104895 https://bugs.freedesktop.org/show_bug.cgi?id=104895
fdo#104727 https://bugs.freedesktop.org/show_bug.cgi?id=104727
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104783 https://bugs.freedesktop.org/show_bug.cgi?id=104783
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
shard-apl total:2836 pass:1748 dwarn:2 dfail:0 fail:22 skip:1064 time:12420s shard-hsw total:2836 pass:1733 dwarn:1 dfail:0 fail:11 skip:1090 time:11766s shard-snb total:2836 pass:1327 dwarn:1 dfail:0 fail:10 skip:1498 time:6513s
Blacklisted hosts:
shard-kbl total:2819 pass:1855 dwarn:1 dfail:0 fail:23 skip:939 time:9284s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_857/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx