<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>219578</bug_id>
          
          <creation_ts>2008-04-28 09:26 0000</creation_ts>
          <short_desc>app-portage/ufed-0.40-r7: SIGFPE (division by zero) when displaying help</short_desc>
          <delta_ts>2008-04-28 16:40:59 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Portage Development</product>
          <component>Tools</component>
          <version>2.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>Martin.vGagern@gmx.net</reporter>
          <assigned_to>truedfx@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2008-04-28 09:26:47 0000</bug_when>
            <thetext>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-&gt;prev-&gt;top+items-&gt;prev-&gt;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&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>truedfx@gentoo.org</who>
            <bug_when>2008-04-28 16:40:59 0000</bug_when>
            <thetext>Thanks for the report! I hadn&apos;t considered terminal windows large enough to display the whole of the help at once, and the line you&apos;ve copied here tries to calculate the position of the scroll thumb. Clearly, if everything&apos;s displayed already, there&apos;s no need to scroll, so I&apos;ve fixed this in ufed-0.40-r8 by skipping the code in that case.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>