You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "moonchen (via GitHub)" <gi...@apache.org> on 2026/10/05 22:35:14 UTC

[I] header_rewrite: rm-destination after set-destination URL crashes traffic_server [trafficserver]

moonchen opened a new issue, #13800:
URL: https://github.com/apache/trafficserver/issues/13800

   In a remap rule, `rm-destination` crashes `traffic_server` if `set-destination URL` ran earlier for the same request.
   
   The two operators don't have to be in the same rule. For example, a conditional `set-destination URL` that routes canary traffic, plus a separate rule that strips a tracking parameter from every request:
   
   `remap.config`:
   ```
   map http://www.example.com/ http://127.0.0.1:8081/ @plugin=header_rewrite.so @pparam=rules.conf
   ```
   
   `rules.conf`:
   ```
   cond %{CLIENT-HEADER:X-Canary} ="1"
   set-destination URL "http://127.0.0.1:8081/canary/?%{CLIENT-URL:QUERY}"
   
   cond %{TRUE}
   rm-destination QUERY "utm_source"
   ```
   
   Requests without `X-Canary` are proxied normally. This one crashes `traffic_server`:
   ```
   curl -x http://127.0.0.1:8080 -H 'X-Canary: 1' 'http://www.example.com/?utm_source=x&a=1'
   ```
   ```
   Fatal: src/api/InkAPI.cc:1077: failed assertion `sdk_sanity_check_url_handle(obj) == TS_SUCCESS`
   ```
   
   `set-destination URL` replaces the request's URL object with `TSHttpHdrUrlSet()`. `rm-destination` still uses `_rri->requestUrl`, which points at the old, deallocated object. #12278 fixed the same problem for `set-destination` by checking `res.changed_url` and re-reading the URL from the header; `rm-destination` needs the same check.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] header_rewrite: rm-destination after set-destination URL crashes traffic_server [trafficserver]

Posted by "bryancall (via GitHub) via issues" <is...@trafficserver.apache.org>.
bryancall closed issue #13800: header_rewrite: rm-destination after set-destination URL crashes traffic_server
URL: https://github.com/apache/trafficserver/issues/13800


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org