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 <[email protected]> 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 <[email protected] <mailto:[email protected]>> > Sent: Friday, April 9, 2021 10:14 AM > To: Stefano Zampini <[email protected] > <mailto:[email protected]>>; dazza simplythebest > <[email protected] <mailto:[email protected]>> > Cc: [email protected] <mailto:[email protected]> > <[email protected] <mailto:[email protected]>> > 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 <[email protected] >>> <mailto:[email protected]>> 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==
