Program crashes in release build

Pierre Phaneuf wrote:

Both include_ticpp.h and include_ticpp.cpp are excluded (via right
clicking
on them and excluding them from the build). All the files are still added
in
the project and exist in the physical folder.

I suspect that excluding a header file only does something like skip
any dependency analysis done on the file, or something of that nature.

From what you describe, the header file does indeed get included
successfully, otherwise the ‘#include “include_ticpp.h”’ line would
cause a fatal compilation error.

throw_on_bad_element is declared in the header and defined in the source
(not declared & defined in header). When I uncomment the call to it, I
get
the link error. I thought that it should be a compile error too, since it
shouldn’t have any function declaration matching that name.

And the GetElement templated method is, of course, declared and
defined in the header, so when that one is used in your source file,
it works fine.

The compilation passes because the header file is indeed included,
despite what you think might happen when you “excluded” it. So it sees
the function declaration just fine, but then, at link time, can’t find
its implementation, since its missing the source file that defines it.

What kind of problem do you think this is though? I don’t use this
structure
at all so I don’t understand why it would be crashing.

A further tip on the crash you’re getting: having an invalid access at
0x10 is probably a NULL pointer getting dereferenced, where the
pointer is expected to be at some structure or array, and the access
is to some member that’s 16 bytes into the structure (say, “int* foo =
NULL; foo[4]”). Why it’s happening in the libc atexit handler, that’s
a good question. Looking for uses of atexit in your program (including
the libraries) might be a start.

–
http://pphaneuf.livejournal.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

So what you’re saying is that even though I’ve told the IDE to exclude the
file, it’s still getting included? So I guess I’ve misunderstood what it
means to exclude a file… does it mean that it can still be accessed if the
physical file is there, but it just can’t be compiled?

I don’t use atexit at all in the code that I have written. I know that SDL
uses something like that, but if it’s running fine with most of the files
excluded but still including SDL.h, then it must be something else? I’m
trying to think of what it would be but I’m not very experienced with stuff
like this.> On Fri, Apr 17, 2009 at 6:51 AM, Mybowlcut <@mitch_curtis> wrote:

View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23097377.html
Sent from the SDL mailing list archive at Nabble.com.

So what you’re saying is that even though I’ve told the IDE to exclude the
file, it’s still getting included? So I guess I’ve misunderstood what it
means to exclude a file… does it mean that it can still be accessed if the
physical file is there, but it just can’t be compiled?

Something like that. For header files, your IDE doesn’t really have
any actions to do, so I’m guessing that “excluding” means “not showing
it in the file browser”, which doesn’t do much, functionally.
Excluding the .cc (or was it .cpp file? no matter) does have a more
visible impact of not compiling it (and then you’re missing the
symbols).

I don’t use atexit at all in the code that I have written. I know that SDL
uses something like that, but if it’s running fine with most of the files
excluded but still including SDL.h, then it must be something else? I’m
trying to think of what it would be but I’m not very experienced with stuff
like this.

Is your program open source? If so, where can I get at the sources? I
could give it a try here… At worst, put up the (full!) source code
to the smallest program you can come up with that exhibits the crashes
(I like to use Google Sites, if it’s not already in something like
Google Code). Not making any promises, but I’m curious. :-)On Fri, Apr 17, 2009 at 9:17 AM, Mybowlcut wrote:

–

Pierre Phaneuf wrote:

So what you’re saying is that even though I’ve told the IDE to exclude
the
file, it’s still getting included? So I guess I’ve misunderstood what it
means to exclude a file… does it mean that it can still be accessed if
the
physical file is there, but it just can’t be compiled?

Something like that. For header files, your IDE doesn’t really have
any actions to do, so I’m guessing that “excluding” means “not showing
it in the file browser”, which doesn’t do much, functionally.
Excluding the .cc (or was it .cpp file? no matter) does have a more
visible impact of not compiling it (and then you’re missing the
symbols).

I don’t use atexit at all in the code that I have written. I know that
SDL
uses something like that, but if it’s running fine with most of the files
excluded but still including SDL.h, then it must be something else? I’m
trying to think of what it would be but I’m not very experienced with
stuff
like this.

Is your program open source? If so, where can I get at the sources? I
could give it a try here… At worst, put up the (full!) source code
to the smallest program you can come up with that exhibits the crashes
(I like to use Google Sites, if it’s not already in something like
Google Code). Not making any promises, but I’m curious. :slight_smile:

–
http://pphaneuf.livejournal.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’d very much prefer to email it to you as I haven’t decided if this will be
open source yet. It’s obviously freeware but I dunno… I feel a bit weird
putting the source up at the moment. I’ll email it to you instead? I’ve
brought it down to like 1.7 meg so it’s not huge.> On Fri, Apr 17, 2009 at 9:17 AM, Mybowlcut <@mitch_curtis> wrote:

View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23108302.html
Sent from the SDL mailing list archive at Nabble.com.

I’d very much prefer to email it to you as I haven’t decided if this will be
open source yet. It’s obviously freeware but I dunno… I feel a bit weird
putting the source up at the moment. I’ll email it to you instead? I’ve
brought it down to like 1.7 meg so it’s not huge.

Maybe you should read this? Programmer Insecurity @ iBanjo

That’s okay, send it over, I’ll take a look, again, no promises, just curious.On Fri, Apr 17, 2009 at 8:57 PM, Mybowlcut wrote:

–

Pierre Phaneuf wrote:

I’d very much prefer to email it to you as I haven’t decided if this will
be
open source yet. It’s obviously freeware but I dunno… I feel a bit
weird
putting the source up at the moment. I’ll email it to you instead? I’ve
brought it down to like 1.7 meg so it’s not huge.

Maybe you should read this? http://blog.red-bean.com/sussman/?p=96

That’s okay, send it over, I’ll take a look, again, no promises, just
curious.

–
http://pphaneuf.livejournal.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Haha I read that following some links on a guy on here’s blog. If I was
insecure I wouldn’t be asking for help on public forums (I frequent a few
others). It’s not insecurity, it’s more not wanting code that I’ve spent
years (on and very large off periods obviously) to be out in the public for
anyone to use. I know that might sound selfish to the “pro-open source”
people but I just don’t feel right about it.

I’ve sent the email to your gmail account. Thanks in advance if you do take
the time to have a look.> On Fri, Apr 17, 2009 at 8:57 PM, Mybowlcut <@mitch_curtis> wrote:

View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23120757.html
Sent from the SDL mailing list archive at Nabble.com.

Sorry if I seem impatient, but just wondering if you’ve had a look yet? I’m
considering posting this on microsoft forums or something as well?–
View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155552.html
Sent from the SDL mailing list archive at Nabble.com.

I wouldn’t mind taking a look at the project too. I may not have time
to comprehensively examine anything for a week or two, though.On Tue, Apr 21, 2009 at 8:59 AM, Mybowlcut wrote:

Sorry if I seem impatient, but just wondering if you’ve had a look yet? I’m
considering posting this on microsoft forums or something as well?

–
View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155552.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Excellent! I appreciate any help I can get! Would you mind sending me your
email address so I can send you the project?

fuzzyTew wrote:>

I wouldn’t mind taking a look at the project too. I may not have time
to comprehensively examine anything for a week or two, though.

On Tue, Apr 21, 2009 at 8:59 AM, Mybowlcut <@mitch_curtis> wrote:

Sorry if I seem impatient, but just wondering if you’ve had a look yet?
I’m
considering posting this on microsoft forums or something as well?

–
View this message in context:
http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155552.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

–
View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155723.html
Sent from the SDL mailing list archive at Nabble.com.

Crazy, Nabble hides all our e-mail addresses? I’m on g-mail, and this
is actually an e-mail mailing list – you can see the e-mail addresses
of everyone in the list archives at
http://lists.libsdl.org/pipermail/sdl-libsdl.org/ .On Tue, Apr 21, 2009 at 9:07 AM, Mybowlcut wrote:

Excellent! I appreciate any help I can get! Would you mind sending me your
email address so I can send you the project?

fuzzyTew wrote:

I wouldn’t mind taking a look at the project too. ?I may not have time
to comprehensively examine anything for a week or two, though.

On Tue, Apr 21, 2009 at 8:59 AM, Mybowlcut wrote:

Sorry if I seem impatient, but just wondering if you’ve had a look yet?
I’m
considering posting this on microsoft forums or something as well?

–
View this message in context:
http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155552.html
Sent from the SDL mailing list archive at Nabble.com.

Oh, ok. Got it. Thanks.

fuzzyTew wrote:>

Crazy, Nabble hides all our e-mail addresses? I’m on g-mail, and this
is actually an e-mail mailing list – you can see the e-mail addresses
of everyone in the list archives at
http://lists.libsdl.org/pipermail/sdl-libsdl.org/ .

On Tue, Apr 21, 2009 at 9:07 AM, Mybowlcut <@mitch_curtis> wrote:

Excellent! I appreciate any help I can get! Would you mind sending me
your
email address so I can send you the project?

fuzzyTew wrote:

I wouldn’t mind taking a look at the project too. ?I may not have time
to comprehensively examine anything for a week or two, though.

On Tue, Apr 21, 2009 at 8:59 AM, Mybowlcut <@mitch_curtis> wrote:

Sorry if I seem impatient, but just wondering if you’ve had a look yet?
I’m
considering posting this on microsoft forums or something as well?

–
View this message in context:
http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23155552.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

–
View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23168287.html
Sent from the SDL mailing list archive at Nabble.com.

I think the problem is solved by removing (/NODEFAULTLIB:[uuid.lib,
msvcrt.lib]) from Linker->Input->Ignore Specific Library and msvcrtd.lib
from Linker->Input->Additional Depedencies (as suggested by fuzzyTew in an
email if I remember correctly). I had originally put them there in debug
mode because of a link warning (see below) and I put them into the release
build as well.

MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib’
conflicts with use of other libs; use /NODEFAULTLIB:library

I built both debug and release builds and they both run without crashing
when I take that stuff out of the linker input settings… :)–
View this message in context: http://www.nabble.com/Program-crashes-in-release-build-tp22654119p23344401.html
Sent from the SDL mailing list archive at Nabble.com.