fix zombie sul detection
The cmake define isn't exported, and msvc objects to void * comparision to
non void *.
Also dump the callback pointer with any errors, since after looking it up
in your mapfile this is usually enough to understand which sul and when it
was set.
diff --git a/cmake/lws_config.h.in b/cmake/lws_config.h.in
index 394651a..69d1877 100644
--- a/cmake/lws_config.h.in
+++ b/cmake/lws_config.h.in
@@ -179,6 +179,7 @@
#cmakedefine LWS_WITH_STATS
#cmakedefine LWS_WITH_STRUCT_SQLITE3
#cmakedefine LWS_WITH_STRUCT_JSON
+#cmakedefine LWS_WITH_SUL_DEBUGGING
#cmakedefine LWS_WITH_SQLITE3
#cmakedefine LWS_WITH_SYS_NTPCLIENT
#cmakedefine LWS_WITH_SYS_DHCP_CLIENT
diff --git a/lib/core-net/sorted-usec-list.c b/lib/core-net/sorted-usec-list.c
index 080bd35..4b31221 100644
--- a/lib/core-net/sorted-usec-list.c
+++ b/lib/core-net/sorted-usec-list.c
@@ -337,10 +337,12 @@
* indicated as being deleted?
*/
- if (sul >= po && lws_ptr_diff(sul, po) < len) {
+ if ((void *)sul >= po &&
+ (size_t)lws_ptr_diff(sul, po) < len) {
lwsl_err("%s: ERROR: Zombie Sul "
- "(on list %d) %s\n", __func__,
- m, destroy_description);
+ "(on list %d) %s, cb %p\n",
+ __func__, m,
+ destroy_description, sul->cb);
/*
* This assert fires if you have left
* a sul scheduled to fire later, but
@@ -350,6 +352,12 @@
* that may be scheduled before
* destroying the object the sul lives
* inside.
+ *
+ * You can look up the cb pointer in
+ * your mapfile to find out which
+ * callback function the sul was using
+ * which usually tells you which sul
+ * it is.
*/
assert(0);
}