<!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=US-ASCII" 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: #737278;">
<a href="https://gitlab.rtems.org/yang.zhang">yang zhang</a> created a merge request: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/473">!473</a>
</p>
<div class="branch">
Project:Branches: yang.zhang/rtems:fix_potential_interrupt_crash to rtems/rtos/rtems:main
</div>
<div class="author">
Author: yang zhang
</div>
<div class="assignee">
Assignees: 
</div>
<div class="reviewer">
Reviewers: 
</div>
<div class="approvers">

</div>
<div class="md gl-mt-5" style="position: relative; z-index: 1; color: #28272d; word-wrap: break-word; margin-top: 1rem;">
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #28272d; margin: 0 0 16px;" align="initial">
<a href="#summary" aria-hidden="true" class="anchor" id="user-content-summary" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Summary</h2>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">In some special cases when disbale <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>CONFIGURE_RECORD_INTERRUPTS_ENABLED</code>, it will link
<code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_get_dispatch_table_slot</code> in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>irq-record.c</code> but not the one in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>irq-generic.c</code>.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">Then when install interrupt handlers by <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>rtems_interrupt_handler_install</code>, they would be installed
in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>_Record_Interrupt_dispatch_table</code> array, but when dispatch interrupts by
<code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_handler_dispatch_unchecked</code>, it iterate <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_dispatch_table</code> array, then
would be crashed.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">So we should only define <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_get_dispatch_table_slot</code> in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>irq-generic.c</code> when enable
<code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>CONFIGURE_RECORD_INTERRUPTS_ENABLED</code>.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">By the way, this issue only reproduce in myself project for a special board when building a example not
a simple testsuite. I try to reproduce it on the aarch64/zynqmp_qemu, but failed to reproduce. This issue
can be only reproduce when the exe link the <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_get_dispatch_table_slot</code> in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>irq-record.c</code>, but
i have not find the reason why there is a link difference, but i think <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>bsp_interrupt_get_dispatch_table_slot</code>
in <code style='font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>irq-record.c</code> should be a potential problem.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">I have extracted some logs of the linking process.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">attempt to open ../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.so failed
attempt to open ../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a succeeded
../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)uart_put.S.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)cache.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)clockdrv.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)mips_timer.S.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)inittlb.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)bsp_fdt.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)ls1b_dtb.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)getentropy-cpucounter.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)ls_idtmem.S.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)ls_idttlb.S.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)console-polled.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)bootcard.c.7.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)bspfatal-default.c.7.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-handler-install.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-lock.c.13.o</p>
<blockquote dir="auto" style="font-size: inherit; color: #4c4b51; padding-top: .5rem; padding-bottom: .5rem; padding-left: 1rem; border-left-color: #dcdcde; border-left-style: solid; margin: .5rem 0 0; border-width: 0 0 0 4px;" align="initial">
<blockquote style="font-size: inherit; color: #4c4b51; padding-top: .5rem; padding-bottom: .5rem; padding-left: 1rem; border-left-color: #dcdcde; border-left-style: solid; margin: 0 0 .5rem; border-width: 0 0 0 4px;">
<p style="color: inherit; line-height: 1.5; margin: 0;">(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-record.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-server.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-shell.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)console-io.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)bspreset.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)bspstart.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)vectorexceptions.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-generic.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-handler-iterate.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-handler-remove.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-info.c.13.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)vectorisrs.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)ls_installisrentries.c.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)isr_entries.S.26.o
(../../../../../../../RTEMS/rtems/6/mips-rtems6/ls1b/lib/librtemsbsp.a)irq-entry-remove.c.13.o</p>
</blockquote>
</blockquote>
</div>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">

<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/473">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/92b86f756a1d9c748f867ce66c71f469/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>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/473"}}</script>


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