You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/06/21 15:57:10 UTC

[GitHub] [mynewt-core] clmklk commented on issue #1890: OS: Malloc mutex uninitialized

clmklk commented on issue #1890: OS: Malloc mutex uninitialized
URL: https://github.com/apache/mynewt-core/issues/1890#issuecomment-504477680
 
 
   The malloc mutex not being initialized, I have sometimes members of the structure `os_mutex` with a value different from 0.
   
   And in the function `os_mutex_release`, the line `rdy = SLIST_FIRST(&mu->mu_head);` returns a pointer with the value 0x00000002 for instance which doesn't make any sens but enough to pass the following condition, and finally deferencing the pointer causes a crash.
   
   Then I saw that the malloc mutex wasn't initialized and executing a `os_mutex_init` before the first `os_malloc` solved my issue.
   
   My crash happens in `os_mutex_release`, but the behavior in `os_mutex_pend` is also undefined, in function of the value present in the mutex structure during its declaration.
   
   I hope it helps you to understand.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services