<!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: hsla(0,0%,100%,.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: hsla(0,0%,100%,.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;">
Issue created by <a href="https://gitlab.rtems.org/c-mauderer">Christian Mauderer</a>: <a href="https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/work_items/217">#217</a>
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<h2 id="user-content-summary" dir="auto" style="margin-top: 0px; margin-bottom: 10px;" align="initial">Summary<a href="#summary" aria-label="Link to heading 'Summary'" data-heading-content="Summary" class="anchor" style="margin-top: 0px;"></a>
</h2>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">I try to use the x86_64-rtems-gdb together with qemu to debug an application. Unfortunately, gdb crashes when it tries to connect to qemu.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">I start qemu with the following line:</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: 0px 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0px; 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" data-lang="plaintext" style="margin-top: 0px;">> qemu-system-x86_64 -net none -m 1024 -serial vc --bios OVMF.4m.fd -drive file=fat:RTEMS-GRUB,format=raw,snapshot=on -gdb tcp::1234 -no-shutdown</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial"><code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; 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: keep-all; padding: 0.125rem 0.25rem;">RTEMS-GRUB</code> is a directory with a GRUB in EFI format and the application. But it shouldn't matter for this bug whether GRUB, FreeBSD loader or any other variant is used.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">Then I start gdb:</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: 0px 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0px; 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" data-lang="plaintext" style="margin-top: 0px;">> ../rtems-install/bin/x86_64-rtems7-gdb</span>
<span id="LC2" class="line" data-lang="plaintext">GNU gdb (GDB) 17.2</span>
<span id="LC3" class="line" data-lang="plaintext">Copyright (C) 2025 Free Software Foundation, Inc.</span>
<span id="LC4" class="line" data-lang="plaintext">License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></span>
<span id="LC5" class="line" data-lang="plaintext">This is free software: you are free to change and redistribute it.</span>
<span id="LC6" class="line" data-lang="plaintext">There is NO WARRANTY, to the extent permitted by law.</span>
<span id="LC7" class="line" data-lang="plaintext">Type "show copying" and "show warranty" for details.</span>
<span id="LC8" class="line" data-lang="plaintext">This GDB was configured as "--host=x86_64-linux-gnu --target=x86_64-rtems7".</span>
<span id="LC9" class="line" data-lang="plaintext">Type "show configuration" for configuration details.</span>
<span id="LC10" class="line" data-lang="plaintext">For bug reporting instructions, please see:</span>
<span id="LC11" class="line" data-lang="plaintext"><https://www.gnu.org/software/gdb/bugs/>.</span>
<span id="LC12" class="line" data-lang="plaintext">Find the GDB manual and other documentation resources online at:</span>
<span id="LC13" class="line" data-lang="plaintext">    <http://www.gnu.org/software/gdb/documentation/>.</span>
<span id="LC14" class="line" data-lang="plaintext"></span>
<span id="LC15" class="line" data-lang="plaintext">For help, type "help".</span>
<span id="LC16" class="line" data-lang="plaintext">Type "apropos word" to search for commands related to "word".</span>
<span id="LC17" class="line" data-lang="plaintext">(gdb) target remote localhost:1234</span>
<span id="LC18" class="line" data-lang="plaintext">Remote debugging using localhost:1234</span>
<span id="LC19" class="line" data-lang="plaintext">⚠️ warning: No executable has been specified and target does not support</span>
<span id="LC20" class="line" data-lang="plaintext">determining executable automatically.  Try using the "file" command.</span>
<span id="LC21" class="line" data-lang="plaintext">0x000000003e69aadb in ?? ()</span>
<span id="LC22" class="line" data-lang="plaintext">(gdb) file RTEMS-GRUB/rtems.exe</span>
<span id="LC23" class="line" data-lang="plaintext">A program is being debugged already.</span>
<span id="LC24" class="line" data-lang="plaintext">Are you sure you want to change the file? (y or n) y</span>
<span id="LC25" class="line" data-lang="plaintext">../../gdb-17.2/gdb/osabi.c:196: internal-error: gdbarch_lookup_osabi: multiple specific OS ABI match for architecture i386 flavour 5: first match "RTEMS", second match "RTEMS"</span>
<span id="LC26" class="line" data-lang="plaintext">A problem internal to GDB has been detected,</span>
<span id="LC27" class="line" data-lang="plaintext">further debugging may prove unreliable.</span>
<span id="LC28" class="line" data-lang="plaintext">----- Backtrace -----</span>
<span id="LC29" class="line" data-lang="plaintext">0x4fb439 gdb_internal_backtrace_1</span>
<span id="LC30" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/bt-utils.c:122</span>
<span id="LC31" class="line" data-lang="plaintext">0x4fb439 _Z22gdb_internal_backtracev</span>
<span id="LC32" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/bt-utils.c:175</span>
<span id="LC33" class="line" data-lang="plaintext">0x8b4494 internal_vproblem</span>
<span id="LC34" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/utils.c:423</span>
<span id="LC35" class="line" data-lang="plaintext">0x8b4838 _Z15internal_verrorPKciS0_P13__va_list_tag</span>
<span id="LC36" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/utils.c:503</span>
<span id="LC37" class="line" data-lang="plaintext">0xa017d1 _Z18internal_error_locPKciS0_z</span>
<span id="LC38" class="line" data-lang="plaintext">        ../../gdb-17.2/gdbsupport/errors.cc:57</span>
<span id="LC39" class="line" data-lang="plaintext">0x718f09 _Z20gdbarch_lookup_osabiP3bfd</span>
<span id="LC40" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/osabi.c:196</span>
<span id="LC41" class="line" data-lang="plaintext">0x4a72a8 _Z17gdbarch_info_fillP12gdbarch_info</span>
<span id="LC42" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/arch-utils.c:824</span>
<span id="LC43" class="line" data-lang="plaintext">0x4b4d0a _Z20gdbarch_find_by_info12gdbarch_info</span>
<span id="LC44" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/arch-utils.c:1393</span>
<span id="LC45" class="line" data-lang="plaintext">0x4b5c35 _Z21set_gdbarch_from_fileP3bfd</span>
<span id="LC46" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/arch-utils.c:659</span>
<span id="LC47" class="line" data-lang="plaintext">0x620ffe _Z16exec_file_attachPKci</span>
<span id="LC48" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/exec.c:503</span>
<span id="LC49" class="line" data-lang="plaintext">0x621e83 exec_file_command</span>
<span id="LC50" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/exec.c:563</span>
<span id="LC51" class="line" data-lang="plaintext">0x621f10 file_command</span>
<span id="LC52" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/exec.c:578</span>
<span id="LC53" class="line" data-lang="plaintext">0x531597 _Z8cmd_funcP16cmd_list_elementPKci</span>
<span id="LC54" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/cli/cli-decode.c:2827</span>
<span id="LC55" class="line" data-lang="plaintext">0x8747ac _Z15execute_commandPKci</span>
<span id="LC56" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/top.c:565</span>
<span id="LC57" class="line" data-lang="plaintext">0x61d91f _Z15command_handlerPKc</span>
<span id="LC58" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:613</span>
<span id="LC59" class="line" data-lang="plaintext">0x61f19a _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE</span>
<span id="LC60" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:849</span>
<span id="LC61" class="line" data-lang="plaintext">0x61e3dd gdb_rl_callback_handler</span>
<span id="LC62" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:288</span>
<span id="LC63" class="line" data-lang="plaintext">0x901bf8 rl_callback_read_char</span>
<span id="LC64" class="line" data-lang="plaintext">        ../../../gdb-17.2/readline/readline/callback.c:302</span>
<span id="LC65" class="line" data-lang="plaintext">0x61e4fd gdb_rl_callback_read_char_wrapper_sjlj</span>
<span id="LC66" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:197</span>
<span id="LC67" class="line" data-lang="plaintext">0x61e68e gdb_rl_callback_read_char_wrapper_noexcept</span>
<span id="LC68" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:240</span>
<span id="LC69" class="line" data-lang="plaintext">0x61e68e gdb_rl_callback_read_char_wrapper</span>
<span id="LC70" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/event-top.c:252</span>
<span id="LC71" class="line" data-lang="plaintext">0x8ae4cf stdin_event_handler</span>
<span id="LC72" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/ui.c:154</span>
<span id="LC73" class="line" data-lang="plaintext">0xa02165 gdb_wait_for_event</span>
<span id="LC74" class="line" data-lang="plaintext">        ../../gdb-17.2/gdbsupport/event-loop.cc:694</span>
<span id="LC75" class="line" data-lang="plaintext">0xa02dc3 _Z16gdb_do_one_eventi</span>
<span id="LC76" class="line" data-lang="plaintext">        ../../gdb-17.2/gdbsupport/event-loop.cc:263</span>
<span id="LC77" class="line" data-lang="plaintext">0x6d9e91 _ZN6interp12do_one_eventEi</span>
<span id="LC78" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/interps.h:87</span>
<span id="LC79" class="line" data-lang="plaintext">0x6d9e91 start_event_loop</span>
<span id="LC80" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/main.c:404</span>
<span id="LC81" class="line" data-lang="plaintext">0x6d9e91 captured_command_loop</span>
<span id="LC82" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/main.c:469</span>
<span id="LC83" class="line" data-lang="plaintext">0x6dc824 captured_main</span>
<span id="LC84" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/main.c:1359</span>
<span id="LC85" class="line" data-lang="plaintext">0x6dc824 _Z8gdb_mainP18captured_main_args</span>
<span id="LC86" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/main.c:1378</span>
<span id="LC87" class="line" data-lang="plaintext">0x440d9d main</span>
<span id="LC88" class="line" data-lang="plaintext">        ../../gdb-17.2/gdb/gdb.c:38</span>
<span id="LC89" class="line" data-lang="plaintext">---------------------</span>
<span id="LC90" class="line" data-lang="plaintext">../../gdb-17.2/gdb/osabi.c:196: internal-error: gdbarch_lookup_osabi: multiple specific OS ABI match for architecture i386 flavour 5: first match "RTEMS", second match "RTEMS"</span>
<span id="LC91" class="line" data-lang="plaintext">A problem internal to GDB has been detected,</span>
<span id="LC92" class="line" data-lang="plaintext">further debugging may prove unreliable.</span>
<span id="LC93" class="line" data-lang="plaintext">Quit this debugging session? (y or n) y</span>
<span id="LC94" class="line" data-lang="plaintext"></span>
<span id="LC95" class="line" data-lang="plaintext">This is a bug, please report it.  For instructions, see:</span>
<span id="LC96" class="line" data-lang="plaintext"><https://www.gnu.org/software/gdb/bugs/>.</span>
<span id="LC97" class="line" data-lang="plaintext"></span>
<span id="LC98" class="line" data-lang="plaintext">../../gdb-17.2/gdb/osabi.c:196: internal-error: gdbarch_lookup_osabi: multiple specific OS ABI match for architecture i386 flavour 5: first match "RTEMS", second match "RTEMS"</span>
<span id="LC99" class="line" data-lang="plaintext">A problem internal to GDB has been detected,</span>
<span id="LC100" class="line" data-lang="plaintext">further debugging may prove unreliable.</span>
<span id="LC101" class="line" data-lang="plaintext">Create a core file of GDB? (y or n) n</span>
<span id="LC102" class="line" data-lang="plaintext">…ics-240/rtems-x86_64-env/debug 15:20 >   </span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">I tracked the problem down to the TLS patch from here: <a href="https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/156" title="rtems/config/tools/gdb: Add TLS support patch" class="gfm gfm-merge_request" data-original="https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/156" data-link="false" data-link-reference="true" data-merge-request="1365" data-project="7" data-project-path="rtems/tools/rtems-source-builder" data-iid="156" data-container="body" data-placement="top" data-reference-type="merge_request" style="margin-top: 0px;">!156 (merged)</a></p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">If I compile gdb without it, everything works. The relevant error message seems to be the</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: 0px 0 1rem; padding: 12px; border: 1px solid #dcdcde;"><code style="font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0px; 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" data-lang="plaintext" style="margin-top: 0px;">../../gdb-17.2/gdb/osabi.c:196: internal-error: gdbarch_lookup_osabi: multiple specific OS ABI match for architecture i386 flavour 5: first match "RTEMS", second match "RTEMS"</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #3a383f; margin: 0px;" align="initial"><a href="https://gitlab.rtems.org/opticron" title="Kinsey Moore" class="gfm gfm-project_member js-user-link" data-user="4" data-original="@opticron" data-container="body" data-placement="top" data-reference-type="user" style="color: #284779; background-color: #cbe2f9; border-radius: .25rem; margin-top: 0px; padding: 0 2px;">@opticron</a> In case you are working on upstreaming the patch (you mentioned something in the MR), it might be worth to wait a bit till the problem is resolved.</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-source-builder/-/work_items/217">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/-/namespace/14/sent_notifications/6-dm24gblq5n9f2g11gedgfd0e3-e/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-source-builder/-/work_items/217 at 1793629734
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Work item","url":"https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/work_items/217"}}</script>


</p>
</div>
</body>
</html>