Fix global symbol loading failure in resolve function
PATCH 1/1 Fix global symbol loading failure in resolve function
From: Brandon Hong <[email protected]>
270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc resolver resolve_half_to_float() tries to call unbound global function igt_x86_features(). This patch fixes the issue by adding a F16C checking local function.
--- lib/igt_halffloat.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
lib/igt_halffloat.c +19 -2
@@ -24,6 +24,8 @@#include <assert.h> #include <math.h> +#include <stdbool.h> +#include <cpuid.h> #include "igt_halffloat.h" #include "igt_x86.h"
@@ -182,6 +184,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)#pragma GCC pop_options +static bool f16c_is_supported (void ) +{ +unsigned max =__get_cpuid_max (0 ,NULL ); +unsigned eax, ebx, ecx, edx; + +if (max >=1 ) { +__cpuid (1 , eax, ebx, ecx, edx); + +if (ecx & bit_F16C) +return true; + } +return false; +} +static void float_to_half (const float *f,uint16_t *h,unsigned int num) {for (int i =0 ; i < num; i++)
@@ -194,9 +210,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num) f[i] =_half_to_float (h[i]); } +static void (*resolve_float_to_half (void ))(const float *f,uint16_t *h,unsigned int num) { -if (igt_x86_features () &F16C ) +if (f16c_is_supported ())return float_to_half_f16c;return float_to_half;
@@ -207,7 +224,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)static void (*resolve_half_to_float (void ))(const uint16_t *h,float *f,unsigned int num) { -if (igt_x86_features () &F16C ) +if (f16c_is_supported ())return half_to_float_f16c;return half_to_float;
Signature · 6 lines
2.23.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting [email protected] (2019-09-24 09:02:07)
Quoted 6 lines
From: Brandon Hong <[email protected]>
270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc resolver
resolve_half_to_float()tries to call unbound global functionigt_x86_features(). This patch fixes the issue by adding a F16C checking local function.
So, out of curiosity, why is the global function not bound? -Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Unfortunately, I do not have a clear answer why it's not bound.
I guess it's related to IFUNC lazy binding because I observed crash call stack related to glibc elf_machine_rela() and the crash didn’t happen when I call the same global function igt_x86_features() in rewritten generic FUNC igt_half_to_float() for testing.
- Brandon
Quoted 5 lines · Chris Wilson
Quoting [email protected] (2019-09-24 09:02:07)
Quoted 2 lines
From: Brandon Hong <[email protected]>
Quoted 7 lines
Quoted 4 lines
270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc resolver
resolve_half_to_float()tries to call unbound global functionigt_x86_features(). This patch fixes the issue by adding a F16C checking local function.So, out of curiosity, why is the global function not bound? -Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Fix global symbol loading failure in resolve function
URL : https://patchwork.freedesktop.org/series/67150/
State : warning
== Summary ==
Did not get list of undocumented tests for this run, something is wrong!
Other than that, pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/65845 for more details
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/65845
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Fix global symbol loading failure in resolve function
URL : https://patchwork.freedesktop.org/series/67150/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6946 -> IGTPW_3493
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/67150/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_3493 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_create@basic-files:
- fi-icl-u2: [PASS][1] -> [INCOMPLETE][2] ([fdo#107713] / [fdo#109100])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/fi-icl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@gem_ctx_switch@legacy-render:
- {fi-tgl-u2}: [INCOMPLETE][3] ([fdo#111381]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/fi-tgl-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/fi-tgl-u2/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][5] ([fdo#111407]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/fi-kbl-7500u/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-blb-e6850: [INCOMPLETE][7] ([fdo#107718]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/fi-blb-e6850/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/fi-blb-e6850/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#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
[fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[fdo#111600]: https://bugs.freedesktop.org/show_bug.cgi?id=111600
Participating hosts (54 -> 45)
------------------------------
Missing (9): fi-ilk-m540 fi-bxt-dsi fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-apl-guc fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5198 -> IGTPW_3493
CI-20190529: 20190529
CI_DRM_6946: af23c2755dca7e363fb694a871a2c7d3e1b5d16d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3493: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/
IGT_5198: dde20ad4ebde98770e4da8129cc8e169162c34fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for Fix global symbol loading failure in resolve function
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Fix global symbol loading failure in resolve function
URL : https://patchwork.freedesktop.org/series/67150/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6946_full -> IGTPW_3493_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/67150/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_3493_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_switch@legacy-bsd2-heavy:
- shard-iclb: [PASS][1] -> [SKIP][2] ([fdo#109276]) +14 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb6/igt@[email protected]
* igt@gem_exec_schedule@preempt-other-bsd:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#111325]) +6 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb7/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb1/igt@[email protected]
* igt@i915_selftest@mock_fence:
- shard-iclb: [PASS][5] -> [INCOMPLETE][6] ([fdo#107713])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb4/igt@i915_selftest@mock_fence.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb7/igt@i915_selftest@mock_fence.html
* igt@kms_cursor_crc@pipe-a-cursor-128x42-sliding:
- shard-apl: [PASS][7] -> [FAIL][8] ([fdo#103232])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-apl5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-apl4/igt@[email protected]
- shard-kbl: [PASS][9] -> [FAIL][10] ([fdo#103232])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-kbl6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-kbl1/igt@[email protected]
* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-hsw: [PASS][11] -> [INCOMPLETE][12] ([fdo#103540])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-hsw5/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-hsw2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-stridechange:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +6 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb7/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [PASS][15] -> [FAIL][16] ([fdo#103166])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb1/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb5/igt@kms_psr@psr2_cursor_render.html
* igt@kms_setmode@basic:
- shard-hsw: [PASS][19] -> [FAIL][20] ([fdo#99912])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-hsw6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-hsw8/igt@[email protected]
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-apl: [PASS][21] -> [DMESG-WARN][22] ([fdo#108566]) +5 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-apl5/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-apl3/igt@[email protected]
#### Possible fixes ####
* igt@gem_eio@in-flight-suspend:
- shard-apl: [DMESG-WARN][23] ([fdo#108566]) -> [PASS][24] +5 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-apl3/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-apl1/igt@[email protected]
* igt@gem_exec_schedule@deep-bsd:
- shard-iclb: [SKIP][25] ([fdo#111325]) -> [PASS][26] +4 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb3/igt@[email protected]
* igt@gem_exec_schedule@preempt-queue-contexts-chain-bsd1:
- shard-iclb: [SKIP][27] ([fdo#109276]) -> [PASS][28] +13 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb8/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb1/igt@[email protected]
* igt@gem_softpin@noreloc-s3:
- shard-iclb: [INCOMPLETE][29] ([fdo#107713] / [fdo#109100]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb3/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@[email protected]
* {igt@i915_pm_dc@dc6-dpms}:
- shard-iclb: [FAIL][31] ([fdo#110548]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb3/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-atomic:
- shard-hsw: [FAIL][33] ([fdo#103355]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-hsw1/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-hsw8/igt@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: [FAIL][35] ([fdo#105363]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-glk2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-glk2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
- shard-apl: [INCOMPLETE][37] ([fdo#103927]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-apl1/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-apl4/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt:
- shard-iclb: [FAIL][39] ([fdo#103167]) -> [PASS][40] +3 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt.html
* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [SKIP][41] ([fdo#109642] / [fdo#111068]) -> [PASS][42] +1 similar issue
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb5/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@[email protected]
* igt@kms_psr@no_drrs:
- shard-iclb: [FAIL][43] ([fdo#108341]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb1/igt@kms_psr@no_drrs.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@kms_psr@no_drrs.html
* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [SKIP][45] ([fdo#109441]) -> [PASS][46] +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb6/igt@kms_psr@psr2_cursor_plane_onoff.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
#### Warnings ####
* igt@gem_mocs_settings@mocs-rc6-bsd2:
- shard-iclb: [SKIP][47] ([fdo#109276]) -> [FAIL][48] ([fdo#111330])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb5/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb2/igt@[email protected]
* igt@gem_mocs_settings@mocs-settings-bsd2:
- shard-iclb: [FAIL][49] ([fdo#111330]) -> [SKIP][50] ([fdo#109276])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6946/shard-iclb2/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/shard-iclb3/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#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110548]: https://bugs.freedesktop.org/show_bug.cgi?id=110548
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
[fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (9 -> 6)
------------------------------
Missing (3): pig-skl-6260u shard-skl pig-hsw-4770r
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5198 -> IGTPW_3493
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_6946: af23c2755dca7e363fb694a871a2c7d3e1b5d16d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3493: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3493/
IGT_5198: dde20ad4ebde98770e4da8129cc8e169162c34fe @ 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_3493/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev