[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

find our where the exe is being aborted with abort()

Posted on 2010-11-29
11
Medium Priority
?
5,226 Views
Last Modified: 2012-05-10
Hi,

My c++ is getting gets an error when under the MTD and it just exits when it is built under MT. In MTD i get this error:

"Debug Error!
R6010
- abort() has been called
(Press Retry to debug the application)"

Open in new window


I can choose to ignore it, cancel it or retry but they all lead to the exe getting closed. I gues that abort() is being called somewhere but i've been looking and searching for it and I cant find it. It is probably not in my code but a result when communicating with a socket while the internet connection goes down.

Is there a way that I can find out where this error is being called from (line and file)?

Thank you
0
Comment
Question by:xNejX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 34231973
>>Is there a way that I can find out where this error is being called from (line
>>and file)?

Yes - "Press Retry to debug the application" (pardon the pun) and examine the call stack. This will lead you to the file and line in your code that subsequently caused 'abort()' to be called.
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 400 total points
ID: 34231981
BTW, see also http://msdn.microsoft.com/en-us/library/a3694ts5.aspx ("How to: Use the Call Stack Window")
0
 

Author Comment

by:xNejX
ID: 34232003
i will try the second solution, the retry doesn't do anything
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:jkr
ID: 34232089
You could also try to to rund your aqpp in the debugger from the start, it should then stop on the line with the 'abort()'.
0
 

Author Comment

by:xNejX
ID: 34232418
I tried to do it with the callstack but as soon as it aborts the callstact window dissapears from Visual Studio and when I reopen it it is empty.

All that I can get from the "Output" window in visual studio is The program '[22476] Unasl.exe: Native' has exited with code 1 (0x1).

How do i rund my aqpp?
0
 
LVL 86

Expert Comment

by:jkr
ID: 34232747
Hmm, can you try to set a breakpoint on 'abort()'? Press CTRL+B and enter 'abort' in the text field.
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 400 total points
ID: 34233035
If you need help in using the VS debugger, these articles may help:
C/C++ Beginner's Debugging Guide
Breakpoint Tips for C/C++
Watch, Memory, Stack Tips: C/C++
0
 

Author Comment

by:xNejX
ID: 34234018
@jkr

Do you know the shortcut or the function name in VS 2010? CTRL + B doesn't do anything => { (Ctrl+B) was pressed. Waiting for second key or chord... }?
0
 
LVL 86

Expert Comment

by:jkr
ID: 34234128
Try "Debug|New Breakpoint|Break at Function..."
0
 

Author Comment

by:xNejX
ID: 34234758
was i supposed to put a certain line number and char, should i put in abort or abort()?

cause it didn't break on anything...
0
 
LVL 22

Accepted Solution

by:
ambience earned 1200 total points
ID: 34246485
heres a weird idea that I would have tried after all these efforts

write abort() right after main() (the first statement). Single step through the code F-11. Step inside abort() and set a breakpoint and stop debuging.

Then keeping the breakpoint open, remove the abort() statement and continue debugging F5. It should then hit the breakpoint.

This should work If you had installed CRT source code, otherwise you can set the break point in disassembly. In the worst case, set the breakpoint in disassembly and then drag the execution point to the [ret] statement of abort() (effectively skipping it manually the first time). Continue from that point and it should break the next time it enters abort().

Weird, but I know I have succeeded with things like that in the past so its worth a try when nothing else is working :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question