-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
[Private Code](https://github.com/cs-learning-every-day/cmu15-445-fa22/blob/main/src/include/primer/p0_trie.h) | ||
|
||
[Description](https://15445.courses.cs.cmu.edu/fall2022/project0/) | ||
|
||
```c++ | ||
cur_parent->InsertChildNode(new_node->GetKeyChar(), std::move(new_node)); | ||
``` | ||
使用了move后,不能再对new_node任何操作了,未知的。 | ||
``` | ||
$ make format | ||
$ make check-lint | ||
$ make check-clang-tidy-p0 | ||
``` | ||
``` | ||
valgrind \ | ||
--error-exitcode=1 \ | ||
--leak-check=full \ | ||
./test/starter_trie_test | ||
``` | ||
-DCMAKE_BUILD_TYPE=Debug | ||
``` | ||
#include "common/logger.h" | ||
LOG_INFO("# Pages: %d", num_pages); | ||
LOG_DEBUG("Fetching page %d", page_id); | ||
``` | ||
![image](https://github.com/XmchxUp/picx-images-hosting/raw/master/20240529/image.5tqv0qrr1m.webp) | ||
小问题,就是多次运行时出现了 `AddressSanitizer:DEADLYSIGNAL` | ||
GPT回答 | ||
``` | ||
当程序在执行两三次后出现"AddressSanitizer:DEADLYSIGNAL"错误时,这可能是由于程序中存在一些难以察觉的内存访问问题,可能是由于随机性导致的。这种问题可能会在某些情况下触发,但在其他情况下却不会。这种不稳定性可能与内存布局的随机性有关,即地址空间布局随机化(ASLR)。 | ||
|
||
ASLR是一种安全功能,用于随机化程序的内存布局,以增加系统的安全性。然而,有时候ASLR可能会导致一些问题,特别是在使用内存检查工具(如AddressSanitizer)时。禁用ASLR可能会暂时解决这个问题,但不建议在生产环境中这样做,因为ASLR是一项重要的安全功能。 | ||
|
||
另一种解决方法是直接调用可执行文件的运行时链接器,而不是让内核在程序启动时加载链接器。这种方法可以绕过内核加载程序时的ASLR,从而减少出现"AddressSanitizer:DEADLYSIGNAL"错误的可能性。这种做法可能会提供更稳定的执行环境,尤其是在涉及ASLR的情况下。 | ||
|
||
通过以上方法,你可以尝试解决程序在执行两三次后出现"AddressSanitizer:DEADLYSIGNAL"错误的问题,提高程序的稳定性和可靠性。 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters