Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Nathan Hartman
On Tue, Apr 4, 2023 at 5:53 PM Gregory Nutt wrote: > > On 4/4/2023 3:43 PM, Fotis Panagiotopoulos wrote: > > I drafted this change here: > > > > https://github.com/apache/nuttx/pull/8965 > > > > Have a look, please. PR 8965 looks good to me. In fact I had the exact same garbage access problem

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
On 4/4/2023 6:53 PM, Petro Karashchenko wrote: Just posted a comment in GitHub, but duplicating it here for visibility. The change might not be needed with https://github.com/apache/nuttx/pull/8951 as it removes access to pid hash table during sem_post() The change is good in any event.  It is

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Petro Karashchenko
Just posted a comment in GitHub, but duplicating it here for visibility. The change might not be needed with https://github.com/apache/nuttx/pull/8951 as it removes access to pid hash table during sem_post() Best regards, Petro On Wed, Apr 5, 2023, 12:53 AM Gregory Nutt wrote: > > On 4/4/2023 3

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
On 4/4/2023 3:43 PM, Fotis Panagiotopoulos wrote: I drafted this change here: https://github.com/apache/nuttx/pull/8965 Have a look, please. Although, I don't know if there will be any other places to be fixed like that? This is a unique problem since kmm_free is the only thing that was cal

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Fotis Panagiotopoulos
I drafted this change here: https://github.com/apache/nuttx/pull/8965 Have a look, please. Although, I don't know if there will be any other places to be fixed like that? Or if this is the best approach to this issue. This was just a quick experiment. On Wed, Apr 5, 2023 at 12:34 AM Gregory Nut

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
On 4/4/2023 3:32 PM, Fotis Panagiotopoulos wrote: I am trying again on my original setup (not the simplified defconfig that I provided later). I can now see how this is related to Greg's commit. Here is the stack trace at the time of the error: https://pasteboard.co/9QEmhZJFvIHC.png This is

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
Sorry, maybe it was a bad example. Here is a much more minimal config that you can run directly. https://pastebin.com/x775E7iF For me, it crashes almost immediately after starting. It actually calls nxsem_checkholder() many, many times before it finally triggers the KAZAN failure. Trying ag

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Fotis Panagiotopoulos
I am trying again on my original setup (not the simplified defconfig that I provided later). I can now see how this is related to Greg's commit. Here is the stack trace at the time of the error: https://pasteboard.co/9QEmhZJFvIHC.png This is what I think happens. nxtask_assign_pid() calls kmm_

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
On 4/4/2023 2:43 PM, Fotis Panagiotopoulos wrote: Sorry, maybe it was a bad example. Here is a much more minimal config that you can run directly. https://pastebin.com/x775E7iF For me, it crashes almost immediately after starting. Trying again with 4ff4562401401a3a86c74cb2bda9a1a2b8d94e6d and

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Fotis Panagiotopoulos
Sorry, maybe it was a bad example. Here is a much more minimal config that you can run directly. https://pastebin.com/x775E7iF For me, it crashes almost immediately after starting. Trying again with 4ff4562401401a3a86c74cb2bda9a1a2b8d94e6d and it moves along. On Tue, Apr 4, 2023 at 10:21 PM Gr

Re: os_test failure - Improper use of semaphores?

2023-04-04 Thread Gregory Nutt
I understand that the commit is NOT the root cause, rather it indicates an existing issue. That's why I am posting here. It is difficult to see any relationship between that commit which only generates an assertion (and which does not happen in your case).  I think you will need to take some

os_test failure - Improper use of semaphores?

2023-04-04 Thread Fotis Panagiotopoulos
Hello, Recently we saw the following commit get merged: commit 758e88672b703bcb0d1251ae9731b2ec295e81c0 Author: Gregory Nutt Date: Fri Mar 31 16:25:45 2023 -0600 Assert if a thread attempts to post a semaphore incorrectly. Assert in nxsem_post if: - Priority inheritance is enabl