I am debugging an application in Eclipse Neon on Ubuntu 16.04. My project requires that I generate a core dump (which includes all memory (heap, stack, code segments, etc) for the process under debug) while simultaneously having a debug session for that application.
I tried to use "gcore" from a Terminal while debugging the same application in Eclipse. This gives me:
warning: process 32062 is already traced by process 32032
ptrace: Operation not permitted.
You can't do that without a process to debug.
The program is not being run.
gcore: failed to create core.32062
If I use "gcore" without debugging the application in Eclipse a core dump is produced.
I do not find the option to generate a core dump from within Eclipse ... does that exists? Where to find it? Can I add a plugin which allows me to "execute a gcore" (similar) command from within Eclipse while debugging the application?
Thanks! Hope you can help.
Meanwhile I figured it out. In Eclipse you can select the gdb console tab once you are debugging using the "Debug" perspective. This gdb console is an interactive console (like all other consoles in Eclipse Neon). Here you can just type the command "generate-core-file" which will core dump the memory of the process under debug.
Also good to note is that there is a "suspend" button which you can use to "pauze" your application at any moment in time. After "suspend" you can also create a core dump using "generate-core-file" in the gdb console.
Related
I am trying to remote debug (using gdbserver) an application running on an iMX6. My setup is Ubuntu 16.04 LTS and I'm using QT Creator 3.5.1 (based on 5.5.1 GCC 5.2.1).
The first thing to note is that the QT GDB remote debugger (single stepping) of the iMX6 application layer is working if I remove the system calls. "system(...)" or "read(...)". etc. However, any attempt to do a system call hangs the process. The system call never returns.
The second thing to note is that the application runs just fine when executed from the iMX6 directly (including system calls). I can even use GDB (command line) to debug the application. No problem here.
In QT Creator, I have added the addition GDB commands "set remote system-call-allowed 1" to the additional debugger commands that QT creator runs before launching the application. No success, still hangs. All system calls hang and never return.
Does anyone have any idea whats going on here? Why are my system calls not returning.
This post led me to the answer.
QT: Remote debugging to ARM using QT Creator hangs, command line GDB runs fine
For quick reference I examined the log created by QT. Select Windows->View->Debugger log
In my case, same as in the other post, detach-on-fork was set to off.
Solution was to
Add 'set detach-on-fork on' in QTCreator as part of the Debugger options (Tools->Options...., Debugger: GDB tab: Additional startup commands).
I have a user who is running one of my apps, and he is seeing the app crash. How can I get a crash dump from his computer without asking him to use WinDbg?
I have read other questions, and this was easy to do in Windows XP using Dr. Watson, but it seems that option is not available in Windows 8.1 anymore.
Other answer points to c:\Users\[user]\AppData\Local\Microsoft\Windows\WER\ReportArchive directory, but I only see WER files there.
Any idea how to get crash dumps?
Thanks.
I wrote a program to trap WER crash dumps. I was able to use the keys mentioned in this article to trap the dump file locally. The only subtle requirement was that the program had to run with administrator rights. If you follow this methodology, make sure you run the program again to disable trapping crash reports because changing those keys could affect all future crash dumps for other applications.
ProcDump from SysInternals.
Register as the Just-in-Time (AeDebug) debugger. Makes full dumps in c:\dumps.
C:\>procdump -ma -i c:\dumps
How to use Visual Leak Detector to attach to a process running as a windows service.
If someone has used this tool to detect memory leaks for service, please let me know the procedure.
I am including "vld.h" in my source file as in the documentation nothing else.
Compile your service in debug with vld.h included.
Start your service from the Services Control Manager (no debugger involved yet)
Start Visual Studio - in the Debug Menu select attach to process
Select your process (your service) - make sure to enable native debugging
Stop your service with the debugger still attached and you should get output in the debug window.
The cluster debugging option is removed from Visual studio 2012.
So is there any way to debug MPI apps in VS2012 ?
Visual studio 2012 and later versions do not support MPI debugging. However there is a workaround:
Start debugging by specifying mpiexec.exe as your command and related parameters and the name of your executable as command arguments:
Command-> mpiexec.exe
CommandArguments-> -n 2 myapp.exe
When the execution starts, use Debug->Attach to process... to attach the debugger to one your processes. Sometimes I add a simple press any key to continue logic to my app, just to pause the program until I finish this attaching process.
In order to ease tings you can use an extension called Reattach that lets you attach to the last processed you attached with one button click.
One problem with this workaround is that you cannot select which MPI process you attach :(
Background/Context:
I'm currently developing a touch screen application which is aimed to run on Linux. As a development framework I chose JavaFX (jdk1.7.0_10) due to its rapid prototyping easiness. I'm using Arch Linux (kernel 3.6.10-1-ARCH) distribution and since JavaFX needs a head-full environment to run, I installed Xorg on top of the base configuration. Even thought I'm able to run my JavaFX application, I have some issues with popup windows that are being displayed in my application.
When trying to display those popup windows, sometimes they don't respond as expected or event worse, they crash my application. The error I get is the following:
The program 'java' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 51101 error_code 9 request_code 62 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
By the way, when running the same application on Windows (my development machine), everything works fine.
I also tried to run a composite manager ('xcompmgr') since i was also getting some warnings like
Can't create transparent stage, because your screen doesn't support alpha channel. You need to enable XComposite extension.
but it didn't helped.
Question:
Am i missing some files or configurations in order to run smoothly JavaFX in Linux, or has any one encountered the same challenge? Since my main concern is performance (due to limited hardware specs), I don't want to install a full featured Linux distribution. I only need to run my JavaFX application.
Try running JavaFX in software rendering mode: java -Dprism.order=j2d -jar your.jar
Also note that your platforms seems to be not included into list of supported ones: http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html