Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 219578

Summary: app-portage/ufed-0.40-r7: SIGFPE (division by zero) when displaying help
Product: Portage Development Reporter: Martin von Gagern <Martin.vGagern>
Component: ToolsAssignee: Harald van Dijk (RETIRED) <truedfx>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 2.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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.