Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我的代码中有一个函数时,我会segmentation fault (core dumped)在关闭我的键盘记录器时得到一个。atexit()这是令人困惑的,因为该atexit()函数只应在有人试图退出程序时调用(而不仅仅是在给出关闭键盘记录器的命令时)。
segmentation fault (core dumped)
atexit()
如果我取出atexit(final)主线,一切正常。但是我需要atexit()在我的代码中使用函数来处理当人退出 shell 时会发生什么。
atexit(final)
提前致谢。