public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: eric <fsshl@att.net>
To: oualline@www.oualline.com
Cc: gcc-help@gcc.gnu.org
Subject: sine.cpp isn't run good on gnu/g++, plz help
Date: Sat, 04 Jun 2011 04:49:00 -0000	[thread overview]
Message-ID: <1307162873.4384.13.camel@eric-laptop> (raw)

Dear Steve Oualline:
  the book (Practical C++ Programming), AppendixD
computing sine using a power series
the program you listed on page 525, Example D-2 sin/sine.cpp
I tested on my linux/gnu-g++
----------------
eric@eric-laptop:~/practicalCpp/sin$ ./sine 3.141
x**1     3.141E+00
1!       1.000E+00
x**1/1! 3.141E+00
  total   3.141E+00

x**3     3.099E+01
3!       6.000E+00
x**3/3! 5.165E+00
*** stack smashing detected ***: ./sine terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x50)[0x3d8390]
/lib/tls/i686/cmov/libc.so.6(+0xe233a)[0x3d833a]
./sine[0x8048e11]
./sine[0x8048bb5]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x30cbd6]
./sine[0x80488b1]
======= Memory map: ========
00110000-00134000 r-xp 00000000 08:01
8913271    /lib/tls/i686/cmov/libm-2.11.1.so
00134000-00135000 r--p 00023000 08:01
8913271    /lib/tls/i686/cmov/libm-2.11.1.so
00135000-00136000 rw-p 00024000 08:01
8913271    /lib/tls/i686/cmov/libm-2.11.1.so
0025b000-00276000 r-xp 00000000 08:01 8913086    /lib/ld-2.11.1.so
00276000-00277000 r--p 0001a000 08:01 8913086    /lib/ld-2.11.1.so
00277000-00278000 rw-p 0001b000 08:01 8913086    /lib/ld-2.11.1.so
002d7000-002f4000 r-xp 00000000 08:01 8912979    /lib/libgcc_s.so.1
002f4000-002f5000 r--p 0001c000 08:01 8912979    /lib/libgcc_s.so.1
002f5000-002f6000 rw-p 0001d000 08:01 8912979    /lib/libgcc_s.so.1
002f6000-00449000 r-xp 00000000 08:01
8913215    /lib/tls/i686/cmov/libc-2.11.1.so
00449000-0044a000 ---p 00153000 08:01
8913215    /lib/tls/i686/cmov/libc-2.11.1.so
0044a000-0044c000 r--p 00153000 08:01
8913215    /lib/tls/i686/cmov/libc-2.11.1.so
0044c000-0044d000 rw-p 00155000 08:01
8913215    /lib/tls/i686/cmov/libc-2.11.1.so
0044d000-00450000 rw-p 00000000 00:00 0 
00988000-00989000 r-xp 00000000 00:00 0          [vdso]
0099a000-00a83000 r-xp 00000000 08:01 12062387   /usr/lib/libstdc
++.so.6.0.13
00a83000-00a84000 ---p 000e9000 08:01 12062387   /usr/lib/libstdc
++.so.6.0.13
00a84000-00a88000 r--p 000e9000 08:01 12062387   /usr/lib/libstdc
++.so.6.0.13
00a88000-00a89000 rw-p 000ed000 08:01 12062387   /usr/lib/libstdc
++.so.6.0.13
00a89000-00a90000 rw-p 00000000 00:00 0 
08048000-0804a000 r-xp 00000000 08:01
5507048    /home/eric/practicalCpp/sin/sine
0804a000-0804b000 r--p 00001000 08:01
5507048    /home/eric/practicalCpp/sin/sine
0804b000-0804c000 rw-p 00002000 08:01
5507048    /home/eric/practicalCpp/sin/sine
08b07000-08b28000 rw-p 00000000 00:00 0          [heap]
b78bf000-b78c1000 rw-p 00000000 00:00 0 
b78d5000-b78d8000 rw-p 00000000 00:00 0 
bfc8f000-bfca4000 rw-p 00000000 00:00 0          [stack]
Aborted
eric@eric-laptop:~/practicalCpp/sin$ 
-------------------------------------------
that certainly is not what your book predict on page 523
plz help, Eric, US citizen

             reply	other threads:[~2011-06-04  4:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-04  4:49 eric [this message]
2011-06-04  6:14 ` Bryan Hundven
2011-06-04  6:24   ` Bryan Hundven
2011-06-04 12:19 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307162873.4384.13.camel@eric-laptop \
    --to=fsshl@att.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=oualline@www.oualline.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).