4

OS: Oracle Solaris 11.3.1.5.2, CPU Arch : X86

I recently installed Squid by doing

$ pkg install squid

This went fine:

root@darwin1:~# pkg info squid
          Name: web/proxy/squid
       Summary: Squid Web Proxy Cache
   Description: Squid is a caching proxy for the Web supporting HTTP, HTTPS,
                FTP, and more.
      Category: Web Services/Application and Web Servers
         State: Installed
     Publisher: solaris
       Version: 3.5.5
 Build Release: 5.11
        Branch: 0.175.3.0.0.30.0
Packaging Date: Fri Aug 21 17:30:06 2015
          Size: 51.84 MB
          FMRI: pkg://solaris/web/proxy/squid@3.5.5,5.11-0.175.3.0.0.30.0:20150821T173006Z

but I cannot run Squid:

root@darwin1:~# /usr/squid/sbin/squid -h
Illegal Instruction (core dumped)

The file command gives me this:

root@darwin1:~# file /usr/squid/sbin/squid
/usr/squid/sbin/squid:  ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped

I'm inside a local (non-kernel) zone. It shouldn't matter, should it?

Why the core dump?

7

Sorry, I think I've found the answer myself: http://wiki.squid-cache.org/KnowledgeBase/IllegalInstructionError.

(quote begin)

Illegal Instruction errors on Squid 3.4

Synopsis Squid 3.4 and later, running on certain paravirtualized systems and even some claiming full virtualization (at least KVM, Xen, and Xen derivatives are confirmed so far) crashes with an illegal instruction error soon after startup.

Symptoms

Squid crashes with Illegal Instruction error immediately after startup on a virtual machine on Intel-compatible processors

Explanation

The Squid build system uses by default the -march=native gcc option to optimize the resulting binary. Unfortunately certain (para-)virtualization systems don't support the whole instruction set they advertise. The compiler doesn't know, and generates instructions which trigger this error.

Workaround

These optimizations are helpful but not necessary to have a fully functional squid, especially on ia64/amd64 platforms. The detected defaults can be overridden by supplying the --disable-arch-native option to the configure script.

(quote end)

We're running Solaris inside VMware ESXi 6.0. So I guess that's the reason.

I won't delete my own question on the odd chance that someone else will run into this too.

1
  • BTW, answering your own question is acceptable and even encouraged on SE.
    – NieDzejkob
    Jul 6 '17 at 12:45
2

Customers with Oracle Support contracts can get a version of squid compiled with the -march=native flag disabled in Solaris 11.3 SRU 17 (11.3.17.5.0) from the /support repo. This includes the fixes for:

  • Bug 22051233 - squid falls over immediately on AMD processor
  • Bug 22380085 - Squid Illegal instruction occurs when running inside VM
1
  • Thanks. That is relevant. However, this is a PoC machine so we're not paying for support.
    – peterh
    Jul 6 '17 at 17:59
0

I had the same problem with Solaris 11.3. Every time I would start the Squid service it would go into maintenance mode (you can check using svcs -a | grep squid):

maintenance    21:17:13 svc:/network/http:squid

In the logs (/var/svc/log/network-http:squid.log) I would get the coredump error line:

/lib/svc/method/http-squid: line 23: 1833: Illegal instruction(coredump)

Line 23 is the line in the startup script /lib/svc/method/http-squid where it tries to start Squid. The second number (1833 in this example) seemed incremental at each failure but meanlingless.

In the end I copied the Squid binary /usr/squid/sbin/squid from an old Solaris 11.0 install (17MB rather than 46MB) and it then seemed to work fine. Not a "proper" solution, but certainly an easy one if you have access to an old install!

1
  • Good stuff. Personally I ended up compiling Squid 3.5.26 myself for Solaris 11.3 with the --disable-arch-native flag. Works fine. I think your solution is working because when you steal Squid from that older box of yours then you get an older version of Squid. So it is not because of Solaris 11.3 vs 11.0. It is Squid v3.4+ vs older versions. At least this is my impression.
    – peterh
    Oct 20 '17 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.