Questions tagged [stack-unwinding]

Stack-unwind will pop the top frame of the stack, depending on the language it may occur e.g. at the end of a code block, when returning from a called function, or during exception handling.

Stack-unwind will pop the top frame of the stack. Depending on the language this may occur e.g. at the end of a code block, when returning from a called function, or during exception handling.

Related tags: .

Related Q/A:

References:

128 questions
1
vote
0 answers

Why does the program terminates abruptly?

#include using namespace std; class B { public: ~B() { throw 42; } }; int main() { try { B obj; throw 32; } catch( int i ) { cout<
Dinesh Gowda
  • 1,044
  • 3
  • 13
  • 29
1
vote
1 answer

_Unwind_ and unw_ functions (LLVM's libunwind)

I'm new to the LLVM's libunwind library. Could you please tell me what's the purpose and the difference of the two sets of functions that libunwind provides: functions with the prefix _Unwind_ functions with the prefix unw_
embedc
  • 1,485
  • 1
  • 6
  • 20
1
vote
1 answer

stack unwinding in dwarf2

I don't understand that how the stack unwinding in dwarf2 ensures reliable recovery of arguments in some very basic ABI(Application Binary Interface) scenarios. Consider a ABI, which says that the first three arguments have to be on registers and…
bbv
  • 501
  • 1
  • 5
  • 14
1
vote
3 answers

throwing a boost::shared_ptr< customException>

is there any pitfall of the following; if (someCondition) throw boost::shared_ptr( new SomeException( "foo!" ) ); ... catch( const boost::shared_ptr& expRef ) { }
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
vote
0 answers

Breaking a stack/call frame information chain on ELF/Linux?

I'm trying to do a rather niche thing which is essentially breaking the CFI (Call Frame Information in DWARF EH info) and rbp & rsp links between frames. Main reason for that is that is that past a certain point in thread control flow I want to do …
Kristina
  • 15,859
  • 29
  • 111
  • 181
1
vote
1 answer

Is there a way to get DisableUserModeCallbackFilter to work in Windows 10?

Is there any way to get DisableUserModeCallbackFilter (or similar) to work on Windows 10? It's supposed to allow exceptions thrown from user-mode code to propagate across user/kernel boundaries, and it had a hotfix on earlier Windows versions up to…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
1 answer

unw_init_remote failed with UNW_EBADREG

On android, while collecting traces of a particular native process, I observed that the backtrace of a particular thread of the process was not collected(libunwind is used to collect the backtrace). First attempt: 12-29 20:47:20.902 13088 13088 W…
sg1993
  • 335
  • 2
  • 19
1
vote
2 answers

How to implement proper stack unwinding and raii when thrown a bad_alloc during construction

So I'm designing a class that's gonna be handling a bunch of memory and I want to make sure it unwinds properly if something goes wrong during memory allocation in it's constructor. Here's what I've got: class foo{ public: foo(): var1(nullptr),…
wbrege
  • 11
  • 1
1
vote
0 answers

Is it safe to iterate through a stack frame?

In my previous question, I was trying to see if I could programmatically obtain a stack trace of a child process from its parent. I've successfully done so, but now another question has arisen in my mind - is it safe to directly examine these frames…
tonysdg
  • 1,335
  • 11
  • 32
1
vote
1 answer

gdb ARM Cortex-M exception Unwinding

I have been working with some Cortex-M4 (Freescale K60) devices with a compiled by me GCC (v4.7.2), BinUtils (v2.22), Newlib (v1.20) and GDB (v7.5). I have always been annoyed by GDB's inability to unwind from hard exceptions. recently I had an…
norton256
  • 33
  • 6
1
vote
1 answer

stack unwinding in exception c++

I started to learn the subject of exceptions in C++. I encountered the term "stack unwinding" which means, to my understanding, that whenever exception is thrown, and there is no catch block inside the "throwing function", the function stack will…
Day_Dreamer
  • 3,311
  • 7
  • 34
  • 61
1
vote
2 answers

Throwing exception that has const reference to local variable

What happens to the local variables during stack unwinding, that are referenced in exception? Consider following code: class bar; class my_error { public: my_error(const bar& bar) : _bar(bar) {} const bar& get_bar() const { return _bar;…
Sasa
  • 1,597
  • 4
  • 16
  • 33
1
vote
0 answers

Make a unwind segue from any source to origin of IBAction Unwind

I'm performing a unwind action segue from a View Controller so when it's pressed it will go to Call history example: Call History > Profile Detail > Calling ( this way it works ) Search > Profile Detail > Calling ( This way does execute the cancel…
Eddwin Paz
  • 2,842
  • 4
  • 28
  • 48
1
vote
3 answers

Why are the fields of the class automatic objects?

During my studing exeption's mechanism I found that there are calls of destructors for fields of the object while stack's unwinding. Let me explain explicitly: class X { File_ptr aa; Lock_ptr bb; public: X(const char* x,const char*…
1
vote
1 answer

Destructors not executed (no stack unwinding) when exception is thrown

I found a very very weird behaviour that I have never seen before. I'm working on a complex VS2005 C++ project. class Tester { public: Tester() { TRACE("Construct Tester"); } ~Tester() { TRACE("~Destruct…
Elmue
  • 7,602
  • 3
  • 47
  • 57
1 2 3
8 9