[petsc-users] Bus Error

Jed Brown jed at jedbrown.org
Mon Aug 24 15:29:11 CDT 2020


Barry Smith <bsmith at petsc.dev> writes:

>> On Aug 24, 2020, at 2:34 PM, Jed Brown <jed at jedbrown.org> wrote:
>> 
>> I'm thinking of something such as writing floating point data into the return address, which would be unaligned/garbage.
>
>   Ok, my patch will detect this. This is what I was talking about, messing up the BLAS arguments which are the addresses of arrays.
>
>   Valgrind is by far the preferred approach.

FWIW, Valgrind is very limited at detecting stack corruption, and PetscMallocVerify known nothing about the stack.  That said, it's unusual to place large arrays on the stack.

>   Barry
>
>   Another feature we could add to the malloc checking is when a SEGV or BUS error is encountered and we catch it we should run the PetscMallocVerify() and check our memory for corruption reporting any we find.


More information about the petsc-users mailing list