<!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 style="color: #777777;">
<a href="https://gitlab.rtems.org/Chandanuvm">Chandan U</a>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5491#note_143417">commented</a>:
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<h2 id="user-content-2nd-bug-" dir="auto" style="margin-top: 0; margin-bottom: 10px;" align="initial">2nd BUG:-<a href="#2nd-bug-" aria-label="Link to heading '2nd BUG:-'" data-heading-content="2nd BUG:-" class="anchor" style="margin-top: 0;"></a>
</h2>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">I compiled the testsuites for the configuration, <strong style="font-weight: 600; margin-top: 0;">SMP=true</strong> and <strong style="font-weight: 600;">DEBUG=TRUE/FALSE</strong>,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">Before:</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/d6a4e1f7c0bbb8798e14b4cd95763d96/Screenshot_from_2026-02-23_23-13-47.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/d6a4e1f7c0bbb8798e14b4cd95763d96/Screenshot_from_2026-02-23_23-13-47.png" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/d6a4e1f7c0bbb8798e14b4cd95763d96/Screenshot_from_2026-02-23_23-13-47.png" alt="Screenshot from 2026-02-23 23-13-47.png" width="225" height="141" data-canonical-src="/uploads/d6a4e1f7c0bbb8798e14b4cd95763d96/Screenshot_from_2026-02-23_23-13-47.png" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">First file which generated the bug,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/5cd61e6197f077bb1d746eb983537c43/Screenshot_from_2026-02-24_00-27-12.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/5cd61e6197f077bb1d746eb983537c43/Screenshot_from_2026-02-24_00-27-12.png" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/5cd61e6197f077bb1d746eb983537c43/Screenshot_from_2026-02-24_00-27-12.png" alt="Screenshot from 2026-02-24 00-27-12.png" width="900" height="331" data-canonical-src="/uploads/5cd61e6197f077bb1d746eb983537c43/Screenshot_from_2026-02-24_00-27-12.png" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">GDB debug back tracing from the break point,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/2b4006dc4a80555c606e269d57086692/Screenshot_from_2026-02-24_00-29-10.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/2b4006dc4a80555c606e269d57086692/Screenshot_from_2026-02-24_00-29-10.png" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/2b4006dc4a80555c606e269d57086692/Screenshot_from_2026-02-24_00-29-10.png" alt="Screenshot from 2026-02-24 00-29-10.png" width="900" height="222" data-canonical-src="/uploads/2b4006dc4a80555c606e269d57086692/Screenshot_from_2026-02-24_00-29-10.png" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">function calls flow and relevant files checked,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/783c0b838a3687d2a4470b781627d87a/WhatsApp_Image_2026-02-24_at_01.36.25.jpeg" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/783c0b838a3687d2a4470b781627d87a/WhatsApp_Image_2026-02-24_at_01.36.25.jpeg" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/783c0b838a3687d2a4470b781627d87a/WhatsApp_Image_2026-02-24_at_01.36.25.jpeg" alt="WhatsApp Image 2026-02-24 at 01.36.25.jpeg" width="743" height="600" data-canonical-src="/uploads/783c0b838a3687d2a4470b781627d87a/WhatsApp_Image_2026-02-24_at_01.36.25.jpeg" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">In smpmrsp01 , When semaphore is created , next == NULL and prev == garbage, and then it is trying to delete the semaphore created to test the deletion of semaphore.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">So it calls <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; 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;">test_mrsp_flush_error()</code> which eventually calls <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;">__Semaphore__Free()</code> Which asks the generic Object Manager to free this specific object which eventually calls<code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;"> _Chain_Append_unprotected()</code>.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0; 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;">_Chain_Append_unprotected()</code> contains <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; 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;">_Assert( _Chain_Is_node_off_chain( the_node ) )</code> in debug mode and since it asserts if prev != NULL which is true in this case, It throws an assertion error.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Solution proposed, Since generic Object manager cannot be changed and the assertion is only in debug mode, So in semimpl.h below changes can be done,</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; background-color: inherit; border-radius: .25rem; 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;">#if defined( RTEMS_DEBUG ) </span>
<span id="LC2" class="line" lang="plaintext">_Semaphore_Set_flags( the_semaphore, 0 ); </span>
<span id="LC3" class="line" lang="plaintext">#endif</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">Since while adding the chain to Free_chain queue the connections are made sure, only in debug mode it checks for the prev==NULL, So to optimize the cpu performance, the semaphore prev is made null only in debug mode.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">After:</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><a class="no-attachment-icon gfm" href="https://gitlab.rtems.org/-/project/26/uploads/f33326431bafcd5e8a832938f945f05e/Screenshot_from_2026-02-24_01-29-18__1_.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/f33326431bafcd5e8a832938f945f05e/Screenshot_from_2026-02-24_01-29-18__1_.png" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/f33326431bafcd5e8a832938f945f05e/Screenshot_from_2026-02-24_01-29-18__1_.png" alt="Screenshot from 2026-02-24 01-29-18 (1).png" width="283" height="322" data-canonical-src="/uploads/f33326431bafcd5e8a832938f945f05e/Screenshot_from_2026-02-24_01-29-18__1_.png" class="gfm" style="max-width: 100%; height: auto; margin-top: 0; vertical-align: baseline; object-fit: contain; object-position: top;"></a></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">The new failure is from new bug, and will be fixed next.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Please guide me in this, Thank you.</p>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">I have updated the MR with the first bug fix, <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1067" title="cpukit: fix off-chain state checks and pointer clearing" class="gfm gfm-merge_request" data-original="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1067" data-link="false" data-link-reference="true" data-merge-request="2194" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1067" data-container="body" data-placement="top" data-reference-type="merge_request" style="margin-top: 0;">!1067</a></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/rtos/rtems/-/issues/5491#note_143417">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/2-6ai8optkvo83mvbcgkessbk92/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/rtos/rtems/-/issues/5491#note_143417 at 1771952049
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5491#note_143417"}}</script>


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