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

FS#3263 - struct blob_buf must be static when used as a local otherwise a runtime error occurs #8133

Closed
openwrt-bot opened this issue Aug 2, 2020 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

stuffa:

Supply the following if possible:

  • Device problem occurs on:
    rPi3B+. I expect that the problem occurs on other devices. I just happen to be developing in rPi3B+

  • Software versions of OpenWrt/LEDE release, packages, etc.
    Release 19.07 trunc

  • Steps to reproduce

void my_function() {
struct blob_buf b; // NOTE this is a local variable
blob_buf_init(&b, 0);
blobmsg_add_string(&b, "key", "value");
blob_buf_free(&b);
}

The above will compile, but will crash when run
However by making the struct static it runs OK.

This looks to be a compiler problem. possibly only for ARM

@openwrt-bot
Copy link
Author

john:

struct blob_buf b = {};
or memset the struct to 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant