Skip to content

Ignores NULL returned by msg_get_error to avoid segfault crash#830

Open
rprevot wants to merge 1 commit intoNetflix:v0.6from
rprevot:req_forward_error_segfault
Open

Ignores NULL returned by msg_get_error to avoid segfault crash#830
rprevot wants to merge 1 commit intoNetflix:v0.6from
rprevot:req_forward_error_segfault

Conversation

@rprevot
Copy link
Contributor

@rprevot rprevot commented Sep 12, 2025

Hi,

This pull request fixes #592.

Note that msg_get_error() may return a NULL pointer when :

  1. Client requests are dropped under heavy traffic (call stack : req_forward_error => msg_get_error => _msg_get) :
 static struct msg *_msg_get(struct conn *conn, bool request, const char *const caller) { struct msg *msg; // ......... // protect our server in the slow network and high traffics. // we drop client requests but still honor our peer requests if (alloc_msg_count >= alloc_msgs_max) { log_debug(LOG_WARN, "allocated #msgs %lu hit max allowable limit", alloc_msg_count); return NULL; } // ......... 
  1. Response message cannot be allocated.

Consequently, there is really no other solution than to ignore the NULL pointer and not forward the error.

@rprevot rprevot changed the title Ignores NULL response returned by msg_get_error to avoid segfault crash Ignores NULL returned by msg_get_error to avoid segfault crash Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant