gpt4 book ai didi

linux - Petsc 不显示代码中发生错误的位置

转载 作者:太空狗 更新时间:2023-10-29 11:39:47 26 4
gpt4 key购买 nike

在没有 Petsc 的情况下,我可以看到哪些文件、哪些函数以及哪些行发生错误并从中传播。使用 Petsc,我总是收到相同的错误消息。

Petsc 中是否有任何我遗漏的标志?

谢谢。


[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/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[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: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Signal received!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 8, Thu Mar 17 13:37:48 CDT 2011
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: ./solver on a linux named ion by khoa Sun Apr 10 23:29:33 2011
[0]PETSC ERROR: Libraries linked from /h1/khoa/libs/petsc-3.1/linux/lib
[0]PETSC ERROR: Configure run at Sun Apr 10 17:52:52 2011
[0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=c++ --with-mpi=1 --with-mpi-dir=/usr/bin
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file

最佳答案

您的代码可能通过非法访问内存生成了 SEGV。正如错误消息所建议的那样,您应该使用 valgrind 或 gdb 运行,这样您就可以看到堆栈。

关于linux - Petsc 不显示代码中发生错误的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5616784/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com