<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">
<p class="details" style="font-style: italic; color: #626168;">
<a href="https://gitlab.rtems.org/gedare">Gedare Bloom</a> created an issue: <a href="https://gitlab.rtems.org/rtems/tools/rtems-sis/-/issues/2">#2</a>
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<h2 dir="auto" style="margin-top: 0; margin-bottom: 10px;" align="initial">
<a href="#summary" aria-hidden="true" class="anchor" id="user-content-summary" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Summary</h2>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Initially reported at
<a href="https://users.rtems.org/t/sis-simulator-works-standalone-but-fails-with-gdb-debugging-on-gr740-internal-error-no-memory-for-heap/241" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">https://users.rtems.org/t/sis-simulator-works-standalone-but-fails-with-gdb-debugging-on-gr740-internal-error-no-memory-for-heap/241</a></p>
<h2 dir="auto" style="margin-top: 20px; margin-bottom: 10px;" align="initial">
<a href="#steps-to-reproduce" aria-hidden="true" class="anchor" id="user-content-steps-to-reproduce" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Steps to reproduce</h2>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">I’m having trouble debugging RTEMS applications using SIS simulator with GDB on GR740 emulation. The application runs fine when executed directly through SIS, but encounters memory allocation errors when using GDB.</p>
<h3 dir="auto" style="margin-top: 1.5rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.125rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#working-scenario" aria-hidden="true" class="anchor" id="user-content-working-scenario" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Working scenario:</h3>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">sparc-rtems7-sis -gr740 -nouartrx -r -m 4 src/rtems/build/sparc/gr740/testsuites/samples/hello.exe</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">This executes perfectly and shows the expected “Hello World” output like below:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;"> SIS - SPARC/RISCV instruction simulator 2.30, copyright Jiri Gaisler 2020</span>
<span id="LC2" class="line" lang="plaintext"> Bug-reports to jiri@gaisler.se</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext"> GR740/LEON4 emulation enabled, 4 cpus online, delta 50 clocks</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext"> Loaded src/rtems/build/sparc/gr740/testsuites/samples/hello.exe, entry 0x00000000</span>
<span id="LC7" class="line" lang="plaintext"></span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">*** BEGIN OF TEST HELLO WORLD ***</span>
<span id="LC10" class="line" lang="plaintext">*** TEST VERSION: 7.0.0.8fd021bbb30843dc91e5bac228b5d463b45530ae</span>
<span id="LC11" class="line" lang="plaintext">*** TEST STATE: EXPECTED_PASS</span>
<span id="LC12" class="line" lang="plaintext">*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API RTEMS_SMP</span>
<span id="LC13" class="line" lang="plaintext">*** TEST TOOLS: 13.4.0 20250605 (RTEMS 7, RSB 3d1db73ef0de7cc396183f6c599a301f355d2bba, Newlib 038afec1)</span>
<span id="LC14" class="line" lang="plaintext">Hello World</span>
<span id="LC15" class="line" lang="plaintext"></span>
<span id="LC16" class="line" lang="plaintext">*** END OF TEST HELLO WORLD ***</span>
<span id="LC17" class="line" lang="plaintext"></span>
<span id="LC18" class="line" lang="plaintext"></span>
<span id="LC19" class="line" lang="plaintext">[ RTEMS shutdown ]</span>
<span id="LC20" class="line" lang="plaintext">CPU: 0</span>
<span id="LC21" class="line" lang="plaintext">RTEMS version: 7.0.0.8fd021bbb30843dc91e5bac228b5d463b45530ae</span>
<span id="LC22" class="line" lang="plaintext">RTEMS tools: 13.4.0 20250605 (RTEMS 7, RSB 3d1db73ef0de7cc396183f6c599a301f355d2bba, Newlib 038afec1)</span>
<span id="LC23" class="line" lang="plaintext">executing thread ID: 0x0a010001</span>
<span id="LC24" class="line" lang="plaintext">executing thread name: UI1 </span>
<span id="LC25" class="line" lang="plaintext">cpu 0 in error mode (tt = 0x80)</span>
<span id="LC26" class="line" lang="plaintext">Problematic scenario:</span>
<span id="LC27" class="line" lang="plaintext"></span>
<span id="LC28" class="line" lang="plaintext"># Terminal 1: Start SIS with GDB server</span>
<span id="LC29" class="line" lang="plaintext">sparc-rtems7-sis -gdb -gr740 -m 4</span>
<span id="LC30" class="line" lang="plaintext"></span>
<span id="LC31" class="line" lang="plaintext"># Terminal 2: Connect with GDB</span>
<span id="LC32" class="line" lang="plaintext">sparc-rtems7-gdb src/rtems/build/sparc/gr740/testsuites/samples/hello.exe</span>
<span id="LC33" class="line" lang="plaintext">(gdb) target extended-remote localhost:1234</span>
<span id="LC34" class="line" lang="plaintext">(gdb) load</span>
<span id="LC35" class="line" lang="plaintext">(gdb) c</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<h3 dir="auto" style="margin-top: 1.5rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.125rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#error-encountered" aria-hidden="true" class="anchor" id="user-content-error-encountered" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Error encountered:</h3>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">When starting SIS with -gdb option (without specifying the executable), I get:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style='display: block; font-size: 14px; color: #3a383f; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 1rem; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; border-radius: .25rem; background-color: inherit; white-space: pre; margin-top: 0; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;"> SIS - SPARC/RISCV instruction simulator 2.30, copyright Jiri Gaisler 2020</span>
<span id="LC2" class="line" lang="plaintext"> Bug-reports to jiri@gaisler.se</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext"> GR740/LEON4 emulation enabled, 4 cpus online, delta 50 clocks</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext">gdb: listening on port 1234 connected</span>
<span id="LC7" class="line" lang="plaintext">X0,0:#1e</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">*** FATAL ***</span>
<span id="LC10" class="line" lang="plaintext">fatal source: 0 (INTERNAL_ERROR_CORE)</span>
<span id="LC11" class="line" lang="plaintext">CPU: 0</span>
<span id="LC12" class="line" lang="plaintext">fatal code: 23 (INTERNAL_ERROR_NO_MEMORY_FOR_HEAP)</span>
<span id="LC13" class="line" lang="plaintext">RTEMS version: 7.0.0.8fd021bbb30843dc91e5bac228b5d463b45530ae</span>
<span id="LC14" class="line" lang="plaintext">RTEMS tools: 13.4.0 20250605 (RTEMS 7, RSB 3d1db73ef0de7cc396183f6c599a301f355d2bba, Newlib 038afec1)</span>
<span id="LC15" class="line" lang="plaintext">executing thread is NULL</span>
<span id="LC16" class="line" lang="plaintext">X0,0:#1e appears to be the GDB remote response during the load operation.</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<h3 dir="auto" style="margin-top: 1.5rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.125rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#environment" aria-hidden="true" class="anchor" id="user-content-environment" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Environment:</h3>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Target Platform: GR740 (LEON4 SPARC V8 quad-core processor)
SIS version: 2.30
RTEMS version: 7.0.0.8fd021bbb30843dc91e5bac228b5d463b45530ae
Toolchain: sparc-rtems7-gcc 13.4.0 20250605 (RTEMS 7, RSB 3d1db73ef0de7cc396183f6c599a301f355d2bba, Newlib 038afec1)
SIS Configuration: GR740/LEON4 emulation with 4 CPU cores (-gr740 -m 4)
Application: Simple “Hello World” test from RTEMS testsuites (built for sparc/gr740 BSP)
Memory Layout: Using GR740’s default memory configuration</p>
<h3 dir="auto" style="margin-top: 1.5rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.125rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#rtems-build-environment" aria-hidden="true" class="anchor" id="user-content-rtems-build-environment" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>RTEMS Build Environment:</h3>
<h4 dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#toolchain-installation" aria-hidden="true" class="anchor" id="user-content-toolchain-installation" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Toolchain Installation:</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">../source-builder/sb-set-builder --prefix=/opt/rtems/7 7/rtems-sparc</p>
<h4 dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#rtems-kernel-configuration" aria-hidden="true" class="anchor" id="user-content-rtems-kernel-configuration" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>RTEMS Kernel Configuration:</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">./waf configure --rtems-bsps=sparc/gr740 --rtems-tools=/opt/rtems/7 --prefix=/opt/rtems/7 --rtems-config=config.ini</p>
<h4 dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#build-and-install" aria-hidden="true" class="anchor" id="user-content-build-and-install" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>Build and Install:</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">./waf && ./waf install</p>
<h4 dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">
<a href="#configini-contents" aria-hidden="true" class="anchor" id="user-content-configini-contents" style="margin-top: 0; margin-left: -20px; text-decoration: none; outline: none; position: absolute; width: 20px;"></a>config.ini contents:</h4>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">[sparc/gr740]
RTEMS_SMP=True
RTEMS_POSIX_API=True
BUILD_TESTS=True
RTEMS_DEBUG=True</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/tools/rtems-sis/-/issues/2">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/1-8kzagw9uz5xc3myy1zzd14r5r/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.rtems.org/rtems/tools/rtems-sis/-/issues/2 at 1768670853
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/tools/rtems-sis/-/issues/2"}}</script>
</p>
</div>
</body>
</html>