Open zhengyikeng opened 1 month ago
Invalid Version reported. DISTRIB_REVISION='2.14.51'
Is this from a clean repository?
Invalid Release reported. DISTRIB_RELEASE='22.03.3'
Is this from a clean repository?
Invalid Target/Subtarget reported. DISTRIB_TARGET='rockchip/armv8'
Is this from a supported device?
Can you repeat on mainstream stable OpenWRT and copy proper release tags?
My problem has been resolved. My code has a mechanism that attempts to subscribe periodically after a subscription failure. The same struct ubus_subscriber has called API ubus_register_subscriber() multiple times, which can cause structural abnormalities in the avl tree
Just a suggestion, would it be better to do a check before insertion
diff --git a/libubus-obj.c b/libubus-obj.c
index 29cbb2b..aec0a4d 100644
--- a/libubus-obj.c
+++ b/libubus-obj.c
@@ -169,7 +169,9 @@ static void ubus_add_object_cb(struct ubus_request *req, int type, struct blob_a
if (attrbuf[UBUS_ATTR_OBJTYPE])
obj->type->id = blob_get_u32(attrbuf[UBUS_ATTR_OBJTYPE]);
-
+ /*
+ * Suggest: check if avl node exists in the AVL tree? and if it exists, would it be better to remove it first?
+ */
obj->avl.key = &obj->id;
avl_insert(&req->ctx->objects, &obj->avl);
Describe the bug
I added an Ubus object, which can be queried through the Ubus list
The ubus object exists, but when called by invoke, it returns the status 4.
Status 4 means UBUS_STATUS_NOT_FOUND? May I ask how to troubleshoot?
OpenWrt version
DISTRIB_REVISION='2.14.51'
OpenWrt release
DISTRIB_RELEASE='22.03.3'
OpenWrt target/subtarget
DISTRIB_TARGET='rockchip/armv8'
Device
RK3308B
Image kind
Self-built image
Steps to reproduce
No response
Actual behaviour
No response
Expected behaviour
No response
Additional info
No response
Diffconfig
No response
Terms