What is 'dc' and why would it be using 100% CPU



  • I saw a process named 'dc' (/usr/bin/dc) on my SG-1000 using excessive CPU. Not knowing why my firewall would be running the FreeBSD calculator, I killed it. Now the firewall has gone offline.

    What process is this, and what purpose does it serve in pfSense?



  • https://www.freebsd.org/cgi/man.cgi?query=dc§ion=1

    Description
    dc is an arbitrary precision arithmetic package.  The overall structure of dc is a stacking (reverse Polish) calculator i.e. numbers are stored on a stack.  Adding a number pushes it onto the stack.  Arithmetic operations pop arguments off the stack and push the results.  See also the bc(1) utility, which is a preprocessor for dc providing infix notation and a C-like syntax which implements functions and reasonable control structures for programs.

    It must be chewing on something.  I don't know what pfSense uses dc for.


  • Banned

    Have you enabled some fancy optimization feature in pfBlockerNG?


  • Rebel Alliance Developer Netgate

    At a glance and quick grep I don't see anything in the base system that calls dc. What packages do you have installed? What features are enabled in those packages?

    If you look at "ps uxaww" or "top -aSH" do you see the parameters to dc? If so, what are they?

    Also if you check "ps xuawwd" it will output a tree style ps that should show you what called dc



  • Nothing fancy… it's 2.4.0RC as shipped.

    The firewall has now reset itself and is back online. There's nothing useful in dmesg or system.log.

    Only package installed is AutoConfigBackup.

    I'll try digging more with ps next time it happens. I might try rigging up monit to do it for me.

    I was hoping there would at least be some pfsense-related reason for dc having been called… now I'm somewhat unsettled.

    Thanks, everyone…