oschaaf commented on issue #1556: Combined css returns truncated, mis-encoded 
body on cache hit
URL: 
https://github.com/apache/incubator-pagespeed-ngx/issues/1556#issuecomment-391046316
 
 
   I've been searching for code that messes up consistency, but no luck so far..
   
   You can see the effect of the patched version here on a combination.. 
http://35.187.191.47/A.store.css+vendor.css,Mcc.00EaqUIgkT.css.pagespeed.cf.tuzrpz_-Py.css
   (and also observe the resulting alternating response, but at least there is 
no bad content-length and no content-encoding mismatch).
   
   Also, I had the backtrace for when the content-length 7411 is written to the 
cache in notepad here.
   7411 is interesting because that shows when the combination output is 
written (uncompressed, with an actual larger body size, and actually not 
gzipped but the headers do say so).
   
   At the point when it's written to cache it seems consistent and OK to me:
   
   ```
   (gdb) bt
   #0  net_instaweb::Headers<net_instaweb::HttpResponseHeaders>::Add 
(this=0x7ffff2034d50, name=..., value=...) at 
pagespeed/kernel/http/headers.cc:309
   #1  0x00000000007ceed4 in 
net_instaweb::Headers<net_instaweb::HttpResponseHeaders>::Replace 
(this=0x7ffff2034d50, name=..., value=...) at 
pagespeed/kernel/http/headers.cc:575
   #2  0x00000000007dddb6 in net_instaweb::ResponseHeaders::SetContentLength 
(this=0x7ffff2034d50, content_length=7411) at 
pagespeed/kernel/http/response_headers.cc:531
   #3  0x000000000070dc6b in net_instaweb::InflatingFetch::GzipValue 
(compression_level=9, http_value=..., compressed_value=0x7ffff2034c50, 
headers=0x7ffff2034d50, handler=0x1a22d68) at 
net/instaweb/http/inflating_fetch.cc:158
   #4  0x000000000070639e in net_instaweb::HTTPCache::PutInternal 
(this=0x188f018, preserve_response_headers=false, 
key="http://localhost/store.css+vendor.css.pagespeed.cc.iKEaqUIgkT.css";, 
fragment="localhost", start_us=1526930452779889, value=0x7fffe4028e38, 
       response_headers=0x7ffff2034d50, handler=0x1a22d68) at 
net/instaweb/http/http_cache.cc:433
   #5  0x0000000000706979 in net_instaweb::HTTPCache::Put (this=0x188f018, 
key="http://localhost/store.css+vendor.css.pagespeed.cc.iKEaqUIgkT.css";, 
fragment="localhost", req_properties=..., http_options=..., 
value=0x7fffe400b550, handler=0x1a22d68)
       at net/instaweb/http/http_cache.cc:495
   #6  0x00000000005d4c82 in net_instaweb::RewriteDriver::Write 
(this=0x1a29708, inputs=std::vector of length 2, capacity 2 = {...}, 
contents=..., type=0x17723c0 <net_instaweb::(anonymous namespace)::kTypes+96>, 
charset=..., output=0x7fffe400b528)
       at net/instaweb/rewriter/rewrite_driver.cc:3362
   #7  0x0000000000b3fb81 in net_instaweb::ResourceCombiner::WriteCombination 
(this=0x7fffe4008648, combine_resources=std::vector of length 2, capacity 2 = 
{...}, combination=..., handler=0x1a22d68) at 
net/instaweb/rewriter/resource_combiner.cc:288
   #8  0x000000000066e821 in net_instaweb::CssCombineFilter::CssCombiner::Write 
(this=0x7fffe4008648, in=std::vector of length 2, capacity 2 = {...}, out=...) 
at net/instaweb/rewriter/css_combine_filter.cc:123
   #9  0x000000000066f0d1 in net_instaweb::CssCombineFilter::Context::Rewrite 
(this=0x7fffe40084c8, partition_index=0, partition=0x7fffe4008c28, output=...) 
at net/instaweb/rewriter/css_combine_filter.cc:266
   #10 0x0000000000b5690c in 
net_instaweb::RewriteContext::InvokeRewriteFunction::Run (this=0x7fffe4008858) 
at net/instaweb/rewriter/rewrite_context.cc:958
   #11 0x0000000000725d8c in net_instaweb::Function::CallRun 
(this=0x7fffe4008858) at pagespeed/kernel/base/function.cc:51
   #12 0x00000000008a75c8 in net_instaweb::QueuedWorkerPool::Run 
(this=0x1a06058, sequence=0x1a278a8, worker=0x1a2e0e8) at 
pagespeed/kernel/thread/queued_worker_pool.cc:157
   #13 0x00000000008ad5cc in 
net_instaweb::MemberFunction2<net_instaweb::QueuedWorkerPool, 
net_instaweb::QueuedWorkerPool::Sequence*, net_instaweb::QueuedWorker*>::Run 
(this=0x7fffe0031e78) at ./pagespeed/kernel/base/function.h:202
   #14 0x0000000000725d8c in net_instaweb::Function::CallRun 
(this=0x7fffe0031e78) at pagespeed/kernel/base/function.cc:51
   #15 0x00000000008b3b64 in net_instaweb::Worker::WorkThread::Run 
(this=0x1a2e118) at pagespeed/kernel/thread/worker.cc:85
   #16 0x00000000008b6ffc in net_instaweb::PthreadThreadImpl::InvokeRun 
(self_ptr=0x1a2dcf8) at pagespeed/kernel/thread/pthread_thread_system.cc:121
   #17 0x00007ffff79bd6ba in start_thread (arg=0x7ffff2036700) at 
pthread_create.c:333
   #18 0x00007ffff638341d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:109
   (gdb) f 3
   #3  0x000000000070dc6b in net_instaweb::InflatingFetch::GzipValue 
(compression_level=9, http_value=..., compressed_value=0x7ffff2034c50, 
headers=0x7ffff2034d50, handler=0x1a22d68) at 
net/instaweb/http/inflating_fetch.cc:158
   158         headers->SetContentLength(deflated.length());
   (gdb) p deflated
   $4 = 
"\037\213\b\000\000\000\000\000\002\003\325=is\333F\226\337\371+\260V\251\306Έ0\t\222\272\\q\255\255$\023W\331\023W\234L>\244\262,\220l\211X\203\000\027\000-+\256\374\367\355\v\350\353u\243\001B\231L\016Y\006\032\257\357w\037Ͽ\n~\212W)\252\202\257\236\217\376{\207\066I\034<\335ş\307\367ɦ\332^\a\323\350r\262\377\374,\370\062\n\202\223\262\312\v\364\066_\307\370\317\367\361\035\nN\366\344\347\313
 
,\362{\332$\b\366\361f\223dw\327\301$\210\360\227/\350\303U\376y\\&\277\323竼ؠb\214\037\275\b\376\b\376\030\215\236\177\025\274\313WI\212,C\270\\8F\260\235\362~",
 <incomplete sequence \364>...
   (gdb) p deflated.length()
   $5 = 7411
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to