squid_session causing segmentation fault

Bug #805660 reported by Marcelo Terres
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
squid3 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

When I'm using squid_session I'm getting a segmentation fault.

I found the problem in 2 different hardwares, both running Ubuntu 10.04.

Info:

1)root@cache-aca:~# lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

2)root@cache-aca:~# apt-cache policy squid3
squid3:
  Installed: 3.0.STABLE19-1ubuntu0.1
  Candidate: 3.0.STABLE19-1ubuntu0.1
  Version table:
 *** 3.0.STABLE19-1ubuntu0.1 0
        500 http://security.ubuntu.com/ubuntu/ lucid-security/universe Packages
        100 /var/lib/dpkg/status
     3.0.STABLE19-1 0
        500 http://br.archive.ubuntu.com/ubuntu/ lucid/universe Packages

root@cache-aca:~# /usr/lib/squid3/squid_session -t 100 -b /tmp/testing.db
TESTING
Segmentation fault

root@cache-aca:~# strace /usr/lib/squid3/squid_session -t 100 -b /tmp/testing.db
mprotect(0x601000, 4096, PROT_READ) = 0
mprotect(0x7fe09466c000, 4096, PROT_READ) = 0
munmap(0x7fe094665000, 19023) = 0
set_tid_address(0x7fe0946639d0) = 18808
set_robust_list(0x7fe0946639e0, 0x18) = 0
futex(0x7fff01f755bc, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fff01f755bc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7fe094663700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7fe093b45870, [], SA_RESTORER|SA_SIGINFO, 0x7fe093b4f8f0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7fe093b45900, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7fe093b4f8f0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0) = 0x1923000
brk(0x1944000) = 0x1944000
open("/proc/stat", O_RDONLY|O_CLOEXEC) = 3
read(3, "cpu 4720595 226 3674225 1491889"..., 8192) = 834
close(3) = 0
stat("/tmp/testing.db", {st_mode=S_IFREG|0644, st_size=8192, ...}) = 0
open("/tmp/testing.db", O_RDWR) = 3
fcntl(3, F_GETFD) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
read(3, "\0\0\0\0\1\0\0\0\0\0\0\0b1\5\0\t\0\0\0\0\20\0\0\0\t\0\0\0\0\0\0"..., 512) = 512
close(3) = 0
open("DB_CONFIG", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
gettimeofday({1309809219, 364915}, NULL) = 0
gettimeofday({1309809219, 364978}, NULL) = 0
open("/proc/stat", O_RDONLY|O_CLOEXEC) = 3
read(3, "cpu 4720596 226 3674225 1491889"..., 8192) = 834
close(3) = 0
mmap(NULL, 204800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe094630000
open("/tmp/testing.db", O_RDWR|O_CREAT, 0) = 3
fcntl(3, F_GETFD) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=8192, ...}) = 0
pread(3, "\0\0\0\0\1\0\0\0\0\0\0\0b1\5\0\t\0\0\0\0\20\0\0\0\t\0\0\0\0\0\0"..., 4096, 0) = 4096
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe094669000
read(0, Testing
"Testing\n", 1024) = 8
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

Revision history for this message
Amos Jeffries (yadi) wrote :

/tmp is not a safe place to locate an important application data store. Its recommended to use /var/run/squid or /var/cache/squid instead if you require the data to persist long term. If not omit the -b option entirely and the session helper will use a memory cache.

Revision history for this message
Roger Millar (rmgomes123) wrote :
Download full text (5.6 KiB)

I'm getting the same error, too. Even when I omit the "-b" option entirely to force session helper to use a memory cache.

1) LOG in /var/log/messages:
kernel: [695979.392048] squid_session[8400]: segfault at 0 ip b74f0b83 sp bfb61304 error 4 in libc-2.12.1.so[b747c000+157000]

2) root@rogerhost:~#/usr/lib/squid3$ lsb_release -rd
Description: Ubuntu 10.10
Release: 10.10

3) root@rogerhost:~# apt-cache policy squid3
squid3:
  Instalado: 3.1.6-1.1ubuntu1.1
  Candidato: 3.1.6-1.1ubuntu1.1
  Tabela de versão:
 *** 3.1.6-1.1ubuntu1.1 0
        500 http://br.archive.ubuntu.com/ubuntu/ maverick-updates/universe i386 Packages
        500 http://security.ubuntu.com/ubuntu/ maverick-security/universe i386 Packages
        100 /var/lib/dpkg/status
     3.1.6-1.1ubuntu1 0
        500 http://br.archive.ubuntu.com/ubuntu/ maverick/universe i386 Packages

4)root@rogerhost:/usr/lib/squid3# strace ./squid_session -t 3600
execve("./squid_session", ["./squid_session", "-t", "3600"], [/* 20 vars */]) = 0
brk(0) = 0x93d4000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77d2000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=86399, ...}) = 0
mmap2(NULL, 86399, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb77bc000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libdb-4.8.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0pM\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1443868, ...}) = 0
mmap2(NULL, 1446608, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x9ef000
mmap2(0xb4e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15e) = 0xb4e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@n\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1421892, ...}) = 0
mmap2(NULL, 1427880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x267000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x157) = 0x267000
mmap2(0x26a000, 10664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x26a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360L\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=121578, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77bb000
mmap2(NULL, 102920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2d6000
mprotect(0x2eb000, 4096, PROT_NONE) = 0
mmap2(0x2ec000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15...

Read more...

Dave Walker (davewalker)
Changed in squid3 (Ubuntu):
importance: Undecided → High
Changed in squid3 (Ubuntu):
status: New → Confirmed
Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

This seems to have been fixed in an earlier squid release.

Changed in squid3 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.