Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 6559 - Kernel oops with trigonometric functions on a 386 w/o fpu
Summary: Kernel oops with trigonometric functions on a 386 w/o fpu
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 6.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-10-31 04:12 UTC by donald
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2000-01-04 22:27:49 UTC

Attachments (Terms of Use)

Description donald 1999-10-31 04:12:58 UTC
I'm running RedHat 6.0 on a 386 without a math
co-processor.  The following code (compiled with 'gcc
tst.c -lm' always produces a kernel oops and generates a
segmentation fault.  (According to 'objdump --disassemble',
there are no 486 BSWAP instructions in the executable)

#include <stdio.h>
#include <math.h>

        printf ("%f\n", sin(1.0));
        exit (0);

Similar behaviour results with the following perl script...

$ perl -e '{ print sin(1.0), "\n" }'
Segmentation fault

Curiously, though...

$ perl -e '{ print sin(3.0), "\n" }'

works fine.  For what it's worth, here's the oops
(sorry about the wrapping).

>Unable to handle kernel paging request at virtual address
>current->tss.cr3 = 00646000, %cr3 = 00646000
>*pde = 00000000
>Oops: 0000
>CPU:    0
>EIP:    0010:[poly_sine+945/1140]
>EFLAGS: 00010296
>eax: 8214aabb   ebx: 00000000   ecx: 07781a5c   edx:
>esi: 8214aabb   edi: c03cff00   ebp: c03cff00   esp:
>ds: 0018   es: 0018   ss: 0018
>Process perl (pid: 7036, process nr: 30,
>Stack: 00000000 c03cffb4 c03cfefc c03cfeec c03cfee8
00000000 c03cfed4 c03cfef4
>       8214aabb 2cd09e2b 42d18469 921fb544 c03cffb4
00000000 00000000 0013d0fa
>       9c6c0650 1b2cb8ab ab698587 4318c275 53682eaf
12ffb1d5 48677021 d76aa478
>Call Trace: [fsin+71/292] [FPU_trigb+62/76]
>       [do_no_page+179/192] [handle_mm_fault+198/352]
>       [device_not_available+55/60]
>       [startup_32+43/286]
>Code: f7 60 04 89 54 24 28 8b 54 24 5c 89 54 24 10 89 54 24
2c 89

Some futher notes:

Manually upgrading the kernel to 2.2.12 (w/
CONFIG_MATH_EMULATION=y and CONFIG_M386=y) didn't help.
However, I tried recompiling the kernel (v2.2.12) using
an older compiler (gcc version and that seemed
to fix the problem.  It looks as though there may be some
issues with the C compiler that comes with RedHat 6.0
(egcs-2.91.66 / egcs-1.1.2) and Linux's math emulation.

Comment 1 Jim Kingdon 1999-11-01 00:08:59 UTC
The fact that changing the compiler helped _might_ mean it is a
compiler problem, but it might not be.

Comment 2 Cristian Gafton 2000-01-04 22:25:59 UTC
Assigned to dledford

Comment 3 Cristian Gafton 2000-01-04 22:27:59 UTC
Assigned to dledford

Comment 4 Alan Cox 2000-08-08 14:20:52 UTC
This should be fixed in 2.2.14 and higher

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