This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cannot get Cygwin to produce a core dump


Craig Johansen wrote:

> Method 1
> 
> Running ./a.exe results in the following error:
> 
> 6 [main] a 5132 _cygtls::handle_exceptions: Error while dumping state
> (probably corrupted stack)
> Segmentation fault (core dumped)
> 
> But there is not core file in my directory

That is not expected to create a core file.  The default action if
error_start is not set is to create a .stacktrace file.  The error says
"core dumped", since that is what upstream bash is designed to print,
since that's what happens on most *nixes.  Perhaps the bash maintainer
could patch this for Cygwin.

> Method 2
> 
> I have added the following to my cygwin.bat file:
> 
> Set CYGWIN=error_start=c:\cygwin\bin\dumper.exe
> 
> Running ./a.exe results in a window to pop-up and reads:
> 
> Setting bfd architecture: No error

The new window means dumper was successfully launched.  The bfd error
means it had some difficulty when trying to create the core file.  You
should try running dumper directly from a prompt to create a core of a
running process and see if you can find out why it's failing.

> Method 3
> 
> I modified the environment variable to be:
> 
> Set CYGWIN=error_start=c:\cygwin\home\MDGCUSTOMER\wrapper_dumper.cmd

I wouldn't expect that to work, since a .cmd file is not directly
executable; it has to be run with the COMSPEC as "cmd.exe file.cmd". 
Explorer hides this fact for you because it uses ShellExecute() and not
CreateProcess(), and the former knows how to look up an extension in the
registry and find out how to run it, whereas CreateProcess requires the
exact command and arguments.  In order for this to work you'd need to
create a wrapper .exe that spawns cmd.exe with the script filename as
argument.

> [6] main a 3248 try_to_debug: Fialed to start debugger, Win32 error 2

This is the CreateProcess error.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]