opnsense / opnsense/plugins

os-squid: Segmentation fault (signal 11) on reload when using tcp_outgoing_address with WireGuard

Open
#5,366 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

support
Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Title:
os-squid: Segmentation fault (signal 11) on reload when using tcp_outgoing_address with WireGuard

Describe the bug
When using the os-squid transparent proxy, adding a tcp_outgoing_address directive mapped to a WireGuard interface IP in custom.conf causes the Squid service to crash with a Segmentation Fault (Signal 11) whenever a soft reload (squid -k reconfigure) is triggered via the GUI or CLI.

Because the reload command crashes natively, the OPNsense background script aborts, leaving zombie Squid processes running and preventing the service from restarting cleanly without a manual pkill -9 squid. This setup worked flawlessly prior to the OPNsense 26.1 update. Removing the tcp_outgoing_address directive completely resolves the segfaults during system reloads. Furthermore, a clean start (service squid start) works perfectly with the directive included; the crash is strictly limited to reloads.

To Reproduce
Steps to reproduce the behavior:

  1. Configure and enable a WireGuard interface with a designated IP.
  2. Enable os-squid in transparent proxy mode.
  3. Add tcp_outgoing_address [WireGuard_IP] to the Squid custom.conf.
  4. Start the Squid service (starts normally without crashing).
  5. Trigger a configuration reload (e.g., click "Apply" in the Squid GUI, or run /usr/local/etc/rc.d/squid reload via CLI).
  6. Observe the immediate Segmentation fault in the shell or system logs.

Expected behavior
Squid should gracefully re-evaluate its configuration and re-bind to the interface without throwing a memory access violation. Alternatively, if this is an upstream FreeBSD/Squid socket bug, OPNsense should forcefully execute a restart instead of a reload upon configuration changes to prevent the service from crashing and leaving zombie processes.

Screenshots
Not applicable.

Relevant log files
In the OPNsense system logs:
<6>[958908] pid 13409 (squid), jid 0, uid 100: exited on signal 11 (no core dump - bad address)

When running the reload manually via CLI:
root@opnsense:~ # /usr/local/etc/rc.d/squid reload
Segmentation fault

Additional context
We verified this is tied specifically to the reload command combined with tcp_outgoing_address. Attempting to map the directive to a static dummy Virtual IP (loopback lo1) instead of WireGuard resulted in the exact same Segmentation Fault upon reload, isolating the issue to Squid's socket re-binding behavior during a soft reconfigure in this specific build.

Environment
OPNsense 26.1.4 (amd64)
os-squid / Squid Cache Version 6.14 (amd64-portbld-freebsd14.3)
OpenSSL 3.0.19 27 Jan 2026
Intel e3-1585 v5
Intel X710-DA2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using custom.conf with tcp_outgoing_address, then compare squid -k reconfigure with /usr/local/etc/rc.d/squid reload and review the reported system-log signal 11. Done means configuration reload no longer segfaults, leaves zombie Squid processes, or requires pkill -9 squid.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.