Bug 6151 - uucico can crash with SIGFPE
Summary: uucico can crash with SIGFPE
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: uucp
Version: 6.1
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Eido Inoue
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-10-20 17:27 UTC by Joerg Dorchain
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-13 12:34:32 UTC
Embargoed:


Attachments (Terms of Use)

Description Joerg Dorchain 1999-10-20 17:27:54 UTC
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 12:34:59 UTC
patch added for next rawhide release


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