Skip to content

Commit

Permalink
syslog/intbuffer: fix spinlock deadlock
Browse files Browse the repository at this point in the history
just read the code, still have the deadlock after below change:

| commit 3b6f463
| Author: chenrun1 <[email protected]>
| Date:   Tue Dec 31 14:31:46 2024 +0800
|
|     syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
|
|     Summary:
|       When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer
|
|     Signed-off-by: chenrun1 <[email protected]>

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and xiaoxiang781216 committed Jan 20, 2025
1 parent 685f3ab commit 0e1214d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/syslog/syslog_intbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void syslog_add_intbuffer(FAR const char *buffer, size_t buflen)
}
else
{
syslog_flush_intbuffer(true);
syslog_flush_internal(true, sizeof(g_syslog_intbuffer.buffer));
space = buflen - sizeof(g_syslog_intbuffer.buffer);
syslog_write_foreach(buffer, space, true);
circbuf_write(&g_syslog_intbuffer.circ,
Expand Down

0 comments on commit 0e1214d

Please sign in to comment.