<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div><a href="https://gitlab.com/petsc/petsc/-/merge_requests/6075">https://gitlab.com/petsc/petsc/-/merge_requests/6075</a> should fix the possible recursive error condition Matt pointed out<div><br><div><br><blockquote type="cite"><div>On Feb 9, 2023, at 6:24 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr">On Thu, Feb 9, 2023 at 6:05 PM Sajid Ali Syed via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg3435105345729102030">




<div dir="ltr">
<div><p style="margin:0px 0px 1.2em">I added “-malloc_debug” in a .petscrc file and ran it again. The backtrace from lldb is in the attached file. The crash now seems to be at:</p>
<pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">Process 32660 stopped* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f603fb8)
    frame #0: 0x0000000112ecc8f8 libpetsc.3.018.dylib`PetscFPrintf(comm=0, fd=0x0000000000000000, format=0x0000000000000000) at mprint.c:601
   598               `PetscViewerASCIISynchronizedPrintf()`, `PetscSynchronizedFlush()`
   599      @*/
   600      PetscErrorCode PetscFPrintf(MPI_Comm comm, FILE *fd, const char format[], ...)
-> 601      {
   602       PetscMPIInt rank;
   603      
   604       PetscFunctionBegin;
(lldb) frame info
frame #0: 0x0000000112ecc8f8 libpetsc.3.018.dylib`PetscFPrintf(comm=0, fd=0x0000000000000000, format=0x0000000000000000) at mprint.c:601
(lldb)
</code></pre><p style="margin:0px 0px 1.2em">The trace seems to indicate some sort of infinite loop causing an overflow.<br></p></div></div></div></blockquote><div><br></div><div>Yes, I have also seen this. What happens is that we have a memory error. The error is reported inside PetscMallocValidate()</div><div>using PetscErrorPrintf, which eventually calls PetscCallMPI, which calls PetscMallocValidate again, which fails. We need to</div><div>remove all error checking from the prints inside Validate.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg3435105345729102030"><div dir="ltr"><div><p style="margin:0px 0px 1.2em">
PS: I'm using a arm64 mac, so I don't have access to valgrind. <br>
<br>
Thank You,<br>
Sajid Ali (he/him) | Research Associate<br>
Scientific Computing Division<br>
Fermi National Accelerator Laboratory<a href="http://s-sajid-ali.github.io/" target="_blank"><br>
s-sajid-ali.github.io</a></p>
<div title="MDH:PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IENhbGlicmksIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMt
c2VyaWY7IGZvbnQtc2l6ZTogMTJwdDsgY29sb3I6IHJnYigwLCAwLCAwKTsgYmFja2dyb3VuZC1j
b2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpOyIgY2xhc3M9ImVsZW1lbnRUb1Byb29mIENvbnRlbnRQ
YXN0ZWQwIj5JIGFkZGVkICItbWFsbG9jX2RlYnVnIiBpbiBhIC5wZXRzY3JjIGZpbGUgYW5kIHJh
biBpdCBhZ2Fpbi4gVGhlIGJhY2t0cmFjZSBmcm9tIGxsZGIgaXMgaW4gdGhlIGF0dGFjaGVkIGZp
bGUuIFRoZSBjcmFzaCBub3cgc2VlbXMgdG8gYmUgYXQ6PGJyPjwvZGl2PjxkaXYgc3R5bGU9ImZv
bnQtZmFtaWx5OiBDYWxpYnJpLCBBcmlhbCwg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ZToxMi44cHgiPlNjaWVudGlm
aWMgQ29tcHV0aW5nIERpdmlzaW9uPGJyPgo8L2Rpdj4KPGRpdiBzdHlsZT0iZm9udC1zaXplOjEy
LjhweCI+RmVybWkgTmF0aW9uYWwgQWNjZWxlcmF0b3IgTGFib3JhdG9yeTxicj4KPC9kaXY+Cjxz
cGFuIHN0eWxlPSJmb250LXNpemU6MTIuOHB4Ij48YSBocmVmPSJodHRwOi8vcy1zYWppZC1hbGku
Z2l0aHViLmlvIiB0YXJnZXQ9Il9ibGFuayI+cy1zYWppZC1hbGkuZ2l0aHViLmlvPC9hPjwvc3Bh
bj48L2Rpdj4KPC9kaXY+CjwvZGl2Pgo8L2Rpdj4KPC9kaXY+CjwvZGl2Pjxicj48ZGl2IHN0eWxl
PSJsaW5lLWJyZWFrOmFmdGVyLXdoaXRlLXNwYWNlIj48ZGl2Pjxicj48L2Rpdj48L2Rpdj48L2Rp
dj48L2Rpdj48L2Rpdj48L2Rpdj4=" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px">
</div>
</div>
</div>

</div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></body></html>