Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* segmentation fault with math lib
@ 1997-05-07 18:54 m.de.beurs
  0 siblings, 0 replies; 7+ messages in thread
From: m.de.beurs @ 1997-05-07 18:54 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]

I´m having a problem with making a program with uses the math library and I 
don´t know wether I´m doing something wrong, or my system is not correctly 
installed.

I have linux-axp version 2.0.25 for the dec multia.

I'm having problems with making a program with uses cos() and sin()
functions. If I don't use these functions everything goes ok. The program 
gives a core dump when started. The following is an example of the problem:

the test program (test.c):

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

main(void)
 {
    
    float
        a,b;

    a = 1.;
    b = sin(a);
    printf(" b = %f\n",b);
 }

compiling with:
gcc test.c -o test -lm

running:
test

and then the error:
Segmentation fault (core dumped)

running debug:
gdb test core

gives:
Program terminated with signal 11, Segmentation fault.
#0 0x1200083a4 in __libc_init ()

Can anyone help me with this?

Thanks,

M. de Beurs
m.de.beurs@pi.net

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
       [not found] <M.050797.205427.14@LOCALNAME>
@ 1997-05-08  0:19 ` Andrew D. Isaacson
  1997-05-08 18:01 ` Richard Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew D. Isaacson @ 1997-05-08  0:19 UTC (permalink / raw)


Once upon a time, m.de.beurs@pi.net said:
 [snip]
> I have linux-axp version 2.0.25 for the dec multia.

Problems like this generally have little to do with the kernel version.  It
will depend more upon what versions of glibc and gcc you are running.

> I'm having problems with making a program with uses cos() and sin()
> functions. If I don't use these functions everything goes ok. The program 
> gives a core dump when started. The following is an example of the problem:

Your test program comiles and runs fine on my Linux/Alpha box.  I'm running
RedHat 4.0.  Here's some relevant info:

tron: rpm -q glibc-devel glibc gcc
glibc-devel-0.960906-1
glibc-0.960906-1
gcc-2.7.2-9

kernel 2.0.27

HTH,
-andy

-- 
Andy Isaacson <adisaacs@mtu.edu> -- conserve bandwidth, use one line sigs.

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
@ 1997-05-08 17:15 Hunter A. Ware
  0 siblings, 0 replies; 7+ messages in thread
From: Hunter A. Ware @ 1997-05-08 17:15 UTC (permalink / raw)


Have you tried to link with -lieee?  I was having wierd segfaults from
over and underflow until I did.

					Cheers,
						Hunter

-- 
	._ @	 A computer lets you make more mistakes faster than
~~~\   /  //\. any other invention, with the possible exceptions of
    \	 \>> | handguns and Tequilla. - Mitch Ratcliffe
     \	  \\					haw4t@virginia.edu

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
       [not found] <M.050797.205427.14@LOCALNAME>
  1997-05-08  0:19 ` Andrew D. Isaacson
@ 1997-05-08 18:01 ` Richard Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Henderson @ 1997-05-08 18:01 UTC (permalink / raw)


> Program terminated with signal 11, Segmentation fault.
> #0 0x1200083a4 in __libc_init ()

That's odd.  You didn't, by chance, rebuild libc yourself did you?
That is an problem I've seen when a build of libc errors out and 
does not restart properly.

If not, consider updating your glibc rpms to the RH4.1 set.

r~

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
       [not found] <199705081801.NAA24268@stommel.tamu.edu>
@ 1997-05-08 21:01 ` Zach
  0 siblings, 0 replies; 7+ messages in thread
From: Zach @ 1997-05-08 21:01 UTC (permalink / raw)


On Thu, 8 May 1997, Richard Henderson wrote:

> > Program terminated with signal 11, Segmentation fault.
> > #0 0x1200083a4 in __libc_init ()

on a similar note, i'm getting annoying segfaults when i compile in
profiling (via -pg).  everything compiles/links fine, except when i run
whatever it is i've compiled (as simple as {print "hello"}) i get: 

Program received signal SIGSEGV, Segmentation fault.
__ieee_set_fp_control ()
    at ../sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S:29
../sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S:29: No such file or
directory.
Current language:  auto; currently asm
(gdb) 

this is annoying to no end :)

so is glibc doing something stupid?  am i doing something stupid?  i
vaguely remember something like this being mentioned on the list before,
but i couldn't find an archive.

i'm using basically a stock redhat 4.1 with updates..

gcc-2.7.2.1-2
glibc-devel-0.961212-3
glibc-info-0.961212-3
glibc-profile-0.961212-3
glibc-static-0.961212-3
binutils-2.7.0.2-4

sorry if this has been adressed already..

-- zach

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
       [not found] <m3n2q5hom4.fsf@spunky.virginia.edu>
@ 1997-05-08 22:14 ` Zach
  0 siblings, 0 replies; 7+ messages in thread
From: Zach @ 1997-05-08 22:14 UTC (permalink / raw)


> Have you tried to link with -lieee?  I was having wierd segfaults from
> over and underflow until I did.

the stuff i'm compiling doesn't even use floating point..

-------
$ cat test.c
#include <stdio.h>

void main(void) {
        printf("Hello\n");
}

$ gcc -o test test.c
$ ./test
Hello
$ gcc -o test -pg test.c
$ ./test
Segmentation fault
$ gdb ./test
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (alpha-unknown-linux), Copyright 1996 Free Software Foundation,
Inc...
(gdb) run
Starting program: /usr/local/src/./test 

Program received signal SIGSEGV, Segmentation fault.
__ieee_set_fp_control ()
    at ../sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S:29
../sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S:29: No such file or
directory.
Current language:  auto; currently asm

---------

adding -lieee or /usr/lib/libc_p.a doesn't help a bit.

note that this all works in an intel/linux box based on redhat 4.1 with
the updates just fine.  there seems to be some weirdness hiding somewhere
in glibc/gcc for the alpha [maybe this is that odd gas bug?]

-- zach

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: segmentation fault with math lib
       [not found] <Pine.LNX.3.95.970508134813.3342B-100000@thebrain>
@ 1997-05-08 23:09 ` Richard Henderson
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 1997-05-08 23:09 UTC (permalink / raw)


> on a similar note, i'm getting annoying segfaults when i compile in
> profiling (via -pg).  everything compiles/links fine, except when i run
> whatever it is i've compiled (as simple as {print "hello"}) i get: 
> 
> Program received signal SIGSEGV, Segmentation fault.
> __ieee_set_fp_control ()
>     at ../sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S:29

Known problem; fixed in current glibc sources.  I thought David-MT
posted some some patches that fix that and one other problem.  They
should be in the axp-list archive.

r~

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-05-08 23:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.3.95.970508134813.3342B-100000@thebrain>
1997-05-08 23:09 ` segmentation fault with math lib Richard Henderson
     [not found] <m3n2q5hom4.fsf@spunky.virginia.edu>
1997-05-08 22:14 ` Zach
     [not found] <199705081801.NAA24268@stommel.tamu.edu>
1997-05-08 21:01 ` Zach
     [not found] <M.050797.205427.14@LOCALNAME>
1997-05-08  0:19 ` Andrew D. Isaacson
1997-05-08 18:01 ` Richard Henderson
1997-05-08 17:15 Hunter A. Ware
  -- strict thread matches above, loose matches on Subject: below --
1997-05-07 18:54 m.de.beurs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox