gemini-cli - 💡(How to fix) Fix gemini knew it was about to crash

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • [ $3 == 1 ] && echo "Error: '$error_msg'" script will exit with 0 upon encountering an error, silently hiding the failure FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Fix Action

Fix / Workaround

Patch 22: [PATCH v2 22/24] selftests-dyndbg: add a dynamic_debug run_tests target
Result:
Critical: 0 · High: 0 · Medium: 2 · Low: 0
Reviewed
▼ Inline Review
Copy
commit 5991b9725cc8742537ed8b6a73204e4d44da0fc2
Author: Jim Cromie [email protected]
selftests-dyndbg: add a dynamic_debug run_tests target
This commit adds a dynamic-debug selftest script that modifies pr_debug()
flags and checks their effects. It also integrates dynamic_debug into the
kselftest framework's TARGETS list.

diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
new file mode 100755
index 0000000000000..01c035fe8c9a2
--- /dev/null
+++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
@@ -0,0 +1,257 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-only
[ ... ]
+[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=".config"
+if [ -f "$KCONFIG_CONFIG" ]; then
Will this work reliably when selftests are installed and run on a target
device? When tests are run via make install on a target, the source tree's
.config won't be available.
If the .config is missing, the script defaults to LACK_DD_BUILTIN=0, which
may cause false test failures if the target kernel doesn't actually have the
config enabled. Could runtime indicators be checked instead of build-time files?

  • echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG"
  • grep -q "CONFIG_DYNAMIC_DEBUG=y" $KCONFIG_CONFIG ; LACK_DD_BUILTIN=$?
  • grep -q "CONFIG_TEST_DYNAMIC_DEBUG=m" $KCONFIG_CONFIG ; LACK_TMOD=$?
    [ ... ]
    +function handle_exit_code() {
  • local exp_exit_code=0
  • [ $# == 4 ] && exp_exit_code=$4
  • if [ $3 -ne $exp_exit_code ]; then
  •    echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $exp_exit_code"
  • [ $3 == 1 ] && echo "Error: '$error_msg'"
  •    exit $exp_exit_code

Does this mask test failures? If the actual exit code ($3) does not match
exp_exit_code (which defaults to 0), the script calls exit $exp_exit_code.
Since exp_exit_code is typically 0 when expecting a command to succeed, the
script will exit with 0 upon encountering an error, silently hiding the failure
from the kselftest framework.

  • fi
    +}
    [ ... ]
    +function check_match_ct {
  • pattern="\s$1\s"
  • exp_cnt=0
  • [ "$3" == "-r" ] && pattern="$1"
  • let cnt=$(ddgrep "$pattern" | wc -l)
  • if [ $V -eq 1 ] || [ "$3" == "-v" ] || [ "$4" == "-v" ]; then
  •    echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}"
  • fi
  • [ $# -gt 1 ] && exp_cnt=$2
  • if [ $cnt -ne $exp_cnt ]; then
  •    echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $exp_cnt on $1, got $cnt"
  •    exit

Does this also mask test failures? Calling exit without arguments returns
the status of the last executed command.
Since the echo command immediately preceding it will succeed with a 0 exit
code, the script exits with 0 and the kselftest framework will incorrectly mark
the failed test as passed. This same pattern appears to be used in several
other functions in the script.

  • else
  •    echo ": $cnt matches on $1"
  • fi
    +}
    To: Jim Cromie [email protected] Cc: [email protected] Status: Sent
    Tokens used: In: 74,892 · Cached: 56,544 · Out: 4,745
    View Raw Log
    ↑ Back to Summary
    Patch 23: [PATCH v2 23/24] dyndbg: change __dynamic_func_call_cls* macros into expressions
    Result:
    No regressions
    Reviewed
    ▶ Inline Review
    To: None Cc: None Status: Skipped
    Tokens used: In: 190,048 · Cached: 856,033 · Out: 1,077
    View Raw Log
    ↑ Back to Summary
    Patch 24: [PATCH v2 24/24] dyndbg: improve section names
    Result:
    No regressions
    Reviewed
    ▶ Inline Review
    To: None Cc: None Status: Skipped
    Tokens used: In: 485,084 · Cached: 4,635,493 · Out: 2,962
    View Raw Log
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ there!
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
RAW_BUFFERClick to expand / collapse

What happened?

I pasted a large sashiko AI review to gemini for rework assistance...

Patch 22: [PATCH v2 22/24] selftests-dyndbg: add a dynamic_debug run_tests target
Result:
Critical: 0 · High: 0 · Medium: 2 · Low: 0
Reviewed
▼ Inline Review
Copy
commit 5991b9725cc8742537ed8b6a73204e4d44da0fc2
Author: Jim Cromie [email protected]
selftests-dyndbg: add a dynamic_debug run_tests target
This commit adds a dynamic-debug selftest script that modifies pr_debug()
flags and checks their effects. It also integrates dynamic_debug into the
kselftest framework's TARGETS list.

diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
new file mode 100755
index 0000000000000..01c035fe8c9a2
--- /dev/null
+++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
@@ -0,0 +1,257 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-only
[ ... ]
+[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=".config"
+if [ -f "$KCONFIG_CONFIG" ]; then
Will this work reliably when selftests are installed and run on a target
device? When tests are run via make install on a target, the source tree's
.config won't be available.
If the .config is missing, the script defaults to LACK_DD_BUILTIN=0, which
may cause false test failures if the target kernel doesn't actually have the
config enabled. Could runtime indicators be checked instead of build-time files?

  • echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG"
  • grep -q "CONFIG_DYNAMIC_DEBUG=y" $KCONFIG_CONFIG ; LACK_DD_BUILTIN=$?
  • grep -q "CONFIG_TEST_DYNAMIC_DEBUG=m" $KCONFIG_CONFIG ; LACK_TMOD=$?
    [ ... ]
    +function handle_exit_code() {
  • local exp_exit_code=0
  • [ $# == 4 ] && exp_exit_code=$4
  • if [ $3 -ne $exp_exit_code ]; then
  •    echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $exp_exit_code"
  • [ $3 == 1 ] && echo "Error: '$error_msg'"
  •    exit $exp_exit_code

Does this mask test failures? If the actual exit code ($3) does not match
exp_exit_code (which defaults to 0), the script calls exit $exp_exit_code.
Since exp_exit_code is typically 0 when expecting a command to succeed, the
script will exit with 0 upon encountering an error, silently hiding the failure
from the kselftest framework.

  • fi
    +}
    [ ... ]
    +function check_match_ct {
  • pattern="\s$1\s"
  • exp_cnt=0
  • [ "$3" == "-r" ] && pattern="$1"
  • let cnt=$(ddgrep "$pattern" | wc -l)
  • if [ $V -eq 1 ] || [ "$3" == "-v" ] || [ "$4" == "-v" ]; then
  •    echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}"
  • fi
  • [ $# -gt 1 ] && exp_cnt=$2
  • if [ $cnt -ne $exp_cnt ]; then
  •    echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $exp_cnt on $1, got $cnt"
  •    exit

Does this also mask test failures? Calling exit without arguments returns
the status of the last executed command.
Since the echo command immediately preceding it will succeed with a 0 exit
code, the script exits with 0 and the kselftest framework will incorrectly mark
the failed test as passed. This same pattern appears to be used in several
other functions in the script.

  • else
  •    echo ": $cnt matches on $1"
  • fi
    +}
    To: Jim Cromie [email protected] Cc: [email protected] Status: Sent
    Tokens used: In: 74,892 · Cached: 56,544 · Out: 4,745
    View Raw Log
    ↑ Back to Summary
    Patch 23: [PATCH v2 23/24] dyndbg: change __dynamic_func_call_cls* macros into expressions
    Result:
    No regressions
    Reviewed
    ▶ Inline Review
    To: None Cc: None Status: Skipped
    Tokens used: In: 190,048 · Cached: 856,033 · Out: 1,077
    View Raw Log
    ↑ Back to Summary
    Patch 24: [PATCH v2 24/24] dyndbg: improve section names
    Result:
    No regressions
    Reviewed
    ▶ Inline Review
    To: None Cc: None Status: Skipped
    Tokens used: In: 485,084 · Cached: 4,635,493 · Out: 2,962
    View Raw Log
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ there!
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Shell ls -lt | head -n 10 │ │ │ │ ... first 1 line hidden (Ctrl+O to show) ... │ │ drwxr-xr-x. 1 jimc jimc 2094 May 22 12:12 b0-dd-off │ │ -rw-r--r--. 1 jimc jimc 41857 May 22 12:08 farmit.log │ │ drwxr-xr-x. 1 jimc jimc 1982 May 22 12:08 b0-dd-nomod │ │ drwxr-xr-x. 1 jimc jimc 2076 May 22 12:03 b0-dd-mix │ │ drwxr-xr-x. 1 jimc jimc 2084 May 22 11:58 b0-dd-builtin │ │ drwxr-xr-x. 1 jimc jimc 2134 May 22 11:54 b0-ftrace │ │ drwxr-xr-x. 1 jimc jimc 2140 May 22 11:45 b0-ksan-leak │ │ drwxr-xr-x. 1 jimc jimc 2130 May 22 11:39 b0-ksan │ │ drwxr-xr-x. 1 jimc jimc 2134 May 22 11:33 b0-dd-tyy │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ It looks like you might have forgotten to paste or attach the review!

Could you paste the text of the review here, or let me know if it's saved in a specific file in the workspace? Once I can see the comments, we'll go through them together.

⚠ High memory usage detected: 7.19 GB. If you experience a crash, please file a bug report by running /bug

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Shift+Tab to accept edits 1 GEMINI.md file ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

really ? I just pasted 877 lines in. you want it again ?

<--- Last few GCs --->▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ workspace (/directory) branch sandbox /model [1520643:0x563ddb413000] 155849635 ms: Scavenge 7479.8 (7712.1) -> 7473.9 (7715.9) MB, pooled: 8 MB, 14.94 / 0.00 ms (average mu = 0.249, current mu = 0.280) allocation failure; [1520643:0x563ddb413000] 155851280 ms: Mark-Compact 7484.4 (7716.6) -> 7470.1 (7720.1) MB, pooled: 0 MB, 1629.66 / 0.00 ms (average mu = 0.219, current mu = 0.185) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory ----- Native stack trace -----

1: 0x7fb384ca9d89 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/lib64/libnode.so.127] 2: 0x7fb386eb7ee4 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/lib64/libnode.so.127] 3: 0x7fb386eb81da v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/lib64/libnode.so.127] 4: 0x7fb387102e5b [/lib64/libnode.so.127] 5: 0x7fb387102e98 v8::internal::Heap::ReportIneffectiveMarkCompactIfNeeded() [/lib64/libnode.so.127] 6: 0x7fb38711d48e [/lib64/libnode.so.127] 7: 0x7fb3871200ec [/lib64/libnode.so.127] 8: 0x7fb387ac0317 [/lib64/libnode.so.127] jimc@frodo:~/projects/lx/wk-B$ gemini

What did you expect to happen?

given its warning, I expected a crash, but hoped for a discussion.

Client information

  • CLI Version: 0.42.0
  • Git Commit: 68e2196d5
  • Session ID: 096222c4-185d-4f88-aab8-d4439f4c2975
  • Operating System: linux v22.22.2
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: gemini-api-key
  • Memory Usage: 315.6 MB
  • Terminal Name: VTE(8203)
  • Terminal Background: #ffffff
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING