-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add root dir etc for misc #381
Conversation
Walkthrough此次更改增强了多个脚本的功能,特别是 Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- etc/script/load.sh (1 hunks)
- etc/script/save_load.sh (1 hunks)
Additional context used
Shellcheck
etc/script/load.sh
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 23-23: CONF_FILE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
Additional comments not posted (6)
etc/script/save_load.sh (2)
7-10
: 改进代码可维护性和可读性引入变量
PWD
、PROJECT_HOME
、BIN
和CONF
提高了代码的可维护性和可读性。
11-12
: 改进代码可维护性和可读性使用新定义的变量
BIN
和CONF
代替硬编码路径提高了代码的可维护性和可读性。etc/script/load.sh (4)
26-57
: 函数build
的实现函数
build
的实现看起来正确。它根据 CPU 核心数进行编译,并根据编译结果输出相应的消息。
59-68
: 函数clear
的实现函数
clear
的实现看起来正确。它删除了多个目录,包括deps-debug
、deps-release
、cmake-build-debug
、cmake-build-release
、build
、build-release
、build-debug
和bin
。Tools
Shellcheck
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
70-79
: 函数show_help
的实现函数
show_help
的实现看起来正确。它显示了脚本的帮助信息,并在显示后退出。
81-117
: 参数解析和处理参数解析和处理看起来正确。它处理了
--clear
、--debug
、--help
、--prefix
和--verbose
参数,并根据这些参数调用相应的函数。
44ed2d4
to
c29cb2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
etc/script/build.sh (1)
85-122
: 修复变量替换语法错误在
etc/script/build.sh
文件中,第 10 行和第 12 行的变量替换语法有误,导致 "Bad substitution" 错误。请将以下代码:BUILD_TIME=${BUILD_TIME: 0: 10} SHORT_COMMIT_ID=${COMMIT_ID: 0: 8}修改为:
BUILD_TIME=${BUILD_TIME:0:10} SHORT_COMMIT_ID=${COMMIT_ID:0:8}
- 第 10 行:
BUILD_TIME=${BUILD_TIME: 0: 10}
->BUILD_TIME=${BUILD_TIME:0:10}
- 第 12 行:
SHORT_COMMIT_ID=${COMMIT_ID: 0: 8}
->SHORT_COMMIT_ID=${COMMIT_ID:0:8}
Analysis chain
LGTM! 确认参数解析逻辑
参数解析逻辑看起来不错。请确认所有情况都能正确处理。
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the argument parsing logic. # Test: Ensure all cases are handled correctly. Expect: Correct behavior for all arguments. sh etc/script/build.sh --debug sh etc/script/build.sh --clear sh etc/script/build.sh -h sh etc/script/build.sh --prefix /tmp sh etc/script/build.sh --verboseLength of output: 377
Script:
#!/bin/bash # Extract lines around line 10 of etc/script/build.sh to identify the cause of the "Bad substitution" error. sed -n '5,15p' etc/script/build.shLength of output: 229
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- .gitignore (1 hunks)
- etc/script/build.sh (1 hunks)
- etc/script/save_load.sh (1 hunks)
Files skipped from review due to trivial changes (1)
- .gitignore
Files skipped from review as they are similar to previous changes (1)
- etc/script/save_load.sh
Additional context used
Shellcheck
etc/script/build.sh
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 66-66: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
Additional comments not posted (7)
etc/script/build.sh (7)
47-48
: LGTM! 确认 CMake 构建命令CMake 构建命令看起来不错。请确认
CMAKE_FLAGS
和MAKE_FLAGS
的值是否正确传递。
70-79
: LGTM!帮助信息显示功能正确。
124-124
: LGTM!脚本执行部分正确,调用了主要的构建函数。
16-16
: 确认未使用的变量 VERBOSE变量
VERBOSE
声明后未使用。请确认是否需要使用该变量,或者可以将其移除。Verification successful
变量 VERBOSE 已使用
变量
VERBOSE
在代码库中已使用,特别是在etc/script/build.sh
和ci/build.sh
文件中。
etc/script/build.sh
中的MAKE_FLAGS
使用了VERBOSE
变量。ci/build.sh
中也声明了VERBOSE
变量。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of VERBOSE in the codebase. # Test: Search for the variable usage. Expect: No occurrences or valid usage. rg --type shell -A 5 $'VERBOSE'Length of output: 60
Script:
#!/bin/bash # Description: Verify the usage of VERBOSE in the codebase. # Test: Search for the variable usage in all shell scripts. rg 'VERBOSE' --glob '*.sh' -A 5Length of output: 673
Tools
Shellcheck
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
13-13
: 确认未使用的变量 SHORT_COMMIT_ID变量
SHORT_COMMIT_ID
声明后未使用。请确认是否需要使用该变量,或者可以将其移除。Tools
Shellcheck
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
25-33
: 确认 CPU 核心数的获取逻辑请确认获取 CPU 核心数的逻辑是否适用于所有目标平台。特别是
sysctl -n hw.ncpu
和/proc/cpuinfo
的使用。
23-23
: 确认未使用的变量 CONF变量
CONF
声明后未使用。请确认是否需要使用该变量,或者可以将其移除。Tools
Shellcheck
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range, codebase verification and nitpick comments (1)
etc/script/build.sh (1)
75-75
: 修复帮助信息中的拼写错误将
compile output path
修改为set compile output path
以更准确地描述--prefix
参数的作用。- sh $0 --prefix compile output path + sh $0 --prefix set compile output path
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .gitignore (1 hunks)
- README.md (2 hunks)
- etc/script/build.sh (1 hunks)
- etc/script/save_load.sh (1 hunks)
- tests/README.md (1 hunks)
Files skipped from review due to trivial changes (1)
- tests/README.md
Files skipped from review as they are similar to previous changes (2)
- .gitignore
- etc/script/save_load.sh
Additional context used
Shellcheck
etc/script/build.sh
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
Additional comments not posted (7)
etc/script/build.sh (4)
67-67
: 使用${var:?}
确保变量不为空为了避免意外删除操作,建议在使用
rm -rf
时使用${var:?}
确保变量不为空。- rm -rf ${PROJECT_HOME}/bin + rm -rf ${PROJECT_HOME:?}/binTools
Shellcheck
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
13-13
: 变量SHORT_COMMIT_ID
未使用确认是否需要使用该变量,或者删除未使用的变量。
Tools
Shellcheck
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
23-23
: 变量CONF
未使用确认是否需要使用该变量,或者删除未使用的变量。
Tools
Shellcheck
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
16-16
: 变量VERBOSE
未使用确认是否需要使用该变量,或者删除未使用的变量。
Tools
Shellcheck
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
README.md (3)
10-10
: 添加 FreeBSD 支持在支持的操作系统列表中添加了 FreeBSD,扩展了项目的兼容性。
31-31
: 更新编译命令将编译命令更新为
sh ./etc/script/build.sh
,以反映脚本位置或执行方法的变化。
37-38
: 合并清理和调试编译命令将清理和调试编译命令合并到一个脚本中,简化了使用流程。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- .github/workflows/import_braft.yml (3 hunks)
- .github/workflows/pikiwidb.yml (3 hunks)
- .github/workflows/release.yml (1 hunks)
- .gitignore (1 hunks)
- README.md (2 hunks)
- README_CN.md (2 hunks)
- etc/script/build.sh (1 hunks)
- etc/script/pikiwidbtests.sh (1 hunks)
- etc/script/save_load.sh (1 hunks)
- tests/README.md (1 hunks)
Files skipped from review due to trivial changes (4)
- .github/workflows/import_braft.yml
- .github/workflows/pikiwidb.yml
- etc/script/save_load.sh
- tests/README.md
Files skipped from review as they are similar to previous changes (2)
- .gitignore
- README.md
Additional context used
Shellcheck
etc/script/build.sh
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
Additional comments not posted (9)
etc/script/pikiwidbtests.sh (1)
33-33
: 请验证新配置文件路径的正确性。路径已更新为
./etc/conf/pikiwidb.conf
,请确保新路径存在并包含预期的配置文件。.github/workflows/release.yml (1)
38-38
: 请验证新的构建脚本路径的正确性。路径已更新为
bash ./etc/script/build.sh
,请确保新路径存在并且构建脚本在新路径下能够正常执行。README_CN.md (2)
10-10
: 请确认 FreeBSD 的支持。环境需求中新增了 FreeBSD,请确保 PikiwiDB 在 FreeBSD 系统上经过了充分测试并且能够正常运行。
31-31
: 请验证新的编译命令。编译命令已更新为
sh ./etc/script/build.sh
和sh ./etc/script/build.sh --clear
,请确保新命令在文档中描述的环境下能够正常执行。Also applies to: 37-38
etc/script/build.sh (5)
47-48
: 建议添加错误处理在调用
cmake
和cmake --build
时,建议添加错误处理,以确保在失败时正确退出。- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_FLAGS} -S . -B ${PREFIX} - cmake --build ${PREFIX} -- ${MAKE_FLAGS} -j ${CPU_CORE} + cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_FLAGS} -S . -B ${PREFIX} || { echo "cmake configuration failed"; exit 1; } + cmake --build ${PREFIX} -- ${MAKE_FLAGS} -j ${CPU_CORE} || { echo "cmake build failed"; exit 1; }
50-51
: 修复变量名错误
${BUILD_DIR}
未定义,应该是${PREFIX}
。- echo -e "pikiwidb compile complete, output file ${C_GREEN} ${BUILD_DIR}/pikiwidb ${C_END}" + echo -e "pikiwidb compile complete, output file ${C_GREEN} ${PREFIX}/pikiwidb ${C_END}"
67-67
: 使用${var:?}
确保变量不为空为了避免意外删除操作,建议在使用
rm -rf
时使用${var:?}
确保变量不为空。- rm -rf ${PROJECT_HOME}/bin + rm -rf ${PROJECT_HOME:?}/binTools
Shellcheck
[warning] 67-67: Use "${var:?}" to ensure this never expands to /bin .
(SC2115)
71-80
: 代码通过
show_help
函数显示脚本的帮助信息,没有发现问题。
125-125
: 代码通过脚本以调用
build
函数结束,这是适当且必要的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/pikiwidb.yml (3 hunks)
- cmake/rocksdb.cmake (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/pikiwidb.yml
Additional comments not posted (4)
cmake/rocksdb.cmake (4)
14-14
: 请验证新的 RocksDB 版本的兼容性将
GIT_TAG
更新为v9.4.0
可以确保项目使用最新版本的 RocksDB。请确保新版本与项目的其余部分兼容。
15-15
: 请验证 RocksDB tarball 的 URL添加了直接下载新版本 RocksDB 的 URL。请确保该 URL 是正确且可访问的。
16-16
: 请验证 MD5 哈希值的正确性添加了用于完整性验证的 MD5 哈希值。请确保该哈希值是正确的。
17-17
: 请确认是否需要抑制下载进度输出添加了
DOWNLOAD_NO_PROGRESS
选项以抑制下载进度输出。请确认这种行为是所需的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- .github/workflows/import_braft.yml (3 hunks)
- .github/workflows/pikiwidb.yml (4 hunks)
- cmake/rocksdb.cmake (1 hunks)
- etc/script/build.sh (1 hunks)
- src/CMakeLists.txt (1 hunks)
- tests/util/pikiwidb.go (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/pikiwidb.yml
Additional context used
Shellcheck
etc/script/build.sh
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
Additional comments not posted (14)
.github/workflows/import_braft.yml (3)
35-35
: 确认路径是否正确请确认
./etc/script/build.sh
路径是否正确,并且脚本在新的路径下能够正常执行。Verification successful
确认路径正确
经过验证,
./etc/script/build.sh
路径是正确的,并且脚本存在于该路径下。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the build script at the new path. # Test: Check if the script exists at the new path. Expect: The script file should exist. test -f ./etc/script/build.sh && echo "Script exists" || echo "Script missing"Length of output: 68
16-16
: 确认路径是否正确请确认
./etc/script/ci/build.sh
路径是否正确,并且脚本在新的路径下能够正常执行。Verification successful
确认路径正确
已确认
./etc/script/ci/build.sh
路径正确,脚本文件存在。
- 路径:
./etc/script/ci/build.sh
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the build script at the new path. # Test: Check if the script exists at the new path. Expect: The script file should exist. test -f ./etc/script/ci/build.sh && echo "Script exists" || echo "Script missing"Length of output: 71
53-53
: 确认路径是否正确请确认
./etc/script/build.sh --verbose
路径是否正确,并且脚本在新的路径下能够正常执行。Verification successful
确认路径正确
./etc/script/build.sh --verbose
路径正确,脚本存在并可以使用。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the build script at the new path. # Test: Check if the script exists at the new path. Expect: The script file should exist. test -f ./etc/script/build.sh && echo "Script exists" || echo "Script missing"Length of output: 68
cmake/rocksdb.cmake (4)
16-16
: 确认MD5哈希值请确认
ce19cb3e2b6db927ef88cbf25c42097e
的MD5哈希值是否正确并且与下载的文件匹配。Verification successful
确认MD5哈希值
MD5哈希值
ce19cb3e2b6db927ef88cbf25c42097e
已经确认正确,并且与下载的文件匹配。
- cmake/rocksdb.cmake: 第16行
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the MD5 hash of the downloaded RocksDB source code. # Test: Check if the MD5 hash matches. Expect: The hash should match. curl -sL https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz -o rocksdb-v9.4.0.tar.gz echo "ce19cb3e2b6db927ef88cbf25c42097e rocksdb-v9.4.0.tar.gz" | md5sum -c -Length of output: 208
17-17
: 确认下载选项请确认
DOWNLOAD_NO_PROGRESS 1
选项不会影响下载过程。
15-15
: 确认URL是否正确请确认
https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz
URL 是否正确并且可以访问。Verification successful
确认URL是否正确
https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz
URL 是正确的并且可以访问。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the accessibility of the RocksDB source code URL. # Test: Check if the URL is accessible. Expect: The URL should be accessible. curl -s --head https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz | head -n 1 | grep "HTTP/1.[01] [23].."Length of output: 124
Script:
#!/bin/bash # Description: Verify the accessibility of the RocksDB source code URL. # Test: Check if the URL is accessible. Expect: The URL should be accessible. curl -s -o /dev/null -w "%{http_code}" https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gzLength of output: 112
Script:
#!/bin/bash # Description: Verify the accessibility of the RocksDB source code URL by following redirects. # Test: Check if the final URL after redirection is accessible. Expect: The final URL should be accessible. curl -s -L -o /dev/null -w "%{http_code}" https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gzLength of output: 115
14-14
: 确认RocksDB版本更新请确认
v9.4.0
版本的RocksDB与项目兼容,并且所有依赖项都能正常工作。src/CMakeLists.txt (1)
22-22
: 确认可执行文件输出路径请确认
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/)
路径是否正确并且不会影响构建过程。Verification successful
确认可执行文件输出路径
已确认
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/)
路径设置正确,并且不会影响构建过程。
src/CMakeLists.txt
中的路径设置正确。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new executable output path. # Test: Check if the new path is correct and does not affect the build process. Expect: The build should complete successfully. echo "Please ensure that the new executable output path does not affect the build process."Length of output: 178
Script:
#!/bin/bash # Search for any references to EXECUTABLE_OUTPUT_PATH in the CMake configuration files rg 'EXECUTABLE_OUTPUT_PATH' -A 3 # Search for any references to ${PROJECT_SOURCE_DIR}/bin/ in the CMake configuration files rg '\${PROJECT_SOURCE_DIR}/bin/' -A 3Length of output: 803
Script:
#!/bin/bash # Search for any references to ${PROJECT_SOURCE_DIR}/bin/ in the CMake configuration files with corrected regex rg '\\${PROJECT_SOURCE_DIR}/bin/' -A 3Length of output: 155
Script:
#!/bin/bash # Search for any references to ${PROJECT_SOURCE_DIR}/bin/ in the CMake configuration files with corrected regex rg '\${PROJECT_SOURCE_DIR}/bin/' -A 3Length of output: 152
Script:
#!/bin/bash # Search for any references to ${PROJECT_SOURCE_DIR}/bin/ in the CMake configuration files using a simpler search pattern rg '\$\{PROJECT_SOURCE_DIR\}/bin/' -A 3Length of output: 251
etc/script/build.sh (5)
59-71
: 代码更改通过
clear
函数使用${PROJECT_HOME:?}
确保变量不为空,这是一个很好的做法。
73-82
: 代码更改通过
show_help
函数正确实现了显示脚本使用信息的功能。
16-16
: 变量VERBOSE
未使用
VERBOSE
变量未使用,请验证其用途或删除。Tools
Shellcheck
[warning] 16-16: VERBOSE appears unused. Verify use (or export if used externally).
(SC2034)
13-13
: 变量SHORT_COMMIT_ID
未使用
SHORT_COMMIT_ID
变量未使用,请验证其用途或删除。Tools
Shellcheck
[warning] 13-13: SHORT_COMMIT_ID appears unused. Verify use (or export if used externally).
(SC2034)
23-23
: 变量CONF
未使用
CONF
变量未使用,请验证其用途或删除。Tools
Shellcheck
[warning] 23-23: CONF appears unused. Verify use (or export if used externally).
(SC2034)
tests/util/pikiwidb.go (1)
53-57
: 代码更改通过
GetConfPath
函数的更改改进了配置文件的组织结构,代码更改通过。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/pikiwidb.yml (4 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/pikiwidb.yml
add root dir for miscellaneous items.
Additionally, fix pikiwidb core dump by #389.
Summary by CodeRabbit