Hello, I call TaosSolve() in my code. The solution vector is a nested and Jacobian matrix is nested too. It shows me the error:
[0]PETSC ERROR: ------------------------------------------------------------------------ [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 errors [1]PETSC 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] VecRestoreArray_Nest line 731 /home/khp/bin/petsc-3.5.1/src/vec/vec/impls/nest/vecnest.c [0]PETSC ERROR: [0] VecRestoreArray line 1656 /home/khp/bin/petsc-3.5.1/src/vec/vec/interface/rvector.c [0]PETSC ERROR: [0] VecMedian line 806 /home/khp/bin/petsc-3.5.1/src/vec/vec/utils/projection.c [0]PETSC ERROR: [0] TaoSolve_SSILS line 52 /home/khp/bin/petsc-3.5.1/src/tao/complementarity/impls/ssls/ssils.c [0]PETSC ERROR: [0] TaoSolve line 171 /home/khp/bin/petsc-3.5.1/src/tao/interface/taosolver.c I debugged with valgrind and received the following message: ==19424== Invalid read of size 8 ==19424== at 0x54089E4: VecRestoreArray_Nest (vecnest.c:746) ==19424== by 0x53F5F6F: VecRestoreArray (rvector.c:1666) ==19424== by 0x54BE874: VecMedian (projection.c:855) ==19424== by 0x6247B74: TaoSolve_SSILS (ssils.c:59) ==19424== by 0x620739E: TaoSolve (taosolver.c:188) ==19424== by 0x40491C: main (main.cpp:265) ==19424== Address 0x0 is not stack'd, malloc'd or (recently) free'd It looks like the bug relates to the nested vector. Could you please give me a hint to locate the bug? Thanks. Khai
