zakkymuha / lusca-cache

Automatically exported from code.google.com/p/lusca-cache
0 stars 0 forks source link

Segment Violation #86

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Unsure

What is the expected output? What do you see instead?

FATAL: Received Segment Violation...dying.
2010/03/01 13:47:42| storeDirWriteCleanLogs: Starting...
2010/03/01 13:47:42| WARNING: Closing open FD    9
2010/03/01 13:47:42| commSetEvents: epoll_ctl(EPOLL_CTL_DEL): failed on fd=9: 
(1) Operation 
not permitted
2010/03/01 13:47:42| WARNING: Closing open FD   27
2010/03/01 13:47:42| commSetEvents: epoll_ctl(EPOLL_CTL_DEL): failed on fd=27: 
(1) 
Operation not permitted
2010/03/01 13:47:42| WARNING: Closing open FD   29
2010/03/01 13:47:42| commSetEvents: epoll_ctl(EPOLL_CTL_DEL): failed on fd=29: 
(1) 
Operation not permitted
2010/03/01 13:47:42|   Finished.  Wrote 12874 entries.
2010/03/01 13:47:42|   Took 0.0 seconds (266024.7 entries/sec).
CPU Usage: 354.986 seconds = 152.658 user + 202.329 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 42
Memory usage for squid via mallinfo():
        total space in arena:  481496 KB
        Ordinary blocks:       473516 KB   3621 blks
        Small blocks:               0 KB     12 blks
        Holding blocks:        166388 KB     13 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:    7979 KB
        Total in use:          639904 KB 99%
        Total free:              7980 KB 1%

What version of the product are you using? On what operating system?
14428 Debian testing adm64

Please provide any additional information below.
I will provide a coredump the next time this happens.

Original issue reported on code.google.com by kris%amy...@gtempaccount.com on 1 Mar 2010 at 4:48

GoogleCodeExporter commented 9 years ago
Core dumped again..

# gdb /usr/local/squid/sbin/squid core201003021205 
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/squid/sbin/squid...done.
[New Thread 13595]
[New Thread 13600]
[New Thread 13575]
[New Thread 13576]
[New Thread 13577]
[New Thread 13578]
[New Thread 13579]
[New Thread 13580]
[New Thread 13581]
[New Thread 13582]
[New Thread 13583]
[New Thread 13584]
[New Thread 13585]
[New Thread 13586]
[New Thread 13587]
[New Thread 13588]
[New Thread 13589]
[New Thread 13590]
[New Thread 13591]
[New Thread 13592]
[New Thread 13593]
[New Thread 13594]
[New Thread 13596]
[New Thread 13597]
[New Thread 13598]
[New Thread 13599]

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libnss_files.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_compat.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /lib/libnss_nis.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libnss_nis.so.2
Core was generated by `(squid) -DF'.
Program terminated with signal 6, Aborted.
#0  0x00007f4a45cddf55 in raise () from /lib/libc.so.6

Original comment by kris%amy...@gtempaccount.com on 2 Mar 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Grr. Speaking directly with Kris, this is due to the 
anti-storeuri-redirection-loop code committed recently.

I'll just disable it now for the time being until I can figure out a nicer way 
of doing it.

Original comment by adrian.c...@gmail.com on 2 Mar 2010 at 3:52

GoogleCodeExporter commented 9 years ago
Program terminated with signal 6, Aborted.
#0  0x00007f4a45cddf55 in *__GI_raise (sig=13572) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:60
60      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007f4a45cddf55 in *__GI_raise (sig=13572) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:60
#1  0x00007f4a45ce0d90 in *__GI_abort () at abort.c:90
#2  0x000000000046ea7c in death (sig=<value optimized out>) at tools.c:321
#3  <signal handler called>
#4  strcmp () at ../sysdeps/x86_64/strcmp.S:30
#5  0x0000000000424c5e in clientCacheHit (data=0x2a00c048, rep=<value optimized 
out>) at 
client_side.c:1275
#6  0x0000000000465181 in storeClientCopyHeadersCB (data=0x24c6c198, nr=..., 
size=1009) at 
store_client.c:971
#7  0x0000000000465280 in storeClientCallback (sc=0x24c6c198, sz=1009) at 
store_client.c:267
#8  0x0000000000465de1 in storeClientReadHeader (data=0x24c6c198, 
buf_unused=<value optimized 
out>, len=1179) at store_client.c:740
#9  0x000000000047d6cd in storeCossCompleteReadOp (cs=0x12b0ec0, op=0x287a85c0, 
error=790013460) at coss/store_io_coss.c:1209
#10 0x000000000047f0d2 in storeCossCompletePendingReloc (fd=<value optimized 
out>, 
my_data=0x2ab1c858, buf=<value optimized out>, aio_return=<value optimized 
out>, aio_errno=<value 
optimized out>) at coss/store_io_coss.c:1129
#11 0x000000000048546a in aioCheckCallbacks () at async_io.c:450
#12 0x0000000000484cdb in squidaio_fdhandler (fd=10, data=<value optimized 
out>) at aiops.c:153
#13 0x000000000049aac5 in comm_call_handlers (msec=<value optimized out>) at 
comm_generic.c:264
#14 do_comm_select (msec=<value optimized out>) at comm_epoll.c:233
#15 comm_select (msec=<value optimized out>) at comm_generic.c:384
#16 0x0000000000449db2 in main (argc=<value optimized out>, argv=<value 
optimized out>) at 
main.c:914
(gdb) frame 6
#6  0x0000000000465181 in storeClientCopyHeadersCB (data=0x24c6c198, nr=..., 
size=1009) at 
store_client.c:971
971         cb(cbdata, sc->entry->mem_obj->reply);
(gdb) frame 5
#5  0x0000000000424c5e in clientCacheHit (data=0x2a00c048, rep=<value optimized 
out>) at 
client_side.c:1275
1275            if (!strcmp(http->uri, 
httpHeaderGetStr(&e->mem_obj->reply->header, HDR_LOCATION))) {
(gdb) print http->uri
Cannot access memory at address 0x40
(gdb) 

Original comment by kris%amy...@gtempaccount.com on 2 Mar 2010 at 4:04

GoogleCodeExporter commented 9 years ago
I am also getting segfault, even after applying r14440 
Will try to get core and backtrace

Original comment by nuclear...@gmail.com on 3 Mar 2010 at 10:41

GoogleCodeExporter commented 9 years ago
Discard. Seems it was not actually new binary. Sorry for noise.

Original comment by nuclear...@gmail.com on 3 Mar 2010 at 11:33

GoogleCodeExporter commented 9 years ago
http status 300 has no HDR_LOCATION

attached patch should fix.

Original comment by chudy.fernandez on 10 Mar 2010 at 11:39

Attachments:

GoogleCodeExporter commented 9 years ago
I'm encountering this bug frequently since upgrading from Squid-2.7.STABLE7 to 
STABLE8. I've always used 
the Youtube Redirect patch from:
 * http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube

In reply to comment 6 (above) - it's worth noting that the original version of 
the redirect detection 
code is only reached if the reply status == HTTP_MOVED_TEMPORARILY (302) - 
which as I understand should 
*always* include a Location header.

Is this bug possibly something to do with the increasing length of certain 
Youtube URLs. 

I can provide any other information that might be helpful and I intend to try 
Chudy's patch and will 
report on its success.

{{{
gdb squid core-squid-3071-1270565707
(gdb) backtrace
#0  0x0815b3a1 in raise ()
#1  0x08112d93 in abort ()
#2  0x080d19ff in death (sig=11) at tools.c:329
#3  <signal handler called>
#4  0x08125c14 in strcmp ()
#5  0x0806d34b in clientCacheHit (data=0x29e6a718, rep=0x21188b58) at 
client_side.c:2407
#6  0x080c9192 in storeClientCallback (sc=<value optimized out>, sz=471) at 
store_client.c:146
#7  0x080c94ff in storeClientCopy2 (e=0xf497f30, sc=0xded3b98) at 
store_client.c:262
#8  0x08063e54 in storeClientCopyHeaders (sc=0xded3b98, e=0xf497f30, 
callback=0x806cae0 <clientCacheHit>, 
callback_data=0x29e6a718) at client_side.c:193
#9  0x080665b5 in clientProcessRequest (http=0x29e6a718) at client_side.c:3567
#10 0x080c6711 in storeLocateVaryCallback (state=0x26ed1dd8) at store.c:821
#11 0x080c9192 in storeClientCallback (sc=<value optimized out>, sz=0) at 
store_client.c:146
#12 0x080c94ff in storeClientCopy2 (e=0x12711360, sc=0x11ab0218) at 
store_client.c:262
#13 0x0807a4c8 in eventRun () at event.c:148
#14 0x080a4898 in main (argc=4, argv=0xbfed7f34) at main.c:858
}}}

Original comment by arew...@googlemail.com on 8 Apr 2010 at 11:27

GoogleCodeExporter commented 9 years ago
Howdy!

Are you running Squid or Lusca?

Original comment by adrian.c...@gmail.com on 8 Apr 2010 at 11:58

GoogleCodeExporter commented 9 years ago
Hi Adrian. 

I'm using Squid, but I thought you might be interested to know that the same 
problem 
occurs in Squid. I do intend to try Lusca when I get a chance.

Original comment by arew...@googlemail.com on 8 Apr 2010 at 12:41

GoogleCodeExporter commented 9 years ago
I backed out the change from Lusca because it does cause crashes in specific 
cases
where URLs aren't included in the request structure somewhere.

I'll leave it out of Lusca until I figure out why and fix it.

Thanks though!

Original comment by adrian.c...@gmail.com on 8 Apr 2010 at 1:07

GoogleCodeExporter commented 9 years ago
Adrian, Chudy,

Unfortunately, I haven't been able to test with Lusca yet, but I can confirm 
that 
Chudy's patch (above) does fix the issue when applied (manually) to 
Squid-2.7.STABLE9

I used the attached Twisted Web RPY file to trigger the error. I request the 
rpy file 
using curl and get an initial MISS. I request it again and Squid crashes 
immediately 
with the back trace reported above.

{{{
# Run web server
sudo twistd -n web --path . --port 80

# Request resource
curl -v --get -x http://192.168.1.99:800 "http://dev5/youtube.rpy?id=14"  > 
/dev/null
}}}

When I patch Squid with Chudy's patch Squid no longer crashes and when I 
uncomment 
the Location header, Squid logs:

{{{
clientCacheHit: Redirect Loop Detected: http://dev5/youtube.rpy?id=14
}}}

Original comment by arew...@googlemail.com on 12 Apr 2010 at 4:45

Attachments: