Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 219578 - app-portage/ufed-0.40-r7: SIGFPE (division by zero) when displaying help
Summary: app-portage/ufed-0.40-r7: SIGFPE (division by zero) when displaying help
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Harald van Dijk (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-28 09:26 UTC by Martin von Gagern
Modified: 2008-04-28 16:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2008-04-28 09:26:47 UTC
I was running ufed in a terminal window with 61 lines of 213 columns. Whenever I tried to display the help text, ufed died. It left the terminal in non-echo mode, so I had to reset it again.

Debugging the ufed-curses interface, I found the culprit:
ufed-curses.c: static void drawscrollbar(void): line 112:

  mvwaddch(w, 1+(wHeight(Scrollbar)-3)*topy
  /(items->prev->top+items->prev->height-(wHeight(List)-1)), 0, ACS_BLOCK);

for which the debugger gave me these values in my case:
  /(             50 +             1     -(52           -1))

So the cause of the SIGFPE that gets raised is a division by zero. Haven't tried to understand what this line is supposed to do in general or in my special case.

After a couple of tries I always encountered bug 219577 as well, so I had to switch to a text console to allow gpm connections to get processed. Otherwise ufed would not even display its list.
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2008-04-28 16:40:59 UTC
Thanks for the report! I hadn't considered terminal windows large enough to display the whole of the help at once, and the line you've copied here tries to calculate the position of the scroll thumb. Clearly, if everything's displayed already, there's no need to scroll, so I've fixed this in ufed-0.40-r8 by skipping the code in that case.