Skip to content

rb.h: macro RB_FOR_EACH_CONTAINER bug #13464

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

Closed
changkong5 opened this issue Feb 18, 2019 · 0 comments
Closed

rb.h: macro RB_FOR_EACH_CONTAINER bug #13464

changkong5 opened this issue Feb 18, 2019 · 0 comments
Assignees
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@changkong5
Copy link

changkong5 commented Feb 18, 2019

Describe the bug
The macro RB_FOR_EACH_CONTAINER in the rb.h when the function _rb_foreach_next(&tree, &__f) return NULL then the CONTAINER_OF will retrun error.

example:


   #define MAX_NODES 8
   struct rbextnode {
	int key;
	int val;
	struct rbnode node;
   } nodes[MAX_NODES];

   static struct rbtree tree;
   struct rbextnode *extnode;

   ......
   RB_FOR_EACH_CONTAINER(&tree, extnode, node) {
      ...
   }
   ......

Test on nrf52832 board when the function _rb_foreach_next(&tree, &__f) in the macro RB_FOR_EACH_CONTAINER return NULL then the variable extnode is 0xFFFFFFF8 and run forever in for structural body.

To Reproduce

@changkong5 changkong5 added the bug The issue is a bug, or the PR is fixing a bug label Feb 18, 2019
@nashif nashif added priority: medium Medium impact/importance bug area: Kernel labels Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants