I made the unfortunate decision to uninstall what I had working for petsc/gcc/macports/brew/ etc., because Valgrind wasn't working for me. I got Valgrind to work for me, reinstalled Petsc and slepc etc., but then after I successfully create my executable ./hello, I ran into this problem:
==25882== Process terminating with default action of signal 11 (SIGSEGV) ==25882== Access not within mapped region at address 0x18 ==25882== at 0x103E31808: _pthread_wqthread_setup (in /usr/lib/system/libsystem_pthread.dylib) ==25882== by 0x103E31497: _pthread_wqthread (in /usr/lib/system/libsystem_pthread.dylib) ==25882== by 0x103E313FC: start_wqthread (in /usr/lib/system/libsystem_pthread.dylib) ==25882== If you believe this happened as a result of a stack ==25882== overflow in your program's main thread (unlikely but ==25882== possible), you can try to increase the size of the ==25882== main thread stack using the --main-stacksize= flag. ==25882== The main thread stack size used in this run was 8388608. ==25882== LEAK SUMMARY: ==25882== definitely lost: 512 bytes in 1 blocks ==25882== indirectly lost: 0 bytes in 0 blocks ==25882== possibly lost: 128 bytes in 1 blocks ==25882== still reachable: 212,531 bytes in 1,554 blocks ==25882== suppressed: 747,772 bytes in 740 blocks ==25882== Reachable blocks (those to which a pointer was found) are not shown. ==25882== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==25882== ==25882== For lists of detected and suppressed errors, rerun with: -s ==25882== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 2238 from 184) Segmentation fault: 11
My program is a simple program:
int main(int argc, char *argv[]){
int i;
PetscInitialize(&argc, &argv, NULL, NULL);
printf("HELLO\n");
PetscFinalize();
return 0; }
When I put through my program through Valgrind, I get a segmentation fault, but when I run it without Valgrind, I do not get any issues or seg faults. Valgrind issue? I get the segfault 11 when I add
PetscInitialize(&argc, &argv, NULL, NULL);
PetscFinalize();
How shall I fix this?