Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc3220: 2.19+ crash on void mgos_conf_free_str(const char **sp) #568

Open
Sekilsgs2 opened this issue Jan 12, 2021 · 1 comment
Open

cc3220: 2.19+ crash on void mgos_conf_free_str(const char **sp) #568

Sekilsgs2 opened this issue Jan 12, 2021 · 1 comment

Comments

@Sekilsgs2
Copy link

Sekilsgs2 commented Jan 12, 2021

Board cc3220 On 2.19+ fw crashes when running function from
mongoose-os/src/mgos_sys_config.c

mgos_sys_config_set_device_id(device_id);
@Sekilsgs2 Sekilsgs2 changed the title cc3220: building with --local getting not working FW cc3220: 2.19 building with --local getting not working FW Jan 25, 2021
@Sekilsgs2 Sekilsgs2 changed the title cc3220: 2.19 building with --local getting not working FW cc3220: 2.19+ crash when mgos_sys_config_set_device_id(device_id); Feb 17, 2021
@Sekilsgs2
Copy link
Author

Sekilsgs2 commented Feb 18, 2021

Reason finded -

bool mgos_config_is_default_str(const char *s) {
  int num_str = (sizeof(mgos_config_str_table) / sizeof(mgos_config_str_table[0]));
  for (int i = 0; i < num_str; i++) {
    if (mgos_config_str_table[i] == s) return true; 
  }
  return false;
}

For cc3220 after mgos_config_set_defaults(cfg) - this comparsion not working and FW try free and cause crash

Sekilsgs2 added a commit to Sekilsgs2/mongoose-os that referenced this issue Feb 18, 2021
This PR fix for this issue - 
```
cesanta#568
```
Compare with == not always right way. Need using strcmp.
@Sekilsgs2 Sekilsgs2 reopened this Feb 19, 2021
@Sekilsgs2 Sekilsgs2 changed the title cc3220: 2.19+ crash when mgos_sys_config_set_device_id(device_id); cc3220: 2.19+ crash on mgos_config_is_default_str Feb 19, 2021
@Sekilsgs2 Sekilsgs2 changed the title cc3220: 2.19+ crash on mgos_config_is_default_str cc3220: 2.19+ crash on void mgos_conf_free_str(const char **sp) Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant