You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "John Plevyak (JIRA)" <ji...@apache.org> on 2010/03/18 19:46:27 UTC

[jira] Created: (TS-253) HTTP Header Host ptr field not set

HTTP Header Host ptr field not set
----------------------------------

                 Key: TS-253
                 URL: https://issues.apache.org/jira/browse/TS-253
             Project: Traffic Server
          Issue Type: Bug
          Components: Core
            Reporter: John Plevyak


I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.

the m_ptr_host field is 0x0 while the m_len_host is correct (14).

here is what it looks like:

$20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
  m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
  m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
  m_ptr_scheme = 0x0, 
  m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
  m_ptr_host = 0x0, 
  m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
  m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
  m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
  m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "Steve Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848302#action_12848302 ] 

Steve Jiang commented on TS-253:
--------------------------------

cache_scan is triggered by the cache inspector:

http://incubator.apache.org/trafficserver/docs/v2/admin/cache.htm#InspectingCache


> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848467#action_12848467 ] 

John Plevyak commented on TS-253:
---------------------------------

I can't seem to repro the original problem.  If you changed the URL marshaled
format than the disk format would be incompatible.  Maybe that was the problem.

In any case, the marshaling code for URLs is in URL.cc under around 283
and in HdrHeap.cc 673. 


> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850241#action_12850241 ] 

John Plevyak commented on TS-253:
---------------------------------

This code is a bit complex, but basically the non-pointer members are preserved by memcpy of the Impl structures.
They are done in bulk because allocate_obj puts them into the HdrHeap which is then copied in total and then
the pointers are swizzled and unswizzed in the various marshal and unmarshal functions. 

> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "Manjesh Nilange (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848297#action_12848297 ] 

Manjesh Nilange commented on TS-253:
------------------------------------

John, I'm generally new to TS code and specifically new to the cache code. I'm having difficulty isolating this issue. Can you give me some details?

I browsed through the cache code and enabled 'cache_scan' debug tag. But that didn't print out any messages - leading me to believe that the code in CachePart.cc is perhaps not being used at all. So I tried gdb'ing traffic_server and breaking on Cache::lookup(). However even when TS was serving from cache (fs cache configured in storage.config), that function was never called either - neither at startup nor when processing the request. Can you tell me how you dumped the above variable? Thanks!

> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848317#action_12848317 ] 

John Plevyak commented on TS-253:
---------------------------------

To reproduce:

1. setup cache inspector
2. surf through the proxy (forward mode) to some web site (yahoo.com)
3. put a break point at CachePart.cc:179 where it is doing a vector.get(i)->request_get()->url_get()->hostname_get(&hlen))
4. in the cache inspector do a Regex scan for  .* 

you should get a SEGV when memcpy tries to copy from NULL at the break line.



> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "Manjesh Nilange (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848929#action_12848929 ] 

Manjesh Nilange commented on TS-253:
------------------------------------

We did have a problem when we added a new member to the URL class. The cache files created by the older code were unusable with the new version. What we tried then was to move the new member to the end of the class (initially it's position was somewhere in the middle) and this seemed to work. The new code was able to read cache files created by the old code.

We went with this "unscientific" approach, because I couldn't figure out where the non-pointer members of the class were being marshalled. Members like m_len_host were not being explicitly being marshalled or unmarshalled.


> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848340#action_12848340 ] 

John Plevyak commented on TS-253:
---------------------------------

I tried to build a regression for this, but it didn't catch the problem, however I did fix another issue.
Backing out the URL change does fix it:

Index: URL.cc
===================================================================
--- URL.cc      (revision 926339)
+++ URL.cc      (working copy)
@@ -210,25 +210,9 @@
 void
 url_copy_onto(URLImpl * s_url, HdrHeap * s_heap, URLImpl * d_url, HdrHeap * d_heap, bool inherit_strs)
 {
-  if (s_url != d_url) {
-    obj_copy_data((HdrHeapObjImpl *) s_url, (HdrHeapObjImpl *) d_url);
-    if (inherit_strs && (s_heap != d_heap))
-      d_heap->inherit_string_heaps(s_heap);
-
-    // m_ptr_host is reused by the object if it has capacity and not
-    // reallocated on every url_host_set(); obj_copy_data() above does
-    // a "shallow" copy and inherit_string_heaps() inherits strings as
-    // "read-only" (see HdrHeap.cc). Hence we have to make sure the
-    // copied object uses a different buffer
-    if (s_url->m_ptr_host && (s_url->m_capacity_host > 0) && d_heap) {
-      d_url->m_ptr_host = d_heap->allocate_str(d_url->m_capacity_host);
-      if (d_url->m_ptr_host) {
-        memcpy(const_cast<char *>(d_url->m_ptr_host), s_url->m_ptr_host, s_url->m_capacity_host);
-      } else {
-        d_url->m_capacity_host = d_url->m_len_host = 0;
-      }
-    }
-  }
+  obj_copy_data((HdrHeapObjImpl *) s_url, (HdrHeapObjImpl *) d_url);
+  if (inherit_strs && (s_heap != d_heap))
+    d_heap->inherit_string_heaps(s_heap);
 }
 
 /*-------------------------------------------------------------------------
@@ -240,7 +224,7 @@
   d_url->m_len_scheme = 0;
   d_url->m_len_user = 0;
   d_url->m_len_password = 0;
-  d_url->m_len_host = d_url->m_capacity_host = 0;
+  d_url->m_len_host = 0;
   d_url->m_len_port = 0;
 
   d_url->m_ptr_scheme = NULL;


> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-253) HTTP Header Host ptr field not set

Posted by "Manjesh Nilange (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848430#action_12848430 ] 

Manjesh Nilange commented on TS-253:
------------------------------------

It seemed to work fine for me:

(gdb) where
#0  CacheVC::scanObject (this=0xa084920, event=3900, e=0xa084a18)
    at ../../../iocore/cache/CachePart.cc:179
#1  0x0810ee55 in Continuation::handleEvent (this=0xa084920, event=3900, data=0xa084a18)
    at ../../../iocore/eventsystem/I_Continuation.h:147
#2  0x082bfa5c in AIOCallbackInternal::io_complete (this=0xa084a18, event=1,
    data=0xb509f2b0) at ../../../iocore/aio/P_AIO.h:75
#3  0x0810ee55 in Continuation::handleEvent (this=0xa084a18, event=1, data=0xb509f2b0)
    at ../../../iocore/eventsystem/I_Continuation.h:147
#4  0x08322def in EThread::process_event (this=0x5ad7008, e=0xb509f2b0, calling_code=1)
    at ../../../iocore/eventsystem/UnixEThread.cc:132
#5  0x083230a2 in EThread::execute (this=0x5ad7008)
    at ../../../iocore/eventsystem/UnixEThread.cc:181
#6  0x08321830 in spawn_thread_internal (a=0x9f32e78)
    at ../../../iocore/eventsystem/Thread.cc:85
#7  0x00f8f3cc in start_thread () from /lib/tls/libpthread.so.0
#8  0x00d04f0e in clone () from /lib/tls/libc.so.6
(gdb) call vector.get(i)->request_get()->url_get()
$1 = (URL *) 0x3526484
(gdb) p *(((URL *) 0x3526484)->m_url_impl)
$2 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 80, m_obj_flags = 0}, m_len_scheme = 4,
  m_len_user = 0, m_len_password = 0, m_len_host = 10, m_len_port = 0, m_len_path = 39,
  m_len_params = 0, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0,
  m_ptr_scheme = 0x3526781 "http://l.yimg.com/a/i/ww/news/2010/03/22/obamavote-pd.jpg HTTP/1.1\r\nHost: l.yimg.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5"..., m_ptr_user = 0x0,
  m_ptr_password = 0x0,
  m_ptr_host = 0x3526788 "l.yimg.com/a/i/ww/news/2010/03/22/obamavote-pd.jpg HTTP/1.1\r\nHost: l.yimg.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)"..., m_ptr_port = 0x0,
  m_ptr_path = 0x3526793 "a/i/ww/news/2010/03/22/obamavote-pd.jpg HTTP/1.1\r\nHost: l.yimg.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)\r\nAccept: i"..., m_ptr_params = 0x0,
  m_ptr_query = 0x0, m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = true,
  m_scheme_wks_idx = 95, m_port = 0, m_url_type = 1 '\001', m_type_code = 0 '\0',
  m_capacity_host = 0}
(gdb) c
Continuing.
cache_scan: hostname = 'l.yimg.com', hostlen = 10

Breakpoint 1, CacheVC::scanObject (this=0xa084920, event=3900, e=0xa084a18)
    at ../../../iocore/cache/CachePart.cc:179

179             Debug("cache_scan", "hostname = '%s', hostlen = %d", hname, hlen);
(gdb)
Continuing.

Breakpoint 1, CacheVC::scanObject (this=0xa084920, event=3900, e=0xa084a18)
    at ../../../iocore/cache/CachePart.cc:179
179             Debug("cache_scan", "hostname = '%s', hostlen = %d", hname, hlen);
(gdb) p hname
$3 = "srd.yahoo.comGETHostsrd.yahoo.comUser-AgentMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)Acceptimage/png,image/*;q=0.8,*/*;q=0.5Accept-La"...
(gdb) p hlen
$4 = 13
(gdb) c
Continuing.

Breakpoint 1, CacheVC::scanObject (this=0xa084920, event=3900, e=0xa084a18)
    at ../../../iocore/cache/CachePart.cc:179
179  

Do you think this is because I'm using a fs-cache? What kind of cache is setup in your environment? 

Also John, do you know what code is it that serializes these objects into the cache in the first place? I'm asking this because the new member I introduced recently (m_capacity_host) seems to be 0 all the time after deserializing from cache. This should be fixed too.

> HTTP Header Host ptr field not set
> ----------------------------------
>
>                 Key: TS-253
>                 URL: https://issues.apache.org/jira/browse/TS-253
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: John Plevyak
>
> I noticed while lookup at cache scan that the host field of URLImpl is not set correctly.
> the m_ptr_host field is 0x0 while the m_len_host is correct (14).
> here is what it looks like:
> $20 = {<HdrHeapObjImpl> = {m_type = 2, m_length = 120, m_obj_flags = 0}, m_len_scheme = 4, 
>   m_len_user = 0, m_len_password = 0, m_len_host = 14, m_len_port = 0, m_len_path = 0, 
>   m_len_params = 27, m_len_query = 0, m_len_fragment = 0, m_len_printed_string = 0, 
>   m_ptr_scheme = 0x0, 
>   m_ptr_user = 0x7ffff2fe9d2f "http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,im"..., m_ptr_password = 0x0, 
>   m_ptr_host = 0x0, 
>   m_ptr_port = 0x7ffff2fe9d36 "www.google.com/intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q"..., m_ptr_path = 0x0, 
>   m_ptr_params = 0x7ffff2fe9d45 "intl/en_ALL/images/logo.gif HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\nAccept: image/png,image/*;q=0.8,*/*;q=0.5\r"..., m_ptr_query = 0x0, 
>   m_ptr_fragment = 0x0, m_ptr_printed_string = 0x0, clean = false, m_scheme_wks_idx = 0, 
>   m_port = 0, m_url_type = 0 '\000', m_type_code = 0 '\000', m_capacity_host = 1}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.