[petsc-users] Newbie question: Strange failure when calling PetscIntView from slepc application

Barry Smith bsmith at petsc.dev
Sat Apr 10 18:51:11 CDT 2021


  I have submitted a MR that adds a Fortran interface for these functions so it will automatically error  at compile time if you do not include the appropriate arguments.

   Barry


> On Apr 9, 2021, at 5:35 AM, dazza simplythebest <sayosale at hotmail.com> wrote:
> 
> Dear Pierre and Stefano,
>                                           Yes - that is it!  I had just stumbled onto that 
> point as your email arrived thanks to Stefano's guidance, which suggested the problem was that the routine 
> was receiving an integer when it was expecting something else... then a lightbulb 
>  finally switched on and I finally remembered that I needed to add the error variable
>  as a final argument. I thought it was something silly on my part, and I wasn't mistaken 
> there at least!
>       Many thanks to both of you,
>                 best wishes,
>                              Dan.
> 
> From: Pierre Seize <pierre.seize at onera.fr <mailto:pierre.seize at onera.fr>>
> Sent: Friday, April 9, 2021 10:14 AM
> To: Stefano Zampini <stefano.zampini at gmail.com <mailto:stefano.zampini at gmail.com>>; dazza simplythebest <sayosale at hotmail.com <mailto:sayosale at hotmail.com>>
> Cc: petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov> <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>>
> Subject: Re: [petsc-users] Newbie question: Strange failure when calling PetscIntView from slepc application
>  
> Hello, I think you forgot to pass ierr as the last argument of PetscIntView.
> Pierre
> 
> On 09/04/21 11:52, Stefano Zampini wrote:
>> ==841883== Invalid write of size 4
>> ==841883==    at 0x503E784: petscintview_ (/data/work/slepc/PETSC/petsc-3.14.5/src/sys/error/ftn-custom/zerrf.c:109)
>> ==841883==    by 0x40262C: all_stab_routines_mp_write_rows_to_petsc_matrix_ (/data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/tryme.F:17)
>> ==841883==    by 0x402465: MAIN__ (/data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/tryme.F:40)
>> ==841883==    by 0x402221: main (in /data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/trashy.exe)
>> ==841883==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
>> ==841883== 
>> 
>> This exactly points to the error and suggests you to take a look at /data/work/slepc/PETSC/petsc-3.14.5/src/sys/error/ftn-custom/zerrf.c, line 109
>> You are trying to write 4 bytes (most probably an int) where is not allowed.
>> 
>>> On Apr 9, 2021, at 12:32 PM, dazza simplythebest <sayosale at hotmail.com <mailto:sayosale at hotmail.com>> wrote:
>>> 
>>> ==841883== Invalid write of size 4
>>> ==841883==    at 0x503E784: petscintview_ (/data/work/slepc/PETSC/petsc-3.14.5/src/sys/error/ftn-custom/zerrf.c:109)
>>> ==841883==    by 0x40262C: all_stab_routines_mp_write_rows_to_petsc_matrix_ (/data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/tryme.F:17)
>>> ==841883==    by 0x402465: MAIN__ (/data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/tryme.F:40)
>>> ==841883==    by 0x402221: main (in /data/work/rotplane/omega_to_zero/stability/test/tmp10/tmp3/trashy.exe)
>>> ==841883==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
>>> ==841883==

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210410/02cb879f/attachment.html>


More information about the petsc-users mailing list