[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nanl problem
From: |
Petter Reinholdtsen |
Subject: |
Re: nanl problem |
Date: |
Wed, 21 Jul 2004 22:06:19 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (usg-unix-v) |
[Zoonky Lee]
> The following code compiled with gcc (v3.2.2 or v3.3) & glibc v2.3.1 produce
> "Memory fault" on
> Slackware 9:
>
> #include <math.h>
>
> int main(){
> long double a = nanl(0);
>
> return 0;
> }
It crashes when I test on Debian/Unstable as well. I'm not sure if
nanl() is supposed to handle NULL pointers, but suggest you report
this problem to the glibc bugzilla, available from
<URL:http://sources.redhat.com/bugzilla/>.
When I run this program in valgrind, I get the following result:
% valgrind ./a.out
==15810== Memcheck, a memory error detector for x86-linux.
==15810== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==15810== Using valgrind-2.1.1, a program supervision framework for x86-linux.
==15810== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==15810== For more details, rerun with: -v
==15810==
==15810== Invalid read of size 1
==15810== at 0x3C03D92D: nanl (s_nanl.c:31)
==15810== by 0x80483DF: main (in /skole/tjener/home0/pere/a.out)
==15810== Address 0x0 is not stack'd, malloc'd or free'd
==15810==
==15810== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==15810== Access not within mapped region at address 0x0
==15810== at 0x3C03D92D: nanl (s_nanl.c:31)
==15810== by 0x80483DF: main (in /skole/tjener/home0/pere/a.out)
==15810==
==15810== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 13 from 1)
==15810== malloc/free: in use at exit: 0 bytes in 0 blocks.
==15810== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==15810== For a detailed leak analysis, rerun with: --leak-check=yes
==15810== For counts of detected errors, rerun with: -v
Segmentation fault
%
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: nanl problem,
Petter Reinholdtsen <=