Re: [petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Jeremy Luke Thompson
Yeah, I misunderstood. That's what I get for reading emails before coffee.

Note, there are some known ASAN issues, specifically with one of our
diagonal assembly tests, but I haven't had the time to make a good fix and
it's not used in our Ratel or fluids work at this time.

On Tuesday, June 13, 2023, Matthew Knepley  wrote:
> On Tue, Jun 13, 2023 at 9:18 AM Jeremy Luke Thompson <
jeremy.thomp...@colorado.edu> wrote:
>>
>> It's probably easier to trace that sort of thing when building libCEED
on its own, but it looks like ASAN is complaining about `char
*source_path_with_name = "";`
>>
>> Seems like an easy change I can do this morning.
>
> It is a warning. The fatal error was a link without the ASAN flag, but
somehow this is swallowed. Jacob found it.
>   Thanks,
>  Matt
>
>>
>> On Tuesday, June 13, 2023, Matthew Knepley  wrote:
>> > For some reason, libCEED seems broken with Address Sanitizer
>> >
*
>> >UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log
for details):
>> >
-
>> >   Error running make on libceed: Could not execute
"[['/PETSc3/petsc/apple/bin/make',
>> >   '-j13', '-l24.0',
'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug', 'V=1',
>> >   'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall
-Wwrite-strings
>> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
-Qunused-arguments
>> >   -fvisibility=hidden -fsanitize=address ',
'CXX=/PETSc3/petsc/apple/bin/mpicxx',
>> >   'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing
-Wno-unknown-pragmas
>> >   -fstack-protector -fno-stack-check -fvisibility=hidden
-fsanitize=address  -std=gnu++17
>> >   -fPIC ', '-B']]":
>> >
>> >   make: 'lib' with optional backends: /cpu/self/memcheck/serial
/cpu/self/memcheck/blocked
>> >   /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
>> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
-Qunused-arguments
>> >   -fvisibility=hidden -f
>> >    more output .
>> >   mcheck/ceed-memcheck-qfunction.o
build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
>> >   build/backends/memcheck/ceed-memcheck-serial.o
>> >   build/backends/memcheck/ceed-memcheck-vector.o
build/backends/ceed-backend-weak.o
>> >   build/gallery/ceed-gallery-weak.o
>> >
-lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
>> >   warning: initializing 'char *' with an expression of type 'const
char [1]' discards
>> >   qualifiers [-Wincompatible-pointer-types-discards-qualifier
>> >    more error .
>> >   ceed-operator.o
>> >   _asan.module_ctor in ceed-preconditioning.o
>> >   ...
>> >   ld: symbol(s) not found for architecture x86_64
>> >   clang: error: linker command failed with exit code 1 (use -v to see
invocation)
>> >   make: *** [Makefile:517: lib/libceed.dylib] Error 1
>> >
>> > Does anyone else see this?
>> >
>> >   Thanks,
>> >  Matt
>> >
>> > --
>> > What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
>> > -- Norbert Wiener
>> > https://www.cse.buffalo.edu/~knepley/
>> >
>
> --
> What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
> -- Norbert Wiener
> https://www.cse.buffalo.edu/~knepley/
>


Re: [petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Matthew Knepley
On Tue, Jun 13, 2023 at 9:18 AM Jeremy Luke Thompson <
jeremy.thomp...@colorado.edu> wrote:

> It's probably easier to trace that sort of thing when building libCEED on
> its own, but it looks like ASAN is complaining about `char
> *source_path_with_name = "";`
>
> Seems like an easy change I can do this morning.
>

It is a warning. The fatal error was a link without the ASAN flag, but
somehow this is swallowed. Jacob found it.

  Thanks,

 Matt


> On Tuesday, June 13, 2023, Matthew Knepley  wrote:
> > For some reason, libCEED seems broken with Address Sanitizer
> >
> *
> >UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for
> details):
> >
> -
> >   Error running make on libceed: Could not execute
> "[['/PETSc3/petsc/apple/bin/make',
> >   '-j13', '-l24.0',
> 'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug', 'V=1',
> >   'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall
> -Wwrite-strings
> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
> -Qunused-arguments
> >   -fvisibility=hidden -fsanitize=address ',
> 'CXX=/PETSc3/petsc/apple/bin/mpicxx',
> >   'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing
> -Wno-unknown-pragmas
> >   -fstack-protector -fno-stack-check -fvisibility=hidden
> -fsanitize=address  -std=gnu++17
> >   -fPIC ', '-B']]":
> >
> >   make: 'lib' with optional backends: /cpu/self/memcheck/serial
> /cpu/self/memcheck/blocked
> >   /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
> -Qunused-arguments
> >   -fvisibility=hidden -f
> >    more output .
> >   mcheck/ceed-memcheck-qfunction.o
> build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
> >   build/backends/memcheck/ceed-memcheck-serial.o
> >   build/backends/memcheck/ceed-memcheck-vector.o
> build/backends/ceed-backend-weak.o
> >   build/gallery/ceed-gallery-weak.o
> >
> -lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
> >   warning: initializing 'char *' with an expression of type 'const char
> [1]' discards
> >   qualifiers [-Wincompatible-pointer-types-discards-qualifier
> >    more error .
> >   ceed-operator.o
> >   _asan.module_ctor in ceed-preconditioning.o
> >   ...
> >   ld: symbol(s) not found for architecture x86_64
> >   clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> >   make: *** [Makefile:517: lib/libceed.dylib] Error 1
> >
> > Does anyone else see this?
> >
> >   Thanks,
> >  Matt
> >
> > --
> > What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> > -- Norbert Wiener
> > https://www.cse.buffalo.edu/~knepley/
> >



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Jeremy Luke Thompson
It's probably easier to trace that sort of thing when building libCEED on
its own, but it looks like ASAN is complaining about `char
*source_path_with_name = "";`

Seems like an easy change I can do this morning.

On Tuesday, June 13, 2023, Matthew Knepley  wrote:
> For some reason, libCEED seems broken with Address Sanitizer
>
*
>UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for
details):
>
-
>   Error running make on libceed: Could not execute
"[['/PETSc3/petsc/apple/bin/make',
>   '-j13', '-l24.0',
'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug', 'V=1',
>   'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall -Wwrite-strings
>   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
-Qunused-arguments
>   -fvisibility=hidden -fsanitize=address ',
'CXX=/PETSc3/petsc/apple/bin/mpicxx',
>   'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing
-Wno-unknown-pragmas
>   -fstack-protector -fno-stack-check -fvisibility=hidden
-fsanitize=address  -std=gnu++17
>   -fPIC ', '-B']]":
>
>   make: 'lib' with optional backends: /cpu/self/memcheck/serial
/cpu/self/memcheck/blocked
>   /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
>   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
-Qunused-arguments
>   -fvisibility=hidden -f
>    more output .
>   mcheck/ceed-memcheck-qfunction.o
build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
>   build/backends/memcheck/ceed-memcheck-serial.o
>   build/backends/memcheck/ceed-memcheck-vector.o
build/backends/ceed-backend-weak.o
>   build/gallery/ceed-gallery-weak.o
>
-lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
>   warning: initializing 'char *' with an expression of type 'const char
[1]' discards
>   qualifiers [-Wincompatible-pointer-types-discards-qualifier
>    more error .
>   ceed-operator.o
>   _asan.module_ctor in ceed-preconditioning.o
>   ...
>   ld: symbol(s) not found for architecture x86_64
>   clang: error: linker command failed with exit code 1 (use -v to see
invocation)
>   make: *** [Makefile:517: lib/libceed.dylib] Error 1
>
> Does anyone else see this?
>
>   Thanks,
>  Matt
>
> --
> What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
> -- Norbert Wiener
> https://www.cse.buffalo.edu/~knepley/
>


Re: [petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Matthew Knepley
On Tue, Jun 13, 2023 at 9:09 AM Jacob Faibussowitsch 
wrote:

> What is your full linker command? Make sure it also contains
> -fsanitize=address
>

Thanks! I did not know you needed that. It would be nice if the linker
would error on that.

  Matt


> Best regards,
>
> Jacob Faibussowitsch
> (Jacob Fai - booss - oh - vitch)
>
> > On Jun 13, 2023, at 11:05, Matthew Knepley  wrote:
> >
> > For some reason, libCEED seems broken with Address Sanitizer
> >
> >
> *
> >UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for
> details):
> >
> -
> >   Error running make on libceed: Could not execute
> "[['/PETSc3/petsc/apple/bin/make',
> >   '-j13', '-l24.0',
> 'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug', 'V=1',
> >   'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall
> -Wwrite-strings
> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
> -Qunused-arguments
> >   -fvisibility=hidden -fsanitize=address ',
> 'CXX=/PETSc3/petsc/apple/bin/mpicxx',
> >   'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing
> -Wno-unknown-pragmas
> >   -fstack-protector -fno-stack-check -fvisibility=hidden
> -fsanitize=address  -std=gnu++17
> >   -fPIC ', '-B']]":
> >
> >   make: 'lib' with optional backends: /cpu/self/memcheck/serial
> /cpu/self/memcheck/blocked
> >   /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
> >   -Wno-unknown-pragmas -fstack-protector -fno-stack-check
> -Qunused-arguments
> >   -fvisibility=hidden -f
> >    more output .
> >   mcheck/ceed-memcheck-qfunction.o
> build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
> >   build/backends/memcheck/ceed-memcheck-serial.o
> >   build/backends/memcheck/ceed-memcheck-vector.o
> build/backends/ceed-backend-weak.o
> >   build/gallery/ceed-gallery-weak.o
> >
>  
> -lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
> >   warning: initializing 'char *' with an expression of type 'const char
> [1]' discards
> >   qualifiers [-Wincompatible-pointer-types-discards-qualifier
> >    more error .
> >   ceed-operator.o
> >   _asan.module_ctor in ceed-preconditioning.o
> >   ...
> >   ld: symbol(s) not found for architecture x86_64
> >   clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> >   make: *** [Makefile:517: lib/libceed.dylib] Error 1
> >
> > Does anyone else see this?
> >
> >   Thanks,
> >
> >  Matt
> >
> > --
> > What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> > -- Norbert Wiener
> >
> > https://www.cse.buffalo.edu/~knepley/
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Jacob Faibussowitsch
What is your full linker command? Make sure it also contains -fsanitize=address

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Jun 13, 2023, at 11:05, Matthew Knepley  wrote:
> 
> For some reason, libCEED seems broken with Address Sanitizer
> 
> *
>UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for 
> details):
> -
>   Error running make on libceed: Could not execute 
> "[['/PETSc3/petsc/apple/bin/make',
>   '-j13', '-l24.0', 'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug', 
> 'V=1',
>   'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall -Wwrite-strings
>   -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments
>   -fvisibility=hidden -fsanitize=address ', 
> 'CXX=/PETSc3/petsc/apple/bin/mpicxx',
>   'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas
>   -fstack-protector -fno-stack-check -fvisibility=hidden -fsanitize=address  
> -std=gnu++17
>   -fPIC ', '-B']]":
> 
>   make: 'lib' with optional backends: /cpu/self/memcheck/serial 
> /cpu/self/memcheck/blocked
>   /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
>   -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments
>   -fvisibility=hidden -f
>    more output .
>   mcheck/ceed-memcheck-qfunction.o 
> build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
>   build/backends/memcheck/ceed-memcheck-serial.o
>   build/backends/memcheck/ceed-memcheck-vector.o 
> build/backends/ceed-backend-weak.o
>   build/gallery/ceed-gallery-weak.o
>   
> -lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
>   warning: initializing 'char *' with an expression of type 'const char [1]' 
> discards
>   qualifiers [-Wincompatible-pointer-types-discards-qualifier
>    more error .
>   ceed-operator.o
>   _asan.module_ctor in ceed-preconditioning.o
>   ...
>   ld: symbol(s) not found for architecture x86_64
>   clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
>   make: *** [Makefile:517: lib/libceed.dylib] Error 1
> 
> Does anyone else see this?
> 
>   Thanks,
> 
>  Matt
> 
> -- 
> What most experimenters take for granted before they begin their experiments 
> is infinitely more interesting than any results to which their experiments 
> lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/



[petsc-dev] Building libCEED with -fsanitize=address

2023-06-13 Thread Matthew Knepley
For some reason, libCEED seems broken with Address Sanitizer

*
   UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for
details):
-
  Error running make on libceed: Could not execute
"[['/PETSc3/petsc/apple/bin/make',
  '-j13', '-l24.0', 'prefix=/PETSc3/petsc/petsc-pylith/arch-pylith-debug',
'V=1',
  'CC=/PETSc3/petsc/apple/bin/mpicc', 'CFLAGS= -fPIC -Wall -Wwrite-strings
  -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments
  -fvisibility=hidden -fsanitize=address ',
'CXX=/PETSc3/petsc/apple/bin/mpicxx',
  'CXXFLAGS= -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas
  -fstack-protector -fno-stack-check -fvisibility=hidden -fsanitize=address
 -std=gnu++17
  -fPIC ', '-B']]":

  make: 'lib' with optional backends: /cpu/self/memcheck/serial
/cpu/self/memcheck/blocked
  /PETSc3/petsc/apple/bin/mpicc -I./include -fPIC -Wall -Wwrite-strings
  -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments
  -fvisibility=hidden -f
   more output .
  mcheck/ceed-memcheck-qfunction.o
build/backends/memcheck/ceed-memcheck-qfunctioncontext.o
  build/backends/memcheck/ceed-memcheck-serial.o
  build/backends/memcheck/ceed-memcheck-vector.o
build/backends/ceed-backend-weak.o
  build/gallery/ceed-gallery-weak.o

-lm/PETSc3/petsc/petsc-pylith/arch-pylith-debug/externalpackages/git.libceed/interface/ceed-preconditioning.c:44:9:
  warning: initializing 'char *' with an expression of type 'const char
[1]' discards
  qualifiers [-Wincompatible-pointer-types-discards-qualifier
   more error .
  ceed-operator.o
  _asan.module_ctor in ceed-preconditioning.o
  ...
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see
invocation)
  make: *** [Makefile:517: lib/libceed.dylib] Error 1

Does anyone else see this?

  Thanks,

 Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/