[Bug 591819] Re: compiled program segfault when -O0 is used to compile
Bug Watch Updater
591819 at bugs.launchpad.net
Tue Aug 30 17:28:32 UTC 2011
Launchpad has imported 2 comments from the remote bug at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50239.
If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.
------------------------------------------------------------------------
On 2011-08-30T16:29:35+00:00 eviom wrote:
Original thread: https://bugs.launchpad.net/ubuntu/+source/gcc-
defaults/+bug/591819
When I compile my code, if I compile it -O2, it compiles and runs fine.
if I compile it with -O0, it segfaults while rendering text with FTGL.
I've made no changes to anything in between compiles. Same FTGL code
works fine in win32 (vs2010).
Reply at: https://bugs.launchpad.net/gcc-defaults/+bug/591819/comments/5
------------------------------------------------------------------------
On 2011-08-30T16:38:22+00:00 Paolo-carlini wrote:
Please follow the normal bug reporting instructions:
http://gcc.gnu.org/bugs/#report
Reply at: https://bugs.launchpad.net/gcc-defaults/+bug/591819/comments/7
** Changed in: gcc-defaults
Status: Unknown => Incomplete
** Changed in: gcc-defaults
Importance: Unknown => Medium
** Bug watch added: gcc.gnu.org/ #
http://gcc.gnu.org/bugs/
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/591819
Title:
compiled program segfault when -O0 is used to compile
Status in gcc-defaults:
Incomplete
Status in “gcc-defaults” package in Ubuntu:
Confirmed
Bug description:
I don't know whether this is really a problem, or what not, but I'm
attaching logs, and the program which causes it, along with every
detail I can think of. When I compile my code, if I compile it -O2,
it compiles and runs fine. if I compile it with -O0, it segfaults
very early on in the execution. I've made no changes to anything in
between compiles.
Compiling the code successfully requires the following libraries:
opengl (mesa)
glut (freeglut)
curl
FTGL (patched, see https://bugs.launchpad.net/ubuntu/+source/ftgl/+bug/485225 )
procedure is as follows:
./configure
make CFLAGS="-O0"
src/altocumulus
make clean
make CFLAGS="-O2"
src/altocumulus
My code is pretty crappy, please ignore that, I'm still learning the basics of C.
Regardless, the code shouldn't work with one level of optimization and fail with another.
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: gcc 4:4.4.3-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.36-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed Jun 9 11:43:21 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: gcc-defaults
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc-defaults/+bug/591819/+subscriptions
More information about the foundations-bugs
mailing list