stack-unwinding Questions

1

Solved

I have a C++ test program that keeps the CPU busy: #include <cstdint> #include <iostream> // Linear-feedback shift register uint64_t lfsr1(uint64_t max_ix) { uint64_t start_state = 0x...
Petaliferous asked 22/6, 2021 at 9:38

4

Solved

There seem to be a .CFI directive after every line and also there are wide varieties of these ex.,.cfi_startproc , .cfi_endproc etc.. more here. .file "temp.c" .text .globl main .type ...

2

Solved

I found a large array in .pdata segment of RUNTIME_FUNCTION structures by IDA. So, where I can find information: from what it's compiled, how I can create this and how to use it in C++. Give me pl...
Iy asked 6/11, 2013 at 9:25

0

Is it possible to unwind on panic in #![no_std] mode, e.g. with a customized #[panic_handler]?
Sanches asked 1/4, 2019 at 8:57

3

Solved

I have a root view controller A which push segues to a table view controller B. And when a row is selected in B. I want to use an unwind segue to go back to A and pass the text in the row back to t...

4

I handle SIGSEGV by code: int C() { int *i = NULL; *i = 10; // Crash there } int B() { return C(); } int A() { return B(); } int main(void) { struct sigaction handler; memset(&handler...
Evident asked 6/6, 2011 at 15:6

2

Solved

In a typical example of RAII for File I/O on Wikipedia, any errors that occur when closing the file are swallowed: #include <iostream> #include <string> #include <fstream> #incl...
Apostrophize asked 20/2, 2018 at 8:23

2

Uncaught exception behaves differently for main thread and another std::thread. here is the test program #include <thread> class XXX{ public: XXX(){std::fprintf(stderr, "XXX ctor\n");} ~...

3

Solved

The documentation for mem::uninitialized points out why it is dangerous/unsafe to use that function: calling drop on uninitialized memory is undefined behavior. So this code should be, I believe, ...
Ventage asked 28/9, 2016 at 14:45

6

Solved

I expected A::~A() to be called in this program, but it isn't: #include <iostream> struct A { ~A() { std::cout << "~A()" << std::endl; } }; void f() { A a; throw "spam"; } ...
Rochdale asked 21/10, 2008 at 14:52

2

Solved

I'm working on a Rust wrapper for the Duktape JavaScript interpreter. In a normal use case, the call stack will look like this: Rust: Arbitrary application code. Rust: My library wrapper. C: The ...
Adown asked 9/12, 2014 at 17:15

1

Solved

I am debugging my project in VS2015 and an exception is thrown in my code. When I try to set the next statement I get the error message displayed below. When I debug the same solution in VS2013 I a...

2

Solved

Are there major C/C++ implementations where the longjmp function "unwinds", i.e. where it interacts with destructors for automatic-storage objects, __attribute__((__cleanup__(...))), POSIX threads ...
Particiaparticipant asked 28/8, 2014 at 20:23

1

Trying to build my own non-GNU cross-platform C++ environment, I have faced the fact that I don't really understand the basics of the stack unwinding. The environment I build is as follows: l...
Rizzi asked 18/8, 2014 at 5:11

2

Solved

From my understanding, throw is a primative jvm command. When this is called, the JVM "checks if the current call stack can catch it". if it can't, then java simply pops the call stack almost exact...
Endogen asked 31/10, 2012 at 23:16

1

Solved

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() { TR...
Benzedrine asked 25/1, 2014 at 3:56

2

Solved

This is kind of a follow up on Why can't Alexandrescu use std::uncaught_exception() to implement SCOPE_FAIL in ScopeGuard11? I would like to detect if someone is creating MyClass in the destru...
Commandeer asked 18/2, 2013 at 15:34

1

Solved

In order to set up a coherent exception handling interface for my colleagues' and my R scripts, I would like to employ the following tryCatch structure. An outer tryCatch is wrapped around a give...
Fastigiate asked 1/10, 2012 at 11:25

2

Why in the scenario detailed below does the stack space increase in x64 but decrease in x32 with identical code? Background: Our customers can write scripts in a domain language which is interpre...
Pompei asked 29/2, 2012 at 15:50

4

I'm learning PHP classes and exceptions, and, coming from a C++ background, the following strikes me as odd: When the constructor of a derived class throws an exception, it appears that the destru...
Torsibility asked 19/9, 2011 at 12:31

3

I have a simple C++ object that I create at the start of function F() to ensure two matched functions (OpDo, OpUndo) are called at the start and return of the F(), by using the object's constructor...
Phyllys asked 25/10, 2010 at 20:24

1

Solved

I recently stumbled into this this C++/Lua error int function_for_lua( lua_State* L ) { std::string s("Trouble coming!"); /* ... */ return luaL_error(L,"something went wrong"); } The error is...
Edgebone asked 23/10, 2010 at 20:14

6

Solved

C++ automagically calls destructors of all local variables in the block in reverse order regardless of whether the block is exited normally (control falls through) or an exception is thrown. Looks...
Tripper asked 9/4, 2010 at 5:52

4

As far as I know, in case of an uncaught exception, C++ destroys the local variables immediately, Java releases the references and leaves the rest for the garbage collector. Is this right? What ex...
Lynd asked 31/3, 2010 at 8:35

4

Solved

While answering this question I noticed that I got the following dialog while atempting to move the "cursor" while an exception was being handled: Unable to set the next statement to this locati...
Sixth asked 5/1, 2010 at 11:16

© 2022 - 2024 — McMap. All rights reserved.