)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cba7be6e022d8cb1171c08dee9fd2955f4d22afb","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Kulyatskaya Alexandra \u003ca.kulyatskaya@syntacore.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2025-11-01 18:37:47 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[src/server]: segfaults on disabling of a dropped semihosting redirection"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resolve two problems that occurred when working with semihosting service"},{"line_number":10,"context_line":"through multiple connection cycles (connect-disconnect-reconnect):"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"c18b5c0a_cb5bd028","line":7,"updated":"2025-11-01 23:19:04.000000000","message":"Jenkins complains about lines in commit message exceeding 75 chars.\nPlease split them to stay in the boundaries.\nAlso, please change the first line to follow the style reported in HACKING file (or in\nhttps://openocd.org/doc-release/doxygen/patchguide.html#stepbystep )\n`semihosting: fix memory leak and double free`","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4e93a0a3a651ecb59407840991a05294cf4e92ce","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kulyatskaya Alexandra \u003ca.kulyatskaya@syntacore.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2025-11-01 18:37:47 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[src/server]: segfaults on disabling of a dropped semihosting redirection"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resolve two problems that occurred when working with semihosting service"},{"line_number":10,"context_line":"through multiple connection cycles (connect-disconnect-reconnect):"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"627426a4_d0f0ed4c","line":7,"in_reply_to":"13946760_06fce7af","updated":"2025-11-08 17:58:06.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1002437,"name":"Alexandra Kulyatskaya","email":"a.kulyatskaya@syntacore.com","username":"AlexandraKulyatskaya"},"change_message_id":"dcf150df46303e538a06127c054b9498f59d2cd5","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Kulyatskaya Alexandra \u003ca.kulyatskaya@syntacore.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2025-11-01 18:37:47 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[src/server]: segfaults on disabling of a dropped semihosting redirection"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resolve two problems that occurred when working with semihosting service"},{"line_number":10,"context_line":"through multiple connection cycles (connect-disconnect-reconnect):"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"13946760_06fce7af","line":7,"in_reply_to":"c18b5c0a_cb5bd028","updated":"2025-11-06 16:44:56.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cba7be6e022d8cb1171c08dee9fd2955f4d22afb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"db9dc732_6230874e","updated":"2025-11-01 23:19:04.000000000","message":"Thanks for this patch.\nJust few comments below, otherwise looks ok.","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4e93a0a3a651ecb59407840991a05294cf4e92ce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"c0375147_91dec86f","updated":"2025-11-08 17:58:06.000000000","message":"Thanks!","commit_id":"5f2b6eb9b286611b90364fc2e775be0ba159ed54"},{"author":{"_account_id":1000859,"name":"Karl Palsson","email":"karlp@tweak.au","username":"karlp"},"change_message_id":"b39f9aa3c86cd302c6e7d7ce840c46fc4f55f0b3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"93f21749_952591a0","updated":"2025-12-17 11:42:26.000000000","message":"I\u0027m concerned this is actually worse than we thought.  This is going to cause more double free\u0027s too, ipdbg_start for instance does the same thing.  If it fails to add the service, it free\u0027s the member it allocated, (the object passed into \"priv\")\n\nI think the service should stop trying to free the -\u003epriv member entirely, and the semihosting code that was hitting this needs to be fixed instead.  That leaves alloc/free pairs in the code around the add_service() calls.  add_service is treating it as on opaque caller provided pointer, maybe there are other fields the outer caller needs to free as well?","commit_id":"5ff384be086a82e05901f37e07d16ab2b585c4c8"},{"author":{"_account_id":1000859,"name":"Karl Palsson","email":"karlp@tweak.au","username":"karlp"},"change_message_id":"9401b3c9597fe1181513ecd0a010eefa1a92a0b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"a2bdadd1_e27696f0","updated":"2025-12-15 10:19:09.000000000","message":"This is still causing problems.\nBecause free_service now hard free\u0027s the service-\u003epriv member, we\u0027re getting failures on double free from places like https://github.com/openocd-org/openocd/blob/master/src/server/rtt_server.c#L187-L190\n\nif it tries to bind to an address twice, the add_service fails, and the outer code is attempting to cleanup what it had allocated, which seems rational, easy to follow the alloc/free pairings.  But the -\u003epriv member is now freeed inside the server.c in the new method added here. I\u0027m not sure what the fix is, but this is not complete yet :(","commit_id":"5ff384be086a82e05901f37e07d16ab2b585c4c8"}],"src/server/server.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cba7be6e022d8cb1171c08dee9fd2955f4d22afb","unresolved":true,"context_lines":[{"line_number":58,"context_line":"\tint (*new_connection_handler)(struct connection *connection);"},{"line_number":59,"context_line":"\t/** callback to handle incoming data */"},{"line_number":60,"context_line":"\tint (*input_handler)(struct connection *connection);"},{"line_number":61,"context_line":"\tvoid (*dtor_handler)(struct service *service);"},{"line_number":62,"context_line":"\t/** callback to tear down the connection */"},{"line_number":63,"context_line":"\tint (*connection_closed_handler)(struct connection *connection);"},{"line_number":64,"context_line":"\t/** called periodically to send keep-alive messages on the connection */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"d5e0ef75_8e1ed1ea","line":61,"updated":"2025-11-01 23:19:04.000000000","message":"I prefer a more explicit name, like `service_dtor_handler()` because here we have mainly connection\u0027s related handlers.","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4e93a0a3a651ecb59407840991a05294cf4e92ce","unresolved":false,"context_lines":[{"line_number":58,"context_line":"\tint (*new_connection_handler)(struct connection *connection);"},{"line_number":59,"context_line":"\t/** callback to handle incoming data */"},{"line_number":60,"context_line":"\tint (*input_handler)(struct connection *connection);"},{"line_number":61,"context_line":"\tvoid (*dtor_handler)(struct service *service);"},{"line_number":62,"context_line":"\t/** callback to tear down the connection */"},{"line_number":63,"context_line":"\tint (*connection_closed_handler)(struct connection *connection);"},{"line_number":64,"context_line":"\t/** called periodically to send keep-alive messages on the connection */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"da0a93a6_5df187a5","line":61,"in_reply_to":"7884dacd_e1875a64","updated":"2025-11-08 17:58:06.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1002437,"name":"Alexandra Kulyatskaya","email":"a.kulyatskaya@syntacore.com","username":"AlexandraKulyatskaya"},"change_message_id":"dcf150df46303e538a06127c054b9498f59d2cd5","unresolved":true,"context_lines":[{"line_number":58,"context_line":"\tint (*new_connection_handler)(struct connection *connection);"},{"line_number":59,"context_line":"\t/** callback to handle incoming data */"},{"line_number":60,"context_line":"\tint (*input_handler)(struct connection *connection);"},{"line_number":61,"context_line":"\tvoid (*dtor_handler)(struct service *service);"},{"line_number":62,"context_line":"\t/** callback to tear down the connection */"},{"line_number":63,"context_line":"\tint (*connection_closed_handler)(struct connection *connection);"},{"line_number":64,"context_line":"\t/** called periodically to send keep-alive messages on the connection */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"7884dacd_e1875a64","line":61,"in_reply_to":"d5e0ef75_8e1ed1ea","updated":"2025-11-06 16:44:56.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cba7be6e022d8cb1171c08dee9fd2955f4d22afb","unresolved":true,"context_lines":[{"line_number":77,"context_line":"\tint (*new_connection_during_keep_alive)(struct connection *connection);"},{"line_number":78,"context_line":"\tint (*new_connection)(struct connection *connection);"},{"line_number":79,"context_line":"\tint (*input)(struct connection *connection);"},{"line_number":80,"context_line":"\tvoid (*dtor)(struct service *service);"},{"line_number":81,"context_line":"\tint (*connection_closed)(struct connection *connection);"},{"line_number":82,"context_line":"\tvoid (*keep_client_alive)(struct connection *connection);"},{"line_number":83,"context_line":"\tvoid *priv;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"9c21ba76_58f03373","line":80,"updated":"2025-11-01 23:19:04.000000000","message":"also this, please change it as `service_dtor()`","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1002437,"name":"Alexandra Kulyatskaya","email":"a.kulyatskaya@syntacore.com","username":"AlexandraKulyatskaya"},"change_message_id":"dcf150df46303e538a06127c054b9498f59d2cd5","unresolved":true,"context_lines":[{"line_number":77,"context_line":"\tint (*new_connection_during_keep_alive)(struct connection *connection);"},{"line_number":78,"context_line":"\tint (*new_connection)(struct connection *connection);"},{"line_number":79,"context_line":"\tint (*input)(struct connection *connection);"},{"line_number":80,"context_line":"\tvoid (*dtor)(struct service *service);"},{"line_number":81,"context_line":"\tint (*connection_closed)(struct connection *connection);"},{"line_number":82,"context_line":"\tvoid (*keep_client_alive)(struct connection *connection);"},{"line_number":83,"context_line":"\tvoid *priv;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"a0d821cd_571dc1e9","line":80,"in_reply_to":"9c21ba76_58f03373","updated":"2025-11-06 16:44:56.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4e93a0a3a651ecb59407840991a05294cf4e92ce","unresolved":false,"context_lines":[{"line_number":77,"context_line":"\tint (*new_connection_during_keep_alive)(struct connection *connection);"},{"line_number":78,"context_line":"\tint (*new_connection)(struct connection *connection);"},{"line_number":79,"context_line":"\tint (*input)(struct connection *connection);"},{"line_number":80,"context_line":"\tvoid (*dtor)(struct service *service);"},{"line_number":81,"context_line":"\tint (*connection_closed)(struct connection *connection);"},{"line_number":82,"context_line":"\tvoid (*keep_client_alive)(struct connection *connection);"},{"line_number":83,"context_line":"\tvoid *priv;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"f1ecf733_38ecaa0d","line":80,"in_reply_to":"a0d821cd_571dc1e9","updated":"2025-11-08 17:58:06.000000000","message":"Done","commit_id":"bac0d1dc54a25c1897d1112ce5b02e3ea0d92e1a"}]}
