problem about stack-unwinding-Collection of common programming errors


  • lurscher
    c++ exception-handling shared-ptr stack-unwinding
    is there any pitfall of the following;if (someCondition)throw boost::shared_ptr<SomeException>( new SomeException( “foo!” ) );…catch( const boost::shared_ptr<SomeException>& expRef ){}

  • 12 revs, 3 users 90%Aftershock
    c++ compiler microsoft stack-unwinding
    I have a c++ code, I use MSC9 to compile it. It keeps crashing randomly. For example it crashes if it is called from Perl using “ but it does not crash when It is called from command line or from Ultimate++.I mean calling it from perl eg. f.exe arg1 arg2 arg3Stack trace does not show much. Tracing the program line by line proved that the program fails at the end when returning…So it is like thatint funcname() {return 0; <– crashing after that… }I guess the stack is damaged, and after th

  • sharptooth
    c++ destructor stack-unwinding
    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 like the term stack unwinding only applies to the latter. How is the former process (the normal exit of the block) called concerning destroying local variables?

  • decimus phostle
    c++ exception exception-handling raii stack-unwinding
    TIL that my notions of the ‘inter-twining’ (for the lack of a better word) of RAII & stack-unwinding are/were quite(if not completely) wrong. My understanding was that using RAII, guarded against any/all resource leaks – even ones potentially caused by unhandled exceptions. However writing this test program and subsequently stumbling upon this article/documentation, made me realize that stack unwinding would only cause the RAII-enabled resource deallocation to kick in for automatic’s within

  • ihamer
    c++ stack stack-unwinding
    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 and destructor. However, I don’t want the operation to be undone in case an exception was thrown within the body of F(). Is this possible to do cleanly? I have read about std::uncaught-exception, but its use does not seem to be recommended.

  • baskan
    java c++ stack-unwinding
    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 exactly is the difference between Java and C++ on this issue? in other words, which of these two languages is considered better in terms of stack unwinding issue? 🙂

  • Avio
    linker stack-trace undefined-reference undefined-symbol stack-unwinding
    /mnt/workspace/testproject/misc-libs/libunwind.a(Lresume.o): In function `_ULx86_local_resume’: (.text+0x4a): warning: warning: sigreturn is not implemented and will always failI’m getting this warning about libunwind when linking my project with -static flag enabled. Looking at this symbol inside the installed libunwind libraries, it seems that it’s actually undefined./usr/lib/libunwind.aU sigreturn /usr/lib/libunwind-generic.aU sigreturn /usr/lib/libunwind-x86.aU sigreturnAnd these are the lib

  • lcbrevard
    porting freebsd endianness configure stack-unwinding
    libunwind is available as a package (pkg_add -r libunwind) on FreeBSD 8.1 amd64.It is not available that way on FreeBSD 8.1 i386.When I download from http://www.nongnu.org/libunwind/ I cannot build it.The error is In file included from ptrace/_UPT_elf.c:4: ../include/libunwind_i.h:65:5: error: #error Host has unknown byte-order. * Error code 1This appears to be a ./configure error. Is there a way to force this information at configuration time?