<!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_143581">commented</a>:
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Hello <a href="https://gitlab.rtems.org/gedare" title="Gedare Bloom" class="gfm gfm-project_member js-user-link" data-user="8" data-original="@gedare" data-container="body" data-placement="top" data-reference-type="user" style="color: #284779; background-color: #cbe2f9; border-radius: .25rem; margin-top: 0; padding: 0 2px;">@gedare</a> <a href="https://gitlab.rtems.org/joel" title="Joel Sherrill" class="gfm gfm-project_member js-user-link" data-user="7" data-original="@joel" data-container="body" data-placement="top" data-reference-type="user" style="color: #284779; background-color: #cbe2f9; border-radius: .25rem; padding: 0 2px;">@joel</a>,</p>
<h2 id="user-content-3rd-bug-" dir="auto" style="margin-top: 20px; margin-bottom: 10px;" align="initial">3rd BUG:-<a href="#3rd-bug-" aria-label="Link to heading '3rd BUG:-'" data-heading-content="3rd 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/4e339ba5e84988da6fdd50f43e3485cc/Screenshot_from_2026-02-24_01-29-18__1_.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/4e339ba5e84988da6fdd50f43e3485cc/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/4e339ba5e84988da6fdd50f43e3485cc/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/4e339ba5e84988da6fdd50f43e3485cc/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 file which generated the bug, ts-validation-no-clock-0.c,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">the GDB back tracing gave,</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/7220e0668c52b024d9f45b4c6f352c60/WhatsApp_Image_2026-02-26_at_23.05.03__1_.jpeg" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/7220e0668c52b024d9f45b4c6f352c60/WhatsApp_Image_2026-02-26_at_23.05.03__1_.jpeg" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/7220e0668c52b024d9f45b4c6f352c60/WhatsApp_Image_2026-02-26_at_23.05.03__1_.jpeg" alt="Image 2026-02-26 at 23.05.03 (1).jpeg" width="900" height="460" data-canonical-src="/uploads/7220e0668c52b024d9f45b4c6f352c60/WhatsApp_Image_2026-02-26_at_23.05.03__1_.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">Following the function calls , i found that , the test file <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;">ts-validation-no-clock-0.c</code>  is trying to self terminate the executing task, and while it does that before killing itself it calls off all the waiting tasks in its join queue and those tasks are added to the unblock chain.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">In threadqflush.c , the assertion came when the extracted node was being appended i.e</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( &unblock, &scheduler_node->Wait.Priority.Node.Node.Chain );</code></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">So this meant the extraction was not clearing the pointers of the node. I noticed that the extraction was done through <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;">_Priority_Extract()</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;">_RBTree_Extract()</code> , This only restores the RB tree state but but doesn't clear the pointers of the node.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">So this was the reason for assertion of chain's prev!=null.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">Proposed solution :-</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Initialize the extracted node before appending to the unblock chain,</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;">_Chain_Initialize_node( &scheduler_node->Wait.Priority.Node.Node.Chain ); </span>
<span id="LC2" class="line" lang="plaintext">_Chain_Append_unprotected( &unblock, &scheduler_node->Wait.Priority.Node.Node.Chain</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"><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/05f0fddd288aea3a74066f47cfff8f79/WhatsApp_Image_2026-02-26_at_23.06.14.jpeg" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/05f0fddd288aea3a74066f47cfff8f79/WhatsApp_Image_2026-02-26_at_23.06.14.jpeg" data-link="true" style="margin-top: 0;"><img src="https://gitlab.rtems.org/-/project/26/uploads/05f0fddd288aea3a74066f47cfff8f79/WhatsApp_Image_2026-02-26_at_23.06.14.jpeg" alt="Image 2026-02-26 at 23.06.14.jpeg" width="367" height="441" data-canonical-src="/uploads/05f0fddd288aea3a74066f47cfff8f79/WhatsApp_Image_2026-02-26_at_23.06.14.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">All the bugs of the combination, SMP = TRUE and DEBUG = TRUE/FALSE is fixed.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Only SMP = FALSE and DEBUG = TRUE/FALSE is left , It consists of only one bug so ill update it next.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Thank you, am i going in the right direction, please guide me in this .</p>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">I have updated the MR with the 3rd 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_143581">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-bu0fhrmqc543b845mqzo4c7v8/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_143581 at 1772130230
</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_143581"}}</script>


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