[BUG] Scheduling stop in the prvCheckForRunStateChange function for SMP

Ouverte
#1,328 5 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
28/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
c

Piste de recherche

Start in tasks.c, reading vTaskSuspendAll and prvCheckForRunStateChange, and compare their interrupt masking with the port macros portSET_INTERRUPT_MASK and portENABLE_INTERRUPTS in the ARM port. Understanding the SMP run-state logic around prvYieldCore is required before changing anything. Done means the configASSERT on taskTASK_SCHEDULED_TO_YIELD no longer fires under the multi-task, semaphore-heavy reproduction, which needs an SMP target to verify.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug

Describe the bug
Running on the SMP system, the system stops scheduling, and an assertion is triggered at configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) in the code of the prvCheckForRunStateChange function.

In the vTaskSuspendAll function, the portSET_INTERRUPT_MASK() macro is used to disable interrupts before calling prvCheckForRunStateChange. However, the prvCheckForRunStateChange function code uses the portENABLE_INTERRUPTS() macro to temporarily enable task switching, which results in task switching not actually being enabled. After calling portENABLE_INTERRUPTS(), the interrupts used for scheduling remain masked.

Target

  • Development board: [user-defined]
  • Instruction Set Architecture: [ARM_CR82]
  • IDE and version: [IAR 9.20]

To Reproduce

  • Use multi-task with xSemaphoreXXX function on multi-core system.
  • Frequent calls to the vTaskSuspendAll function
  • Frequent calls to the prvYieldCore( xCoreID ) macro

Additional context
It might be appropriate to use the portDISABLE_INTERRUPTS() macro instead of the portSET_INTERRUPT_MASK() macro in the vTaskSuspendAll function.

Langage dominant
C
Étoiles
4.6k
Forks
1.6k
Merge moyen
2 j 22 h
PR mergées (30 j)
4

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de FreeRTOS/FreeRTOS-Kernel

Toutes les issues de FreeRTOS/FreeRTOS-Kernel

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.