callstack

WCF, async, and a confusion of context

痞子三分冷 提交于 2019-12-06 12:20:29
Well, I was going to name this and a question of context , but apparently the word question isn't allowed in titles. Anyway, here's the issue: I use IErrorHandler in my WCF services in order to provide logging without cluttering up all of my service code. Until now, this has worked great. However, now that I'm trying to move to completely asynchronous services, I'm encountering the issue of the call stack being a return stack instead of a causality chain . Now, I tried using Stephen Cleary's logical call context MyStack , combined with Ninject 's Intercept extensions.. Ninject: Bind<IThing>()

VERY strange stack overflow in C++ program

廉价感情. 提交于 2019-12-06 09:37:10
I wrote a program some time ago (Mac OS X, C++, SDL, FMOD) and it perfomed rather good. But lately I wanted to extend its functionality and added some more code to it. And now, when I run it and try to test the new functionality, the program crashes with SIGABRT. Looking into debugger, on function stack I see: _kill kill$UNIX2003 raise __abort __stack_chk_fail odtworz <-- my function that was was modified As far as I know, "__stack_chk_fail" indicates a stack overflow. But that's not the weirdest thing about it. In this function "odtworz", I have some code like this: ... koniec = 0; while (

Getting the size of the callstack

夙愿已清 提交于 2019-12-06 05:42:06
问题 Is there a way to get the size of the callstack (in bytes) in C++? Or at least the bottom address of it (and then I can subtract it from the ESP register? 回答1: You can try using VirtualQuery twice. The first time you can use the address of any value on the stack to get the base address and size (in bytes) of the committed stack space. Subtract the size from the base address and call VirtualQuery again. This way you get the space reserved for the stack. Adding the two sizes you obtain the

Why does the debugger need symbols to reconstruct the stack?

不想你离开。 提交于 2019-12-06 05:16:00
When debugging in Visual Studio, if symbols for a call stack are missing, for example: 00 > HelloWorld.exe!my_function(int y=42) Line 291 01 dynlib2.dll!10011435() [Frames below may be incorrect and/or missing, no symbols loaded for dynlib2.dll] 02 dynlib2.dll!10011497() 03 HelloWorld.exe!wmain(int __formal=1, int __formal=1) Line 297 + 0xd bytes 04 HelloWorld.exe!__tmainCRTStartup() Line 594 + 0x19 bytes 05 HelloWorld.exe!wmainCRTStartup() Line 414 06 kernel32.dll!_BaseProcessStart@4() + 0x23 bytes the debugger will display the warning Frames below may be incorrect and/or missing . (Note that

How does Smalltalk manipulate call stack frames (thisContext)?

故事扮演 提交于 2019-12-06 03:38:57
问题 The Smalltalk object thisContext look strange and marvelous. I can't understand what it is and how it works. And even how it enables continuations. For C's call-stack, I can easily imagine how is it implemented and working. But for this... I can't. Please help me to understand it. 回答1: I think it is not an easy question. The stack is reified in the image with instances of MethodContext. A MethodContext can have a sender, which is another MethodContext. That one can have another one..

Create function call dynamically in C++

狂风中的少年 提交于 2019-12-06 03:37:34
问题 Hello people I hope you an help me out with this problem: I am currently implementing an interpreter for a scripting language. The language needs a native call interface to C functions, like java has JNI. My problem is, that i want to call the original C functions without writing a wrapper function, which converts the call stack of my scripting language into the C call stack. This means, that I need a way, to generate argument lists of C functions at runtime. Example: void a(int a, int b) {

Stack Overflow of 8086 microprocessor

痞子三分冷 提交于 2019-12-06 00:10:59
What'll be the behaviour of the 8086 Microprocessor when the stack is full and even then I push something into it? On the 8086, a PUSH instruction or implicit stack push will decrement the SP register by two and store the appropriate quantity at SS:SP (i.e. 16*SS+SP). If the SP register was $0000, the data will go to SS:$FFFE. If the SP register was $0001, the MSB of the data will go to SS:$0000 and the LSB will go to SS:$FFFF. The processor will not take any special notice of the stack wraparound. While stack wraparound would typically be a bad thing, there are some situations on the 8086

Print callstack at runtime (XCode)

爱⌒轻易说出口 提交于 2019-12-05 21:37:20
Is it possible? I have found solution for Visual Studio Print n levels of callstack? To print a backtrace at runtime programmatically, you can use this function: #import <execinfo.h> void PrintBacktrace ( void ) { void *callstack[128]; int frameCount = backtrace(callstack, 128); char **frameStrings = backtrace_symbols(callstack, frameCount); if ( frameStrings != NULL ) { // Start with frame 1 because frame 0 is PrintBacktrace() for ( int i = 1; i < frameCount; i++ ) { printf("%s\n", frameStrings[i]); } free(frameStrings); } } Use bt (or backtrace command in gdb console). Here's more info on

Relation between endianness and stack-growth direction

不问归期 提交于 2019-12-05 13:02:48
Is there a relation between endianness of a processor and the direction of stack growth? For example, x86 architecture is little endian and the stack grows downwards (i.e. it starts at highest address and grows towards lower address with each push operation). Similarly, in SPARC architecture , which is big endian , the stack starts at lowest address and grows upwards towards higher addresses. This relationship pattern is seen in almost all architectures. I believe there must be a reason for this unsaid convention. Can this be explained from computer architecture or OS point of view? Is this

In C# (or .NET in general) can you mask the call stack level where an exception was thrown via attributes?

对着背影说爱祢 提交于 2019-12-05 12:22:28
The title may be a little confusing so I'll explain. Say you had this call chain... public DoWork(index) >> private DoWorkHelper(index) >> private CheckIndex(index) Now if you call DoWork , it traverses the calls down to CheckIndex , adding each deeper call to the call stack. Now if someone calls DoWork with a bad value for index , it throws the exception all the way down at CheckIndex , and currently, that's where the debugger breaks. You then have to walk back up the call stack to see the real offender was that someone passed bad data to DoWork . Now back in the VB6 days, you could simply