GCC warning cleanup
cover GCC warning cleanup
This patchset fixes all the current GCC 8.1.1 warnings found in the IGT.
Rodrigo Siqueira (7):
Remove parameter aliases with another argument Cast void * pointer used in arithmetic to uint32_t* Fix comparison that always evaluates to false Fix truncate string in the snprintf
Make string commands dynamic allocate
Fix truncate string in the strncpy
Avoid truncate string in __igt_lsof_fds
lib/igt_aux.c | 2 +- lib/igt_core.c | 6 +++--- lib/igt_fb.c | 6 ++++-- tests/perf.c | 10 +++++----- tools/intel_gvtg_test.c | 27 ++++++++++++++++++--------- tools/intel_reg.c | 2 +- tools/intel_reg_decode.c | 2 +- 7 files changed, 33 insertions(+), 22 deletions(-)
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/7 Remove parameter aliases with another argument
This commit fixes the following GCC warning:
warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict]
return (readlink (buf, buf, sizeof (buf)) != -1 &&
This commit fixes the GCC warning by creating a second buffer only to keep the path.
--- lib/igt_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/igt_core.c +3 -3
@@ -1169,10 +1169,10 @@ bool igt_can_fail(void)static bool run_under_gdb (void ) { -char buf[1024 ]; +char pathname[1024 ], buf[1024 ]; -sprintf (buf,"/proc/%d/exe" ,getppid ()); -return (readlink (buf, buf,sizeof (buf)) !=-1 && +sprintf (pathname,"/proc/%d/exe" ,getppid ()); +return (readlink (pathname, buf,sizeof (buf)) !=-1 &&strncmp (basename (buf),"gdb" ,3 ) ==0 ); }
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [Intel-gfx] [PATCH i-g-t 1/7] Remove parameter aliases with another argument
Quoted 19 lines · Rodrigo Siqueira
This commit fixes the following GCC warning:
warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict]
return (readlink (buf, buf, sizeof (buf)) != -1 &&This commit fixes the GCC warning by creating a second buffer only to keep the path.
Signed-off-by Rodrigo Siqueira <[email protected]>--- lib/igt_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/igt_core.c +0
-0
lib/igt_core.c bool igt_can_fail(void) · line 1172
Quoted 5 lines
lib/igt_core.c +1
-1@@ -1169,10 +1169,10 @@ bool igt_can_fail(void)static bool run_under_gdb (void ) { -char buf[1024 ]; +char pathname[1024 ], buf[1024 ];
1024 for pathname is quite an overshoot. We stash at most "/proc/%d/exec" where %d should be at most 21 or so.
lib/igt_core.c bool igt_can_fail(void) · line 1175
Quoted 4 lines
lib/igt_core.c +2
-2-sprintf (buf,"/proc/%d/exe" ,getppid ()); - return (readlink (buf, buf, sizeof (buf)) != -1 && +sprintf (pathname,"/proc/%d/exe" ,getppid ()); + return (readlink (pathname, buf, sizeof (buf)) != -1 &&
^ while we are here we can get rid of that space
Quoted 6 lines
lib/igt_core.c +0
-0strncmp(basename(buf), "gdb", 3) == 0); }Signature · 1 line
2.18.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/7 Cast void * pointer used in arithmetic to uint32_t*
In reply to Rodrigo SiqueiraThis commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10,
^
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[1], 0x80,This commit cast the ptr pointer, which is a void *, to uint32_t * in the pointer arithmetic operation.
--- lib/igt_fb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/igt_fb.c +4 -2
@@ -410,9 +410,11 @@ static int create_bo_for_fb(int fd, int width, int height,switch (format->drm_id) {case DRM_FORMAT_NV12 : -memset (ptr + offsets[0 ], full_range ?0x00 :0x10 , +memset (((uint32_t *)ptr) + offsets[0 ], + full_range ?0x00 :0x10 , calculated_stride * height); -memset (ptr + offsets[1 ],0x80 , +memset (((uint32_t *)ptr) + offsets[1 ], +0x80 , calculated_stride * height/2 );break ;case DRM_FORMAT_YUYV :
Signature · 6 lines
2.18.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
Quoted 10 lines · Rodrigo Siqueira
This commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80,This commit cast the ptr pointer, which is a void *, to
uint32_t* in the pointer arithmetic operation.
This will change semantics, as according to GNU C standard[1], void pointers have a size of 1 for all arithmetical purposes.
So you should be using uint8_t (or char) pointer instead.
[1]: http://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
Quoted 26 lines
Signed-off-by Rodrigo Siqueira <[email protected]>--- lib/igt_fb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)lib/igt_fb.c +4
-2@@ -410,9 +410,11 @@ static int create_bo_for_fb(int fd, int width, int height,switch (format->drm_id) {case DRM_FORMAT_NV12 : -memset (ptr + offsets[0 ], full_range ?0x00 :0x10 , +memset (((uint32_t *)ptr) + offsets[0 ], + full_range ?0x00 :0x10 , calculated_stride * height); -memset (ptr + offsets[1 ],0x80 , +memset (((uint32_t *)ptr) + offsets[1 ], +0x80 , calculated_stride * height/2 );break ;case DRM_FORMAT_YUYV :Signature · 1 line
2.18.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
Quoting Arkadiusz Hiler (2018-07-10 14:58:49)
Quoted 9 lines · Rodrigo Siqueira
Quoted 8 lines
This commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80,
Quoted 7 lines
Quoted 2 lines
This commit cast the ptr pointer, which is a void *, to
uint32_t* in the pointer arithmetic operation.This will change semantics, as according to GNU C standard[1], void pointers have a size of 1 for all arithmetical purposes.
So you should be using
uint8_t(or char) pointer instead.
Please just fix the compiler flags, we want close compatibility with the kernel coding standards which explicitly allow void arithmetic for the simplicity it lends to writing code.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
Quoted 16 lines · Chris Wilson
Quoting Arkadiusz Hiler (2018-07-10 14:58:49)
Quoted 15 lines · Rodrigo Siqueira
Quoted 10 lines
This commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80,This commit cast the ptr pointer, which is a void *, to
uint32_t* in the pointer arithmetic operation.This will change semantics, as according to GNU C standard[1], void pointers have a size of 1 for all arithmetical purposes.
Quoted 6 lines
Quoted 1 line
So you should be using
uint8_t(or char) pointer instead.Please just fix the compiler flags, we want close compatibility with the kernel coding standards which explicitly allow void arithmetic for the simplicity it lends to writing code.
-Chris
Fair point.
We don't rise the error with meson, so it is not a change in the gcc defaults. Somehow autotools manage to end up adding -Wpointer-arith to BASE_CFLAGS.
I don't think we should invest time into making autotools behave, since it's going to be dropped completely. Hopefully this will happen sooner than later.
Signature · 6 lines
Cheers, Arek _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
Quoting Arkadiusz Hiler (2018-07-10 15:38:26)
Quoted 24 lines · Chris Wilson
Quoted 16 lines
Quoting Arkadiusz Hiler (2018-07-10 14:58:49)
Quoted 15 lines · Rodrigo Siqueira
Quoted 10 lines
This commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80,This commit cast the ptr pointer, which is a void *, to
uint32_t* in the pointer arithmetic operation.This will change semantics, as according to GNU C standard[1], void pointers have a size of 1 for all arithmetical purposes.
Quoted 6 lines
Quoted 1 line
So you should be using
uint8_t(or char) pointer instead.Please just fix the compiler flags, we want close compatibility with the kernel coding standards which explicitly allow void arithmetic for the simplicity it lends to writing code.
-Chris
Quoted 5 lines
Fair point.
We don't rise the error with meson, so it is not a change in the gcc defaults. Somehow autotools manage to end up adding -Wpointer-arith to
BASE_CFLAGS.
iirc, it's pulled in from xorg-macros. Maybe just tack a -Wnopointer-arith onto the end, or sed away. -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [igt-dev] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t*
In reply to Arkadiusz HilerHi,
Thanks for the feedback,
I'm just a little bit confused about the next step here. Is it worth to fix this patch and the others? I got confused since you said that IGT will remove autotools and some of the warnings here does not appear on meson.
Best Regards
Rodrigo Siqueira
Quoted 26 lines · Arkadiusz Hiler
Quoted 16 lines · Chris Wilson
Quoting Arkadiusz Hiler (2018-07-10 14:58:49)
Quoted 15 lines · Rodrigo Siqueira
Quoted 10 lines
This commit fixes the GCC warning:
warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80,This commit cast the ptr pointer, which is a void *, to
uint32_t* in the pointer arithmetic operation.This will change semantics, as according to GNU C standard[1], void pointers have a size of 1 for all arithmetical purposes.
Quoted 6 lines
Quoted 1 line
So you should be using
uint8_t(or char) pointer instead.Please just fix the compiler flags, we want close compatibility with the kernel coding standards which explicitly allow void arithmetic for the simplicity it lends to writing code.
-ChrisFair point.
Quoted 11 lines
We don't rise the error with meson, so it is not a change in the gcc defaults. Somehow autotools manage to end up adding -Wpointer-arith to
BASE_CFLAGS.I don't think we should invest time into making autotools behave, since it's going to be dropped completely. Hopefully this will happen sooner than later.
Signature · 2 lines
Cheers, Arek
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/7 Fix comparison that always evaluates to false
In reply to Rodrigo SiqueiraThis commit fix the GCC warning:
warning: bitwise comparison always evaluates to false [-Wtautological-compare]
} else if ((val & DPLLB_MODE_LVDS) == DPLLB_MODE_DAC_SERIAL) {
The first comparison already checks DPLLB_MODE_LVDS, in this sense, the second 'if' condition always will be false. This commit changes the comparison to DPLLB_MODE_DAC_SERIAL.
--- tools/intel_reg_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg_decode.c +1 -1
@@ -1277,7 +1277,7 @@ DEBUGSTRING(ironlake_debug_pch_dpll) p2 ="Div 7" ; else p2 ="Div 14" ; - }else if ((val &DPLLB_MODE_LVDS ) ==DPLLB_MODE_DAC_SERIAL ) { + }else if ((val &DPLLB_MODE_DAC_SERIAL ) ==DPLLB_MODE_DAC_SERIAL ) { mode ="Non-LVDS" ;if (val &DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 ) p2 ="Div 5" ;
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 4/7 Fix truncate string in the snprintf
In reply to Rodrigo SiqueiraThis patch fix the following GCC warning:
intel_reg.c: In function ‘dump_decode’:
warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
snprintf(decode, sizeof(decode), "\n%s", bin);
intel_reg.c:203:3: note: ‘snprintf’ output between 2 and 1025 bytes into a destination of size 1024 [..]
--- tools/intel_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg.c +1 -1
@@ -180,7 +180,7 @@ static void to_binary(char *buf, size_t buflen, uint32_t val)static void dump_decode (struct config *config,struct reg *reg,uint32_t val) { -char decode[1024 ]; +char decode[2060 ];char tmp[1024 ];char bin[1024 ];
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 4/7] Fix truncate string in the snprintf
Quoted 7 lines · Rodrigo Siqueira
This patch fix the following GCC warning:
intel_reg.c: In function ‘dump_decode’:
warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
snprintf(decode, sizeof(decode), "\n%s", bin);
intel_reg.c:203:3: note: ‘snprintf’ output between 2 and 1025 bytes into a destination of size 1024 [..]
That's an odd error.
Line 203:
snprintf(decode, sizeof(decode), "\n%s", bin);
man snprintf states:
The functions snprintf() and vsnprintf() write at most size bytes (including the terminating null byte ('\0')) to str.
So this should be truncated correctly. Am I missing something?
I'll set up gcc 8.1 tomorrow and poke around.
Quoted 21 lines
Signed-off-by Rodrigo Siqueira <[email protected]>--- tools/intel_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/intel_reg.c +1
-1@@ -180,7 +180,7 @@ static void to_binary(char *buf, size_t buflen, uint32_t val)static void dump_decode (struct config *config,struct reg *reg,uint32_t val) { -char decode[1024 ]; +char decode[2060 ];char tmp[1024 ];char bin[1024 ];Signature · 1 line
2.18.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 5/7 Make string commands dynamic allocate
In reply to Rodrigo SiqueiraThis patch fix the following GCC warning:
intel_gvtg_test.c: In function ‘create_guest’:
intel_gvtg_test.c:127:50: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 4077 [-Wformat-overflow=] [..]
intel_gvtg_test.c:127:5: note: ‘sprintf’ output between 36 and 8226 bytes into a destination of size 4096
[..]
This patch changes the approach for allocating memory to handle QEMU commands by dynamically allocate space to save the whole command.
--- tools/intel_gvtg_test.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
tools/intel_gvtg_test.c +18 -9
@@ -120,16 +120,25 @@ static int check_tools(void)static void create_guest (void ) { -char create_qcow_cmd[PATH_MAX ] = {0 }; -char create_vgpu_cmd[PATH_MAX ] = {0 }; -char create_instance_cmd[PATH_MAX ] = {0 }; +unsigned int max_size_cmd =sysconf (_SC_ARG_MAX); +char *command; -sprintf (create_qcow_cmd,"qemu-img create -b %s -f qcow2 %s.qcow2" , + command =malloc (max_size_cmd); +if (!command) +return ; + +sprintf (command,"qemu-img create -b %s -f qcow2 %s.qcow2" , hda_path, hda_path); -sprintf (create_vgpu_cmd,"echo \"%s\" > /sys/bus/pci/devices/0000:00:02.0/" +igt_assert_eq (system (command),0 ); +memset (command,0 , max_size_cmd); + +sprintf (command,"echo \"%s\" > /sys/bus/pci/devices/0000:00:02.0/" "mdev_supported_types/$(ls /sys/bus/pci/devices/0000:00:02.0/" "mdev_supported_types |awk {'print $1'}|tail -1)/create" , uuid); -sprintf (create_instance_cmd,"%s -m 2048 -smp 2 -M pc -name gvtg_guest" +igt_assert_eq (system (command),0 ); +memset (command,0 , max_size_cmd); + +sprintf (command,"%s -m 2048 -smp 2 -M pc -name gvtg_guest" " -hda %s.qcow2 -bios %s -enable-kvm --net nic,macaddr=%s -net" " tap,script=/etc/qemu-ifup -vga cirrus -k en-us" " -serial stdio -vnc :1 -machine kernel_irqchip=on -global"
@@ -137,9 +146,9 @@ static void create_guest(void)" -usb -usbdevice tablet -device vfio-pci,sysfsdev=" "/sys/bus/pci/devices/0000:00:02.0/%s &" , qemu_path, hda_path, bios_path, mac_addr, uuid); -igt_assert_eq (system (create_qcow_cmd),0 ); -igt_assert_eq (system (create_vgpu_cmd),0 ); -igt_assert_eq (system (create_instance_cmd),0 ); +igt_assert_eq (system (command),0 ); + +free (command); }static void destroy_all_guest (void )
Signature · 6 lines
2.18.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [igt-dev] [PATCH i-g-t 5/7] Make string commands dynamic allocate
Quoted 23 lines · Rodrigo Siqueira
This patch fix the following GCC warning:
intel_gvtg_test.c: In function ‘create_guest’:
intel_gvtg_test.c:127:50: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 4077 [-Wformat-overflow=] [..]
intel_gvtg_test.c:127:5: note: ‘sprintf’ output between 36 and 8226 bytes into a destination of size 4096
[..]This patch changes the approach for allocating memory to handle QEMU commands by dynamically allocate space to save the whole command.
Signed-off-by Rodrigo Siqueira <[email protected]>--- tools/intel_gvtg_test.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)tools/intel_gvtg_test.c +0
-0
tools/intel_gvtg_test.c static int check_tools(void) · line 123
Quoted 7 lines
tools/intel_gvtg_test.c +1
-3@@ -120,16 +120,25 @@ static int check_tools(void)static void create_guest (void ) { -char create_qcow_cmd[PATH_MAX ] = {0 }; -char create_vgpu_cmd[PATH_MAX ] = {0 }; -char create_instance_cmd[PATH_MAX ] = {0 }; +unsigned int max_size_cmd =sysconf (_SC_ARG_MAX);
That's 2097152 on my system. Quite an overkill. I know that we have lazy page table assigement, but memseting the whole 2GB defeats it.
The qemu invocation looks like the longest one, and we have 3 components that may take up to PATH_MAX each and some extra stuff, so going with 4*PATH_MAX should be enough.
BTW, why do you memset it to 0 before each sprintf?
Signature · 6 lines
Cheers, Arek _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 6/7 Fix truncate string in the strncpy
In reply to Rodrigo SiqueiraThis patch fix the following GCC Warnings:
warning: ‘strncpy’ output truncated before terminating nul copying 36 bytes from a string of the same length [-Wstringop-truncation] [..]
--- tests/perf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tests/perf.c +5 -5
@@ -3693,7 +3693,7 @@ test_invalid_create_userspace_config(void)igt_assert_eq (__i915_perf_add_config (drm_fd, &config), -EINVAL );/* invalid mux_regs */ -strncpy (config.uuid, uuid,sizeof (config.uuid)); +strncpy (config.uuid, uuid,strlen (config.uuid)); config.n_mux_regs =1 ; config.mux_regs_ptr =to_user_pointer (invalid_mux_regs); config.n_boolean_regs =0 ;
@@ -3702,7 +3702,7 @@ test_invalid_create_userspace_config(void)igt_assert_eq (__i915_perf_add_config (drm_fd, &config), -EINVAL );/* empty config */ -strncpy (config.uuid, uuid,sizeof (config.uuid)); +strncpy (config.uuid, uuid,strlen (config.uuid)); config.n_mux_regs =0 ; config.mux_regs_ptr =to_user_pointer (mux_regs); config.n_boolean_regs =0 ;
@@ -3711,7 +3711,7 @@ test_invalid_create_userspace_config(void)igt_assert_eq (__i915_perf_add_config (drm_fd, &config), -EINVAL );/* empty config with null pointers */ -strncpy (config.uuid, uuid,sizeof (config.uuid)); +strncpy (config.uuid, uuid,strlen (config.uuid)); config.n_mux_regs =1 ; config.mux_regs_ptr =to_user_pointer (NULL ); config.n_boolean_regs =2 ;
@@ -3722,7 +3722,7 @@ test_invalid_create_userspace_config(void)igt_assert_eq (__i915_perf_add_config (drm_fd, &config), -EINVAL );/* invalid pointers */ -strncpy (config.uuid, uuid,sizeof (config.uuid)); +strncpy (config.uuid, uuid,strlen (config.uuid)); config.n_mux_regs =42 ; config.mux_regs_ptr =to_user_pointer ((void *)0xDEADBEEF ); config.n_boolean_regs =0 ;
@@ -3809,7 +3809,7 @@ test_create_destroy_userspace_config(void)i915_perf_remove_config (drm_fd, config_id);memset (&config,0 ,sizeof (config)); -strncpy (config.uuid, uuid,sizeof (config.uuid)); +strncpy (config.uuid, uuid,strlen (config.uuid)); config.n_mux_regs =1 ; config.mux_regs_ptr =to_user_pointer (mux_regs);
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 7/7 Avoid truncate string in __igt_lsof_fds
In reply to Rodrigo SiqueiraNote that 'proc_path' parameter in __igt_lsof_fds receives a string which was initialized with the size of PATH_MAX and the local variable 'path' has the same size, but it also have to append: '/', '\0', and the directory name. This situation caused the warning described below.
warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/%s", proc_path, d->d_name);
note: ‘snprintf’ output between 2 and 4352 bytes into a destination of size 4096 [..]
This commit fixes this problem by changing the string size passed by __igt_lsoft to __igt_lsof_fds. The max size for the string is strlen("/proc/%d/cwd")+1 where "%d" can be estimated with CEILING(LOG_10(INT_MAX)), in this sense, it is safe to define a path size of 30 characters.
--- lib/igt_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_aux.c +1 -1
@@ -1485,7 +1485,7 @@ __igt_lsof(const char *dir)PROCTAB *proc;proc_t *proc_info; -char path[PATH_MAX ]; +char path[30 ];char *name_lnk;struct stat st;int state =0 ;
Signature · 6 lines
2.18.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for GCC warning cleanup
In reply to Rodrigo Siqueira== Series Details ==
== Series Details ==
Series: GCC warning cleanup
URL : https://patchwork.freedesktop.org/series/46119/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4445 -> IGTPW_1542 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/46119/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1542 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_suspend@basic-s4-devices:
fi-kbl-7500u: PASS -> DMESG-WARN (fdo#107139, fdo#105128)
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-kbl-r: PASS -> DMESG-WARN (fdo#105602) +1
igt@kms_frontbuffer_tracking@basic:
fi-bxt-j4205: PASS -> FAIL (fdo#103167)
fi-skl-6700hq: PASS -> FAIL (fdo#103167)
fi-bxt-dsi: PASS -> FAIL (fdo#103167)
fi-skl-6700k2: PASS -> FAIL (fdo#103167)
fi-kbl-7560u: PASS -> FAIL (fdo#103167)
fi-skl-6600u: PASS -> FAIL (fdo#103167)
fi-kbl-r: PASS -> FAIL (fdo#103167)
{fi-cfl-8109u}: NOTRUN -> FAIL (fdo#103167)
fi-skl-6260u: PASS -> FAIL (fdo#103167)
fi-skl-6770hq: PASS -> FAIL (fdo#103167)
fi-cfl-guc: PASS -> FAIL (fdo#103167)
fi-cfl-s3: PASS -> FAIL (fdo#103167)
fi-whl-u: PASS -> FAIL (fdo#103167)
fi-cfl-8700k: PASS -> FAIL (fdo#103167)
fi-kbl-7500u: PASS -> FAIL (fdo#103167)
fi-kbl-7567u: PASS -> FAIL (fdo#103167)
fi-skl-guc: PASS -> FAIL (fdo#103167)
fi-glk-j4005: PASS -> FAIL (fdo#103167)
fi-glk-dsi: PASS -> FAIL (fdo#103167)
fi-skl-gvtdvm: PASS -> FAIL (fdo#103167)
==== Possible fixes ====
igt@gem_exec_suspend@basic-s3:
{fi-cfl-8109u}: INCOMPLETE -> PASS {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
== Participating hosts (47 -> 41) ==
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-8809g
== Build changes ==
* IGT: IGT_4540 -> IGTPW_1542
CI_DRM_4445: 366234e5605ce58f732d2aeb83c713dde6b7c85c @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1542: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1542/
IGT_4540: 78071c2fa53db2f04b8eddc6e6118be4fbc5c2fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1542/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for GCC warning cleanup
In reply to Rodrigo Siqueira== Series Details ==
== Series Details ==
Series: GCC warning cleanup
URL : https://patchwork.freedesktop.org/series/46119/
State : failure
== Summary ==
= CI Bug Log - changes from IGT_4540_full -> IGTPW_1542_full =
== Summary - FAILURE ==
Serious unknown changes coming with IGTPW_1542_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_1542_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/46119/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1542_full:
=== IGT changes ===
==== Possible regressions ====
igt@kms_plane@pixel-format-pipe-b-planes:
shard-kbl: PASS -> CRASH +7
igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
shard-glk: PASS -> CRASH +10
igt@perf@create-destroy-userspace-config:
shard-glk: PASS -> FAIL +6
shard-apl: PASS -> FAIL +3
shard-hsw: PASS -> FAIL +1
igt@perf@invalid-create-userspace-config:
shard-kbl: PASS -> FAIL +3
==== Warnings ====
igt@gem_exec_schedule@deep-vebox:
shard-kbl: SKIP -> PASS +1
igt@gem_tiled_swapping@non-threaded:
shard-hsw: PASS -> SKIP== Known issues ==
Here are the changes found in IGTPW_1542_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_gtt:
shard-glk: PASS -> FAIL (fdo#105347, fdo#107127)
igt@gem_ctx_isolation@vecs0-s3:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@gem_exec_basic@basic-bsd:
shard-snb: PASS -> INCOMPLETE (fdo#105411)
igt@kms_draw_crc@draw-method-xrgb2101010-render-untiled:
shard-apl: PASS -> FAIL (fdo#103184) +2
igt@kms_draw_crc@draw-method-xrgb2101010-render-xtiled:
shard-kbl: PASS -> FAIL (fdo#103184) +2
igt@kms_draw_crc@draw-method-xrgb8888-render-ytiled:
shard-apl: PASS -> FAIL (fdo#103232)
shard-glk: PASS -> FAIL (fdo#103232)
shard-kbl: PASS -> FAIL (fdo#103232)
igt@kms_flip_tiling@flip-x-tiled:
shard-glk: PASS -> FAIL (fdo#103822) +1
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
shard-apl: PASS -> FAIL (fdo#103167) +5
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
shard-kbl: PASS -> FAIL (fdo#103167) +5
igt@kms_frontbuffer_tracking@fbc-2p-pri-indfb-multidraw:
shard-glk: PASS -> FAIL (fdo#103167) +10
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
==== Possible fixes ====
igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
shard-glk: FAIL (fdo#106509, fdo#105454) -> PASS
igt@kms_flip@2x-plain-flip-ts-check-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#105363, fdo#102887) -> PASS
igt@kms_flip_tiling@flip-to-y-tiled:
shard-glk: FAIL (fdo#103822) -> PASS
igt@kms_frontbuffer_tracking@fbc-1p-indfb-fliptrack:
shard-snb: INCOMPLETE (fdo#105411) -> PASS
igt@kms_rotation_crc@sprite-rotation-180:
shard-snb: FAIL (fdo#103925) -> PASS
igt@testdisplay:
shard-glk: INCOMPLETE (k.org#198133, fdo#103359) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#107127 https://bugs.freedesktop.org/show_bug.cgi?id=107127
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* IGT: IGT_4540 -> IGTPW_1542
* Linux: CI_DRM_4443 -> CI_DRM_4445
CI_DRM_4443: 5c43ea095bbd1469a9c767529537ddf0434acc60 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4445: 366234e5605ce58f732d2aeb83c713dde6b7c85c @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1542: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1542/
IGT_4540: 78071c2fa53db2f04b8eddc6e6118be4fbc5c2fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1542/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev