[petsc-dev] [petsc-users] glibc detected

Barry Smith bsmith at mcs.anl.gov
Sat Apr 17 11:30:07 CDT 2010


    Jed and anyone,

      Is there any way for a running program to determine it is  
running under valgrind?

      If so, we could have PETSc NOT turn on its malloc debugging  
stuff when running under valgrind. Then we wouldn't need this -malloc  
off stuff to remember

    Barry

On Apr 17, 2010, at 11:24 AM, Jed Brown wrote:

> On Sat, 17 Apr 2010 11:07:55 -0400, "(Rebecca) Xuefei YUAN" <xy2102 at columbia.edu 
> > wrote:
>> Dear Jed,
>>
>> What did I do wrong on this? Nothing comes out from -malloc 0:
>
>  $ valgrind ./twgcqt2unffnictvscj.exe -options_file option_all - 
> malloc 0
>
> Run it this way.  The "-malloc 0" option turns off PETSc's sentinels
> (that debug PetscMalloc uses to detect memory corruption) so that
> valgrind can do it's job better.  Note that you can have valgrind  
> attach
> a debugger at the error points with
>
>  $ valgrind --db-attach=yes ./twgcqt2unffnictvscj.exe -options_file  
> option_all -malloc 0
>
> Jed




More information about the petsc-dev mailing list