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 2018/05/10 12:23:04 UTC

[GitHub] ncasaril opened a new issue #1080: fcb doesn't handle flash error well - infinite loop

ncasaril opened a new issue #1080: fcb doesn't handle flash error well - infinite loop
URL: https://github.com/apache/mynewt-core/issues/1080
 
 
   I store config using config_fcb in an external flash. Sometimes this flash plays up and trips fcb into an infinite loop from what it seems. 
   
   In the backtrack below: 
   
   - we're starting out in fcb_walk
   - enter the while loop running fcb_getnext_nolock
   - in fcb_getnext_nolock it calls fcb_elem_info
   - fcb_elem_info returns **FCB_ERR_FLASH** (as fcb_elem_crc8 fails with this rc)
   - fcb_getnext_nolock only handles **FCB_ERR_CRC** or **FCB_ERR_NOVAR** otherwise just return 0 to the calling fcb_walk
   - fcb_walk in turn tries to call fcb_getnext_nolock and we're back to the beginning. 
   
   As this happens when config_fcb is trying to read it's config at sysinit, sanity is not yet started. 
   
   ```
   #0  fcb_elem_info (fcb=fcb@entry=0x20001804 <config_init_conf_fcb+8>, loc=loc@entry=0x20002608 <os_main_stack+1920>) at repos/apache-mynewt-core/fs/fcb/src/fcb_elem_info.c:101
   #1  0x00032976 in fcb_getnext_in_area (fcb=0x20001804 <config_init_conf_fcb+8>, loc=0x20002608 <os_main_stack+1920>) at repos/apache-mynewt-core/fs/fcb/src/fcb_getnext.c:29
   #2  0x000329f6 in fcb_getnext_nolock (fcb=fcb@entry=0x20001804 <config_init_conf_fcb+8>, loc=loc@entry=0x20002608 <os_main_stack+1920>) at repos/apache-mynewt-core/fs/fcb/src/fcb_getnext.c:80
   #3  0x00032b40 in fcb_walk (fcb=0x20001804 <config_init_conf_fcb+8>, fap=fap@entry=0x0, cb=cb@entry=0x306e5 <conf_fcb_load_cb>, cb_arg=cb_arg@entry=0x20002630 <os_main_stack+1960>) at repos/apache-mynewt-core/fs/fcb/src/fcb_walk.c:40
   #4  0x00030736 in conf_fcb_load (cs=<optimized out>, cb=<optimized out>, cb_arg=<optimized out>) at repos/apache-mynewt-core/sys/config/src/config_fcb.c:128
   #5  0x00030630 in conf_load () at repos/apache-mynewt-core/sys/config/src/config_store.c:77
   #6  0x00015d6a in lnode_tasks_pkg_init () at mgmt/lnode_tasks/src/lnode_tasks_sysinit.c:45
   #7  0x0000af14 in sysinit_app () at bin/targets/lnode_main/generated/src/lnode_main-sysinit-app.c:182
   #8  0x00006468 in main (argc=<optimized out>, argv=<optimized out>) at apps/lnode/src/main.c:76
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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