Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old May 23rd, 2006, 05:55 PM
Lyndsey.Ferguson@gmail.com
Guest
 
Posts: n/a
Default Seeking advice on crash in __tcf_0

Hello Everyone,
I am investigating a crash within our application that has me stumped.

I am developing for Mac OS X, but I believe that this may be a regular
gcc c++ type question.

Here is the stack crawl of where the application is crashing:

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x0c3968c0

Thread 0 Crashed:
0 <<00000000>> 0x0c3968c0 0 + 0xc3968c0
1 com.mycompany.app 0x00002214 0x1000 + 0x1214
2 dyld 0x8fe1a278 _dyld_start + 0x64

After debugging it in gdb, I find that the code is crashing in a
function "__tcf_0". Which, according to my research so far, is a
function placed inside each function for a static object and is
registered with exit(). Its purpose is to call the destructor and free
the memory for that static object. When exit is called, inside it
calls each registered __tcf_0 function. The problem occurs when the
static memory is no longer valid and the crash occurs.

Do you think my research is correct? If so, how in the world do I find
where the problem is? We have many many static variables (more than I
can replace) -- how do I know where the problem lies?

Does anyone have any tips? Hopefully someone has dealt with this before

and found a solution.

I appreciate any help on this matter. Thank you in advance.

Sincerely,
Lyndsey

  #2  
Old May 23rd, 2006, 06:05 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: Seeking advice on crash in __tcf_0

Lyndsey.Ferguson@gmail.com wrote:[color=blue]
> I am investigating a crash within our application that has me stumped.
>
> I am developing for Mac OS X, but I believe that this may be a regular
> gcc c++ type question.[/color]

And what makes you think it's on topic here? Try gnu.g++.help. They
(GCC project) also have online discussion forums (http://gcc.gnu.org/).
Your problem is implementation-specific. And this a language newsgroup.
Please see the Welcome message for the explanations on the topicality
of c.l.c++: http://www.slack.net/~shiva/welcome.txt
[color=blue]
> [..][/color]

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  #3  
Old May 23rd, 2006, 07:35 PM
Lyndsey.Ferguson@gmail.com
Guest
 
Posts: n/a
Default Re: Seeking advice on crash in __tcf_0

Thanks for your suggestion, I will try both resources.

Sincerely,
Lyndsey

  #4  
Old May 23rd, 2006, 09:25 PM
Jim Langston
Guest
 
Posts: n/a
Default Re: Seeking advice on crash in __tcf_0

<Lyndsey.Ferguson@gmail.com> wrote in message
news:1148402878.814428.127750@u72g2000cwu.googlegr oups.com...[color=blue]
> Hello Everyone,
> I am investigating a crash within our application that has me stumped.
>
> I am developing for Mac OS X, but I believe that this may be a regular
> gcc c++ type question.
>
> Here is the stack crawl of where the application is crashing:
>
> Exception: EXC_BAD_ACCESS (0x0001)
> Codes: KERN_INVALID_ADDRESS (0x0001) at 0x0c3968c0
>
> Thread 0 Crashed:
> 0 <<00000000>> 0x0c3968c0 0 + 0xc3968c0
> 1 com.mycompany.app 0x00002214 0x1000 + 0x1214
> 2 dyld 0x8fe1a278 _dyld_start + 0x64
>
> After debugging it in gdb, I find that the code is crashing in a
> function "__tcf_0". Which, according to my research so far, is a
> function placed inside each function for a static object and is
> registered with exit(). Its purpose is to call the destructor and free
> the memory for that static object. When exit is called, inside it
> calls each registered __tcf_0 function. The problem occurs when the
> static memory is no longer valid and the crash occurs.
>
> Do you think my research is correct? If so, how in the world do I find
> where the problem is? We have many many static variables (more than I
> can replace) -- how do I know where the problem lies?[/color]

Not having used Mac OS X, but familiar with some types of errors, it sounds
to me like you are trying to delete the same memory twice. Try this small
program and see if you get the same error:

int main()
{
int* MyInt = new int();

delete MyInt;
delete MyInt; // Does this line produce the same type of error?
}
[color=blue]
>
> Does anyone have any tips? Hopefully someone has dealt with this before
>
> and found a solution.
>
> I appreciate any help on this matter. Thank you in advance.
>
> Sincerely,
> Lyndsey
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.