Squid webproxy crashing in fresh install on RPi3 Model B

Noticed squid proxy kept crashing when I tried using it after enabling it. So in order to investigate I ran it from the shell like:

[root@ipfire]# squid -d 5 --foreground

It gives the following error:

2022/09/11 00:48:36| WARNING: BCP 177 violation. Detected non-functional IPv6 loopback.
2022/09/11 00:48:36| ERROR: setrlimit: RLIMIT_NOFILE: (1) Operation not permitted
2022/09/11 00:48:37 kid1| WARNING: BCP 177 violation. Detected non-functional IPv6 loopback.
2022/09/11 00:48:37 kid1| ERROR: setrlimit: RLIMIT_NOFILE: (1) Operation not permitted
2022/09/11 00:48:37 kid1| Current Directory is /root/.ssh
2022/09/11 00:48:37 kid1| Starting Squid Cache version 5.6 for aarch64-unknown-linux-gnu...
2022/09/11 00:48:37 kid1| Service Name: squid
2022/09/11 00:48:37 kid1| Process ID 5304
2022/09/11 00:48:37 kid1| Process Roles: worker
2022/09/11 00:48:37 kid1| NOTICE: Could not increase the number of filedescriptors
2022/09/11 00:48:37 kid1| With 4096 file descriptors available
2022/09/11 00:48:37 kid1| Initializing IP Cache...
2022/09/11 00:48:37 kid1| DNS Socket created at 0.0.0.0, FD 7
2022/09/11 00:48:37 kid1| Adding domain localdomain from /etc/resolv.conf
2022/09/11 00:48:37 kid1| Adding nameserver 127.0.0.1 from /etc/resolv.conf
2022/09/11 00:48:37 kid1| Logfile: opening log /dev/null
2022/09/11 00:48:37 kid1| WARNING: log name now starts with a module name. Use 'stdio:/dev/null'
2022/09/11 00:48:37 kid1| Store logging disabled
2022/09/11 00:48:37 kid1| Swap maxSize 0 + 131072 KB, estimated 10082 objects
2022/09/11 00:48:37 kid1| Target number of buckets: 504
2022/09/11 00:48:37 kid1| Using 8192 Store buckets
2022/09/11 00:48:37 kid1| Max Mem  size: 131072 KB
2022/09/11 00:48:37 kid1| Max Swap size: 0 KB
2022/09/11 00:48:37 kid1| Using Least Load store dir selection
2022/09/11 00:48:37 kid1| Current Directory is /root/.ssh
2022/09/11 00:48:37 kid1| Finished loading MIME types and icons.
2022/09/11 00:48:37 kid1| HTCP Disabled.
2022/09/11 00:48:37 kid1| Squid plugin modules loaded: 0
2022/09/11 00:48:37 kid1| Adaptation support is off.
2022/09/11 00:48:37 kid1| Accepting HTTP Socket connections at conn2 local=192.168.1.1:800 remote=[::] FD 9 flags=9
2022/09/11 00:48:38 kid1| storeLateRelease: released 0 objects
*** stack smashing detected ***: terminated

This message can be ignored as per this post https://community.ipfire.org/t/squid-web-proxy-started-with-2-errors/1085/2

This message suggests that there is an error in the squid.conf file. The entry for the access_log should read as
access_log stdio:/var/log/squid/access.log
The first line suggests that the conf file is set up to log to /dev/null.
What logging entry do you have in the /etc/squid/squid.conf file.

Do you have logging enabled on the Proxy WUI page.

The squid.conf file should not be manually edited as it is controlled by the data on the Proxy WUI page. If it has not been edited then possibly the squid.conf file has got corrupted or confused.
The simplest in that case would be to re-install.

This indicates that some form of buffer overflow occurred. As the program is compiled with the stack protector enabled then a stack smash detected causes the program to stop. Without that stack protection it would be likely that a segmentation fault in the kernel could occur.

Not sure if the logging error could cause the stack smash. I did find an entry about stack smashing related to stdio, as per the reference in your output from starting squid.

Maybe you could show a screenshot of your proxy WUI page and the squid.conf entries.

I just did a test on my system and disabled the web proxy and ran the manual command you used and you get the

message when you don’t have logging enabled on the Web Proxy WUI page.

I got all the messages you showed except for the stack smashing message. So it looks like somehow or other something is trying to write to a protected stack location and causing the program to terminate.

Here is the output from my squid -d 5 --foreground command

2022/09/10 23:50:24| WARNING: BCP 177 violation. Detected non-functional IPv6 loopback.
2022/09/10 23:50:24| ERROR: setrlimit: RLIMIT_NOFILE: (1) Operation not permitted
2022/09/10 23:50:25 kid1| WARNING: BCP 177 violation. Detected non-functional IPv6 loopback.
2022/09/10 23:50:25 kid1| ERROR: setrlimit: RLIMIT_NOFILE: (1) Operation not permitted
2022/09/10 23:50:25 kid1| Current Directory is /home/xxx
2022/09/10 23:50:25 kid1| Starting Squid Cache version 5.6 for x86_64-pc-linux-gnu…
2022/09/10 23:50:25 kid1| Service Name: squid
2022/09/10 23:50:25 kid1| Process ID 9588
2022/09/10 23:50:25 kid1| Process Roles: worker
2022/09/10 23:50:25 kid1| NOTICE: Could not increase the number of filedescriptors
2022/09/10 23:50:25 kid1| With 4096 file descriptors available
2022/09/10 23:50:25 kid1| Initializing IP Cache…
2022/09/10 23:50:25 kid1| DNS Socket created at 0.0.0.0, FD 7
2022/09/10 23:50:25 kid1| Adding domain xxxx.org from /etc/resolv.conf
2022/09/10 23:50:25 kid1| Adding nameserver 127.0.0.1 from /etc/resolv.conf
2022/09/10 23:50:25 kid1| helperOpenServers: Starting 2/10 ‘asnbl-helper.py’ processes
2022/09/10 23:50:25 kid1| Logfile: opening log stdio:/var/log/squid/access.log
2022/09/10 23:50:25 kid1| Store logging disabled
2022/09/10 23:50:25 kid1| Swap maxSize 0 + 204800 KB, estimated 15753 objects
2022/09/10 23:50:25 kid1| Target number of buckets: 787
2022/09/10 23:50:25 kid1| Using 8192 Store buckets
2022/09/10 23:50:25 kid1| Max Mem size: 204800 KB
2022/09/10 23:50:25 kid1| Max Swap size: 0 KB
2022/09/10 23:50:25 kid1| Using Least Load store dir selection
2022/09/10 23:50:25 kid1| Current Directory is /home/xxx
2022/09/10 23:50:25 kid1| Finished loading MIME types and icons.
2022/09/10 23:50:25 kid1| HTCP Disabled.
2022/09/10 23:50:25 kid1| Squid plugin modules loaded: 0
2022/09/10 23:50:25 kid1| Adaptation support is off.
2022/09/10 23:50:25 kid1| Accepting HTTP Socket connections at conn10 local=192.168.26.254:800 remote=[::] FD 13 flags=9
2022/09/10 23:50:26 kid1| storeLateRelease: released 0 objects

and then squid was running.

The only additional line that I see in my log output is

2022/09/10 23:50:25 kid1| helperOpenServers: Starting 2/10 ‘asnbl-helper.py’ processes

which doesn’t show up in your log output but I don’t have any idea why that makes that show up or not and also no idea if that could have a relation to the stack smashing, which is what is causing your squid service to stop.

As it was a fresh install, I would suggest repeating the install and seeing if the problem re-occurs.

Ipfire webproxy page:

/etc/squid/squid.conf:

Hi @vectorspace
I forgot to welcome you to the community so welcome to the IPFire community.

One point to make. It would be better to copy and paste the squid.conf text into the forum. As a pastebin item, it will disappear so in the future other people with a similar problem will not be able to access some of the info.
As a new user I can understand that you are not yet allowed to upload an image. After some posts your abilities to upload stuff will be relaxed by the forum system.

Looking at your Web Proxy WUI (Web User Interface) page and the conf file you have logging enabled on the WUI but it is not enabled in the squid.conf file.
The max cache object size in the wui is set at 4096 while in the conf file it is 2621.
There looks to be a mismatch between the WUI page and the configuration file.

If you press the Save button at the bottom of the Web Proxy WUI page are the logging lines and the max object size entries in the squid.conf file updated?

If yes, then what happens when you press the Save and Restart button. Does the Web Proxy then show up as running on the WUI Status - Services page or as stopped?