Bug 224434 - www/squid-devel Crash when rotating logs
Summary: www/squid-devel Crash when rotating logs
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Luca Pizzamiglio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-18 20:31 UTC by OlivierW
Modified: 2019-04-24 09:59 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (timp87)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OlivierW 2017-12-18 20:31:10 UTC
Hello,

I've just upgraded from www/squid 3.5.27_1 to www/squid-devel 4.0.22.
Everything seems to works well except when "rotating logs".

Well, in fact I don't need to really rotate logs, I just have to use "squid -k rotate" or "kill -USR1 <squid-pid>" (from http://www.squid-cache.org/Doc/config/logfile_rotate/ ) and Squid will crash leaving:
"Dec 18 19:59:01 host kernel: pid 7965 (squid), uid 100: exited on signal 6 (core dumped)
Dec 18 19:59:01 host squid[2003]: Squid Parent: (squid-1) process 7965 exited due to signal 6 with status 0
Dec 18 19:59:01 host squid[2003]: Squid Parent: (squid-1) process 52870 started"
in /var/log/messages and I am getting a coredump.

Anyway, Squid continues to work, so users don't see anything.

I've recompiled Squid with DEBUG=on and with gdb on the coredump file I am getting:
"# gdb /tmp/debug-squid/usr/local/sbin/squid squid-debug.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `(squid-1) -f /usr/local/etc/squid/squid.conf'.
Program terminated with signal 6, Aborted.
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /lib/libcrypt.so.5...done.
Loaded symbols for /lib/libcrypt.so.5
Reading symbols from /usr/local/lib/libcrypto.so.42...done.
Loaded symbols for /usr/local/lib/libcrypto.so.42
Reading symbols from /usr/local/lib/libssl.so.44...done.
Loaded symbols for /usr/local/lib/libssl.so.44
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libpcreposix.so.0...done.
Loaded symbols for /usr/local/lib/libpcreposix.so.0
Reading symbols from /usr/local/lib/libpcre.so.1...done.
Loaded symbols for /usr/local/lib/libpcre.so.1
Reading symbols from /usr/lib/libc++.so.1...done.
Loaded symbols for /usr/lib/libc++.so.1
Reading symbols from /lib/libcxxrt.so.1...done.
Loaded symbols for /lib/libcxxrt.so.1
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000802bcf84a in thr_kill () from /lib/libc.so.7
(gdb) backtrace
#0  0x0000000802bcf84a in thr_kill () from /lib/libc.so.7
#1  0x0000000802bcf814 in raise () from /lib/libc.so.7
#2  0x0000000802bcf789 in abort () from /lib/libc.so.7
#3  0x000000000067864e in xassert (msg=0xbce0ef "!isOpen(conn->fd)", file=0xbcd763 "comm.cc", line=428) at debug.cc:611
warning: (Internal error: pc 0x9294c3 in read in psymtab, but not in symtab.)

#4  0x00000000009294c4 in comm_init_opened () at comm.cc:428
warning: (Internal error: pc 0x9294c3 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x928edc in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x928edc in read in psymtab, but not in symtab.)

#5  0x0000000000928edd in comm_openex () at comm.cc:403
warning: (Internal error: pc 0x928edc in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x92842e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x92842e in read in psymtab, but not in symtab.)

#6  0x000000000092842f in comm_open () at comm.cc:230
warning: (Internal error: pc 0x92842e in read in psymtab, but not in symtab.)

#7  0x0000000000744764 in ipcCreate (type=2, prog=0x80caca5a0 "/usr/local/libexec/squid/pinger", args=0x7fffffffe6a0, name=0xbdc67d "Pinger Socket",
    local_addr=@0x7fffffffe678, rfd=0x7fffffffe69c, wfd=0x7fffffffe698, hIpc=0x1052198) at ipc.cc:111
#8  0x0000000000ac1645 in IcmpSquid::Open (this=0x1050130) at IcmpSquid.cc:213
#9  0x000000000074e061 in mainRotate () at main.cc:1035
#10 0x000000000074dcd6 in SignalEngine::checkEvents (this=0x7fffffffea00) at main.cc:245
#11 0x00000000006abcc8 in EventLoop::checkEngine (this=0x7fffffffea08, engine=0x7fffffffea00, primary=false) at EventLoop.cc:34
#12 0x00000000006ac2d2 in EventLoop::runOnce (this=0x7fffffffea08) at EventLoop.cc:105
#13 0x00000000006ac0a0 in EventLoop::run (this=0x7fffffffea08) at EventLoop.cc:83
#14 0x000000000074f1cb in SquidMain (argc=3, argv=0x7fffffffebd8) at main.cc:1704
#15 0x000000000074e6ec in SquidMainSafe (argc=3, argv=0x7fffffffebd8) at main.cc:1415
#16 0x000000000074e6b2 in main (argc=3, argv=0x7fffffffebd8) at main.cc:1403
(gdb)"

It crashes here: https://github.com/squid-cache/squid/blob/v4.0/src/comm.cc#L428 but now I don't know what else to try.

I am running Squid 4 on NanoBSD 11.1-RELEASE-p6, so I don't know if this bug is present on a "normal" FreeBSD or Linux.
My Squid is compiled with security/libressl-devel 2.6.3.

In my Squid's config file, I have "logfile_rotate 0" because I am managing the rotation with newsyslog.

Can someone try "squid -k rotate" or "kill -USR1 <squid-pid>" to see if it can be reproduced?


I've just tried again with www/squid 3.5.27_1 and it doesn't crash at all (exact same configuration, only difference is the Squid version).

Best Regards,
Olivier
Comment 1 OlivierW 2017-12-19 19:46:56 UTC
Hello,

I've just compiled a previous version of squid-devel, version 4.0.19 (revision 438126) and I am not getting the crash.

I'll now try the others versions between 4.0.19 and 4.0.22 to try to find the one which broke the functionality.

Best Regards,
Olivier
Comment 2 OlivierW 2017-12-19 23:06:21 UTC
So, my previous test with 4.0.19 was compiled against OpenSSL from base (to be sure there was no problem somehow related to LibreSSL).

I've tested 4.0.20 (rev 443022) and 4.0.21_1 (rev 449591), also compiled with OpenSSL from base and they both works without any coredump while rotating logs.

I've also now just tested again 4.0.22, this time linked with OpenSSL from base and by disabling the new PCRE option. And, like in my first report, it does crash with "squid -k rotate" or "kill -USR1 <squid-pid>".

Tomorrow I'll report the bug upstream and I'll let you know here.
Comment 3 OlivierW 2017-12-20 11:40:32 UTC
My bug report on Squid's Bugzilla: https://bugs.squid-cache.org/show_bug.cgi?id=4796
Comment 4 timp87 2018-02-26 19:07:37 UTC
Hi! I'm so sorry for such late reply.
Yes, it's better to report such bugs upstream as I'm just maintaining the port and not a squid developer.
Comment 5 timp87 2019-01-09 07:23:03 UTC
I suppose this PR can be closed as there is no www/squid-devel anymore.
I'd suggest the reporter to check the problem against latest www/squid and recreate PR with link to the right port
Comment 6 Luca Pizzamiglio freebsd_committer 2019-04-18 14:06:25 UTC
Closing this bug, because www/squid-devel is moved to www/squid
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-24 09:59:03 UTC
Correct resolution, FIXED is used for issues resolved by a change (eg: commit)

@Olivier If the same issue can be reproduced in www/squid using an update to date ports tree, please re-open this issue (and update the summary) instead of creating a new one

With hat: triage (assign to committer that resolved)