[rtems commit] posix: Fix pthread_spin_unlock()

Joel Sherrill joel at rtems.org
Mon Oct 19 15:42:09 UTC 2020


This was reported against 4.11 which means it needs to be committed to
4.11, 5, and master.

--joel

On Mon, Oct 19, 2020 at 10:33 AM Sebastian Huber <sebh at rtems.org> wrote:

> Module:    rtems
> Branch:    master
> Commit:    2b9fb3141cb10b8bbfa1a18a6aab42474988a636
> Changeset:
> http://git.rtems.org/rtems/commit/?id=2b9fb3141cb10b8bbfa1a18a6aab42474988a636
>
> Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
> Date:      Mon Oct 19 16:31:51 2020 +0200
>
> posix: Fix pthread_spin_unlock()
>
> Prevent a call to _SMP_lock_Stats_register_or_max_section_time().  This
> fixes a
> thread stack corruption in case RTEMS_PROFILING and RTEMS_SMP is enabled.
>
> Close #4157.
>
> ---
>
>  cpukit/posix/src/pspinunlock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpukit/posix/src/pspinunlock.c
> b/cpukit/posix/src/pspinunlock.c
> index ca36a5f..5c02012 100644
> --- a/cpukit/posix/src/pspinunlock.c
> +++ b/cpukit/posix/src/pspinunlock.c
> @@ -40,7 +40,7 @@ int pthread_spin_unlock( pthread_spinlock_t *lock )
>  #if defined(RTEMS_PROFILING)
>    /* This is a hack to get around the lock profiling statistics */
>    unused_stats.total_section_time = 0;
> -  unused_stats.max_section_time = 0;
> +  unused_stats.max_section_time = UINT32_MAX;
>    unused_context.stats = &unused_stats;
>    unused_context.acquire_instant = 0;
>  #endif
>
> _______________________________________________
> vc mailing list
> vc at rtems.org
> http://lists.rtems.org/mailman/listinfo/vc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20201019/c828476f/attachment.html>


More information about the devel mailing list