Defensive programming for log in scheduler
@@ -42,6 +42,14 @@ static void swow_log_standard(CAT_LOG_PARAMATERS)
va_end(args);
} while (0);
+ /* Zend put()/error() may call PHP callbacks,
+ * we can not do it in a pure C or interned coroutine */
+ if (swow_coroutine_get_current()->executor == NULL) {
+ cat_log_standard(type, module_type, module_name CAT_SOURCE_POSITION_RELAY_CC, code, "%s", message);
+ cat_free(message);
+ return;
+ }
+
if (!(type & CAT_LOG_TYPES_ABNORMAL)) {
char *output;
const char *type_string = "Unknown";
