i always get the torsmo Program received signal SIGFPE, Arithmetic exception when started i think: it is because the torsmo asume that the totale swap size cant be 0 to compute the % of swap used he ((cur->swap*100) / cur->swapmax) but in my case cur->swapmax == 0 because of free -m total used free shared buffers cached Mem: 1263 1241 21 0 241 704 -/+ buffers/cache: 295 967 Swap: 0 0 0 Reproducible: Always Steps to Reproduce: 1. just find a ways to mess up with your swap (0 0 0 for swap): $free -m show 0 0 0 for swap 2. run torsmo :/usr/bin/torsmo Actual Results: Program received signal SIGFPE, Arithmetic exception. Expected Results: just not dumpcore :) Program received signal SIGFPE, Arithmetic exception. 0x0804fa31 in generate_text () at torsmo.c:1129 1129 snprintf(p, 255, "%*u", pad_percents, (cur->swap*100) / cur->swapmax); (gdb) print cur->swapmax $8 = 0 [CODE] .:[Managing 0/94 jobs.] [CPU Load: 0.34 Uptime: 1h39m]:. .:[11 files using 144k] [root@HackXoR /usr/portage/sys-apps/portage]:. .:[04:56:49]:. $ free -m total used free shared buffers cached Mem: 1263 1241 21 0 241 704 -/+ buffers/cache: 295 967 Swap: 0 0 0 [/CODE] yeah i know it is wired to have 0 0 0 for swap but it was a bug withe my encrypted swap.... if would add test case if (...==0) {...} else ... in evry part of the code that / by a unknow value like the totale swap on my box PS: torsmo has many ugly code like the above
be gentle it is my first use of :gbd,ebuild,unpack and my 1st bugreport
Reassigning to maintainer (instead of CCing).
John - this is one of the better bug reports I have ever received. Only suggestions for improvement are to include a patch and to submit it upstream. torsmo-0.18-r3 added that includes a patch. Please let me know if it works for you and if you want to add it to the sourceforge patches pages please do so. good use of gdb and please teach all other bug submitters to use it too :-)
couldn't wait to add upstream. Tell me if I stuffed up.