[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2021-01-09 Thread Bernhard Voelker
Update of bug #57277 (project findutils):

 Open/Closed:Open => Closed 
 Release:None => 4.7.0  
   Fixed Release:None => 4.8.0  


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2020-01-06 Thread Bernhard Voelker
Update of bug #57277 (project findutils):

  Status:None => Fixed  

___

Follow-up Comment #6:

Thanks, Bruno.

The attached picks up the gnulib patch by updating to latest.
Pushed at:
https://git.sv.gnu.org/cgit/findutils.git/commit/?id=28f11d689dc6




(file #48170)
___

Additional Item Attachment:

File name: 0001-maint-update-gnulib-to-latest.patch Size:0 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2020-01-05 Thread Bernhard Voelker
Update of bug #57277 (project findutils):

 Assigned to:None => berny  


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2020-01-05 Thread Bruno Haible
Follow-up Comment #5, bug #57277 (project findutils):

Fixed in gnulib today:
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=b7d7afe10ddf599452bd80b8a840c830cd474b09

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2019-11-21 Thread Bruno Haible
Follow-up Comment #4, bug #57277 (project findutils):

> One can't decorate a function with nonnull attribute and then call the
function with NULL. Doing that, an optimizing compiler can do aggressive
optimizations.

__attribute__ __nonnull__ actually means two things:
1) The compiler may emit warnings when the function is invoked with null
arguments.
2) Unless the option -fno-delete-null-pointer-checks is specified, the
compiler may make optimizations, assuming that the function will not be
invoked with null arguments.

Source:
https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Common-Function-Attributes.html

> either ... or ...

Or you pass the option -fno-delete-null-pointer-checks when compiling the
code. (I'm not asking you to use this option. Only clarifying that there is a
third choice.)

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2019-11-21 Thread Martin Liška
Follow-up Comment #3, bug #57277 (project findutils):


[comment #1 comment #1:]
> First of all, the fix for this should go into gnulib --> adding their ML.
> 
> Then, this test actually wants to verify the behavior of that
> function when called with a NULL value (it should return NULL
> and set errno to EINVAL).
> Therefore, the test needs to suppress that specific sanitizer
> error.

No, it's not a sanitizer error, it's an error in gnulib code. One can't
decorate a function with nonnull attribute and then call the function
with NULL. Doing that, an optimizing compiler can do aggressive
optimizations.
So either the function canonicalize_file_name should accept (and handle
NULL),
then remove the nonnull attribute, or it can't and then one can't call
the function with NULL.
Thanks.

 I don't have a GCC 10, so does something like the
> following work?
> 
> 
> a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
> index 4ce06e46c..4e7d47c57 100644
> --- a/tests/test-canonicalize-lgpl.c
> +++ b/tests/test-canonicalize-lgpl.c
> @@ -39,6 +39,9 @@ SIGNATURE_CHECK (canonicalize_file_name, char *, (const
char *));
>  
>  #define BASE "t-can-lgpl.tmp"
>  
> +/* Suppress -fsanitize=null error - seen on GCC 10 - for this test.  */
> +extern char *canonicalize_file_name (const char *)
__attribute__((no_sanitize("null")));
> +
>  int
>  main (void)
>  {
> 

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2019-11-20 Thread Bruno Haible
Follow-up Comment #2, bug #57277 (project findutils):

Will this patch, that uses the same technique as canonicalize-lgpl.c, work? I
can't test it, because I don't have a GCC 10 installed.


diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index 4ce06e4..d9a9773 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -16,6 +16,10 @@
 
 /* Written by Bruno Haible , 2007.  */
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise
the
+   undefined-behaviour of GCC or clang may let the test with null_ptr crash. 
*/
+#define _GL_ARG_NONNULL(params)
+
 #include 
 
 #include 



___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2019-11-20 Thread Bernhard Voelker
Follow-up Comment #1, bug #57277 (project findutils):

First of all, the fix for this should go into gnulib --> adding their ML.

Then, this test actually wants to verify the behavior of that
function when called with a NULL value (it should return NULL
and set errno to EINVAL).
Therefore, the test needs to suppress that specific sanitizer
error. I don't have a GCC 10, so does something like the
following work?


a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index 4ce06e46c..4e7d47c57 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -39,6 +39,9 @@ SIGNATURE_CHECK (canonicalize_file_name, char *, (const char
*));
 
 #define BASE "t-can-lgpl.tmp"
 
+/* Suppress -fsanitize=null error - seen on GCC 10 - for this test.  */
+extern char *canonicalize_file_name (const char *)
__attribute__((no_sanitize("null")));
+
 int
 main (void)
 {


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #57277] FAIL: test-canonicalize-lgpl with GCC 10

2019-11-20 Thread Martin Liška
URL:
  

 Summary: FAIL: test-canonicalize-lgpl with GCC 10
 Project: findutils
Submitted by: marxin
Submitted on: Wed 20 Nov 2019 02:55:21 PM UTC
Category: None
Severity: 3 - Normal
  Item Group: None
  Status: None
 Privacy: Public
 Assigned to: None
 Originator Name: 
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Release: None
   Fixed Release: None

___

Details:

Similarly to:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38280

the test fails for the very same reason.




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/