[petsc-users] __FUNCT__ does not agree with __FUNCTION__

Barry Smith bsmith at mcs.anl.gov
Sun Jul 20 11:23:46 CDT 2014


  You need to run in the debugger to find out exactly where and why it is crashing.

   Barry

On Jul 20, 2014, at 9:00 AM, Dominik Szczerba <dominik at itis.ethz.ch> wrote:

> __FUNCT__="ScalarSolver::SetupStiffnessMatrix"
> 
> does not compile. I assume you meant:
> 
> #undef __FUNCT__
> #define __FUNCT__ "ScalarSolver::SetupCoefficientMatrix"
> 
> but now I do not get exact lines leading to a crash. Also skipping __FUNCT__ completely does not help. It used to work before, I can not figure out what has changed. Using MSVC 2010.
> Please advise...
> 
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
> [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption error
> [0]PETSC ERROR: likely location of problem given in stack below
> [0]PETSC ERROR: ---------------------  Stack Frames ------------------------------------
> [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
> [0]PETSC ERROR:       INSTEAD the line number of the start of the function
> [0]PETSC ERROR:       is given.
> [0]PETSC ERROR: [0] ScalarSolver::SetupCoefficientMatrix line 1216 "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolver.cpp
> [0]PETSC ERROR: [0] ScalarSolver::Initialize line 181 "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolver.cpp
> [0]PETSC ERROR: [0] ScalarSolverXMLDriver::Initialize line 74 "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolverXMLDriver.cpp
> [0]PETSC ERROR: [0] ScalarSolverXMLDriver::ScalarSolverXMLDriver line 53 "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolverXMLDriver.cpp
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> 
> 
> 2014-07-09 5:21 GMT+02:00 Jed Brown <jed at jedbrown.org>:
> Satish Balay <balay at mcs.anl.gov> writes:
> 
> > One can skip __FUNCT__ alltogether in user sourcefiles [assuming you
> > have a c99 compiler] - as  __func__ would automatically be used
> > by the petsc macros [in includes]
> 
> You can literally skip it everywhere, C99 or not, and PETSc will not
> issue these warnings.  If __func__ is not available, traces will say
> "User defined function".
> 



More information about the petsc-users mailing list