callstack

Backtracing on Linux 64 bit from Signal Handler with malloc/free on callstack

我与影子孤独终老i 提交于 2019-12-12 12:15:01
问题 Below is an example of source I want to use on a machine running "Red Hat Enterprise Linux 5.5 (Tikanga) Kernel 2.6.18-194.el5xen x86_64" OS. The general idea is that I want to have backtrace of some thread, so I am raising a SIGUSR1 signal for that thread and a handler does a backtrace() call. In my scenario as below, FrameTwo function calls malloc and free in a loop. Whenever the signal is raised for this particular thread and free or malloc is on the callstack, the progream crashes when

How do I pass arguments to C++ functions when I call them from inline assembly

谁说我不能喝 提交于 2019-12-12 08:33:46
问题 So, I would like to be able to call functions from a c++ dll. For certain reasons, I would like to call them from an __asm block in my C++ code. My question is this: I know that before I call the function, I have to push its arguments on the stack in the order specified by the function's calling convention.However, can i simply do something like this: int a=5; double b = 5.0; __asm{ push b push a call functionAddress } What worries me is the fact that I seem to remember that the standard word

C++ Stack Tracing issue

ぃ、小莉子 提交于 2019-12-12 08:07:56
问题 I am working on a class which I would like to use to log the current Call Stack on computers with Windows Vista/7. (Very similar to “Walking the callstack” http://www.codeproject.com/Articles/11132/Walking-the-callstack). First I used RtlCaptureContext to get the current context record then I used StackWalk64 to get the individual stack frames. Now, I realized that the Program counter in STACKFRAME64.AddrPC actually changes for a specific code line whenever I close my program and start it

Stack resident buffer overflow on 64-bit?

爱⌒轻易说出口 提交于 2019-12-12 07:14:28
问题 I'm studying some security related things and right now I'm playing around with my own stack. What I'm doing should be very trivial, I'm not even trying to execute the stack, simply to show that I can get control over the instruction pointer on my 64-bit system. I have turned off all protection mechanisms I'm aware of just to be able to play with it (NX-bit, ASLR, also compiling with -fno-stack-protector -z execstack). I don't have that much experience with 64-bit assembly and after spending

“Debug error R6010 - abort() has been called” - How to debug?

白昼怎懂夜的黑 提交于 2019-12-12 06:15:16
问题 At completely random times during runtime, my program crashes with the error in the title. The error occurs without any user inputs or indication as to why, which makes it difficult to debug. The Call Stack doesn't help either: msvcr120d.dll!00007ffa9f8b7642() Unknown msvcr120d.dll!00007ffa9f9e2044() Unknown msvcr120d.dll!00007ffa9f9a8c98() Unknown msvcp120d.dll!00007ffaa7273340() Unknown msvcr120d.dll!00007ffa9f9baf90() Unknown msvcr120d.dll!00007ffa9f9aafe2() Unknown ntdll.dll

Set Java call stack

一曲冷凌霜 提交于 2019-12-11 19:28:24
问题 is it possible to modify/access the Java call stack ? For instance saving and restoring ? I'm thinking about implementing cooperative multitaskting (especially I/O) just like gevent for python or haskell (which does this natively). The async callback spaghetti mess can't be the best solution. 回答1: The simplest solution is to have multiple threads. You can have up to 10,000 threads running efficiently on a server. If you need much more than this, I would suggest either a) buying a second

Unlimited stack cannot grow beyond the initial 132KiB if MAP_FIXED involved?

不羁的心 提交于 2019-12-11 19:08:43
问题 I'm running some experiments with stack and the following got me stuck. It can be seen that Linux has initial [stack] mapping 132KiB in size. In case of ulimit -s unlimited we can expand the stack any further if we adjust rsp accordingly. So I set ulimit -s unlimited and ran the following program: PAGE_SIZE equ 0x1000 ;mmap staff PROT_READ equ 0x01 PROT_WRITE equ 0x02 MAP_ANONYMOUS equ 0x20 MAP_PRIVATE equ 0x02 MAP_FIXED equ 0x10 ;syscall numbers SYS_mmap equ 0x09 SYS_exit equ 0x3c section

How to simulate a call stack in JavaScript using only a single array

回眸只為那壹抹淺笑 提交于 2019-12-11 16:04:46
问题 I am looking at the Wikipedia page on Call Stack, and trying to grok this image: This is as far as I get lol: const memory = [] memory[0] = 3 // top of stack pointer memory[1] = 4 // stackframe pointer memory[2] = 1000 // max call stack size memory[3] = 5 // first frame memory[4] = 0 // first frame return address (exit let's say) But let's say we have 2 actions: add == 1 , and load == 2 , plus whatever is required to do the stack manipulation. How do i feed it a stream of data to execute some

iOS 8 UIApplicationMain crash since SDK 8 update

余生长醉 提交于 2019-12-11 07:18:27
问题 Since I updated Xcode to 6.0.1 and iOS SDK to 8.0 my app no longer work on the device (running iOS 8 ofc). But it works perfectly in the simulator. The app crashes in UIApplicationMain before any call to the delegate has ever happened. It seems either a value or key is null at CFTypeCollectionRetain. I've tried Recreating certificates/provision profiles. Re-built with/without ARC. Tested both armv7 and arm64 builds. Xcode template (Game) application compiles and runs without probs. Things to

Display callstack without method names

爷,独闯天下 提交于 2019-12-11 06:56:11
问题 In WinDbg, I can get the callstack using the k command. For DLLs without symbols, it displays an incorrect method name and a large offset, e.g. 0018f9f0 77641148 syncSourceDll_x86!CreateTimerSyncBridge+0xc76a Since I don't have symbols, I have to give this information to the developer of the DLL. I don't know who will work on the bug and how much debugging knowledge he has. I want to avoid that the developer thinks the problem is in the CreateTimerSyncBridge() method. Is there a way to get