Bug 6151 - uucico can crash with SIGFPE
uucico can crash with SIGFPE
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: uucp (Show other bugs)
6.1
All Linux
medium Severity high
: ---
: ---
Assigned To: Eido Inoue
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-10-20 13:27 EDT by Joerg Dorchain
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-13 07:34:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joerg Dorchain 1999-10-20 13:27:54 EDT
This is due to a division by zero. Ian Taylor mailed me ap
atch for it (enclosed)
I also uploaded new versions to incoming.redhat.com


--- serial.c.orig       Wed Oct 20 18:51:06 1999
+++ serial.c    Wed Oct 20 19:05:19 1999
@@ -2371,8 +2371,17 @@
          else
            csleepchars = MAX_INPUT - 10;

+#ifndef BUG
+         if (q->ibaud) {
+           isleep = (int) (((long)  csleepchars * 10000L) /
q->ibaud);
+           isleep -= 10;
+         } else {
+           isleep = 1000; /* I hope, a second is right...
*/
+         }
+#else
          isleep = (int) (((long) csleepchars * 10000L) /
q->ibaud);
          isleep -= 10;
+#endif

          if (isleep > 10)
            {
@@ -2773,9 +2782,20 @@
                                / baud bits/sec)
                               * 10 bits/byte)
             */
+#ifndef BUG
+         if (q->ibaud) {
+           stime.tv_sec = (long) 10240 / q->ibaud;
+           stime.tv_usec = ((((long) 1024000000 / q->ibaud)
* (long) 10)
+                            % (long) 1000000);
+         } else {
+            stime.tv_sec = 1;
+            stime.tv_usec = 0;
+         }
+#else
          stime.tv_sec = (long) 10240 / q->ibaud;
          stime.tv_usec = ((((long) 1024000000 / q->ibaud) *
(long) 10)
                           % (long) 1000000);
+#endif

          imask = 1 << q->o;
          if (imask == 0)
@@ -2846,7 +2866,14 @@
                  we don't need to use the catch stuff,
since we know
                  that HAVE_RESTARTABLE_SYSCALLS is 0.  */
              usset_signal (SIGALRM, usalarm, TRUE, (boolean
*) NULL);
+#ifndef BUG
+            if (q->ibaud)
+               alarm ((int) ((long) 10240 / q->ibaud) + 1);
+             else
+               alarm (1);
+#else
              alarm ((int) ((long) 10240 / q->ibaud) + 1);
+#endif

              /* There is a race condition here: on a
severely loaded
                  system, we could get the alarm before we
start the
Comment 1 Florian La Roche 2000-02-13 07:34:59 EST
patch added for next rawhide release

Note You need to log in before you can comment on or make changes to this bug.