Nessesarius / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Segmentation Fault on Windows 7 #282

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Fresh Cygwin install with mintty package.
2. Launch mintty from Cygwin shell
3. Segmentation fault.

What is the expected output? What do you see instead?
Mintty window should appear but a segmentation fault message is shown.

What versions of mintty, Cygwin/MSYS, and Windows are you using?
- mintty 1.0.1 from up to date cygwin setup.exe
- CYGWIN_NT-6.1-WOW64 machine1 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
- Win 7 Enterprise 64 bits.

Please provide any additional information below.

The segfault happens when I launch mintty from the cygwin default shell. A 
stackdump file is created in my home (current) directory.

If I try to launch from the Start Menu Shortcut that cygwin created, it opens a 
black window and the shell (default, bash) never shows. A stackdump file is 
created in /bin/ (default mintty location).

mintty.exe.stackdump:

Exception: STATUS_ACCESS_VIOLATION at eip=61004272^M
eax=0000029C ebx=0000029C ecx=00000000 edx=61212E98 esi=00000000 edi=00000000^M
ebp=FFFFFFFF esp=00AECD70 program=C:\cygwin\bin\mintty.exe, pid 4768, thread 
unknown (0x13C8)^M
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B^M
Stack trace:^M
Frame     Function  Args^M
End of stack trace

Original issue reported on code.google.com by jmlacr...@gmail.com on 26 Jul 2011 at 3:49

GoogleCodeExporter commented 8 years ago
Ouch. I haven't managed to reproduce this yet though. Could you attach your 
~/.minttyrc? Also, were you successfully running previous versions of mintty? 
And does the problem go away if you downgrade to 0.9.9 (by repeatedly clicking 
on the mintty version in setup.exe)?

Original comment by andy.koppe on 26 Jul 2011 at 6:36

GoogleCodeExporter commented 8 years ago
Just installed mintty-0.9.9 as suggested, I still get the segfault.

I've never been able to run mintty on this computer. I can't even "mintty -V", 
it crashes before.

I downloaded the sources tarball and built it locally and the problem still 
happens. Is there a debug mode I could activate to get more logging?

Attached: .minttyrc

Original comment by jmlacr...@gmail.com on 26 Jul 2011 at 7:03

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for getting back so quickly. Glad this isn't a regression from 0.9.9.

You can build a debug version with 'make debug=1' (after doing a 'make clean'). 
Unfortunately I just noticed that this fails due to an obsolete assert in 
term.c that I forgot to remove, so you need to either remove that yourself, or 
check out the latest sources like so:

svn co http://mintty.googlecode.com/svn/trunk mintty

Once you get a stackdump from that, you can feed the function addresses in it 
through 'addr2line -e mintty.exe' to obtain source positions.

Original comment by andy.koppe on 26 Jul 2011 at 7:18

GoogleCodeExporter commented 8 years ago
I used 'make debug=1' but I still can't get a stack trace.I even deleted the 
whole directory to make sure I did not have old files.

I also tried to run it through gdb, but It's not a tool I understand well so I 
can't really be helpful with it.

Here's the output of the stackdump and gdb.

PS: I'm on a corporate computer with some limitations, but I'm an admin on my 
machine.

mintty.exe.stackdump:

Exception: STATUS_ACCESS_VIOLATION at eip=61004272
eax=0000029C ebx=0000029C ecx=00000000 edx=61212E98 esi=00000000 edi=00000000
ebp=FFFFFFFF esp=00C1CD70 
program=C:\cygwin\home\user\tmp\mintty-1.0.1\mintty.exe, pid 3008, thread 
unknown (0x1E4C)
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame     Function  Args
End of stack trace

gdb output:

[New thread 4616.0xce4]
Error: dll starting at 0x77a90000 not found.
Error: dll starting at 0x77800000 not found.
Error: dll starting at 0x77a90000 not found.
Error: dll starting at 0x77990000 not found.
[New thread 4616.0x1f94]
[New thread 4616.0x1dbc]
      0 [unknown (0x1F94)] mintty 4616 exception::handle: Exception: STATUS_ACCE
SS_VIOLATION
    864 [unknown (0x1F94)] mintty 4616 open_stackdumpfile: Dumping stack trace t
o mintty.exe.stackdump

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 4616.0x1f94]
0x61004272 in _cygtls::remove () from /usr/bin/cygwin1.dll

Original comment by jmlacr...@gmail.com on 26 Jul 2011 at 8:37

GoogleCodeExporter commented 8 years ago
Hmm. The 'dll not found' errors are normal, apparently, i.e. I get those too. 
Strange that there are no stackframes though.

One more suggestion: build with 'make debug=1 dmalloc=1' to enable heap 
debugging. Do 'export DMALLOC_OPTIONS=debug=0x4f48d03' to activate it before 
invoking mintty. (It will run rather slowly.)

If that doesn't turn up anything, can you take this to the Cygwin mailing list 
for further ideas?

Original comment by andy.koppe on 27 Jul 2011 at 7:38

GoogleCodeExporter commented 8 years ago
I tried your suggestion and it did not produce a better stackdump.

It did however help me get useful information to debug using gdb. I've built 
'debug=1 dmalloc=1' and added '-Wl,--enable-auto-import' to my ld_opts debug 
config and I'm now able run it in gdb.

It seems to crash at random moments in the execution when I'm stepping. Is it a 
threading problem? 

I've read that some async exceptions could cause problems under Cygwin, maybe I 
should fix all exceptions of them and see what happens?

I should also note that sometimes, when closing the debugger I'm able to access 
the mintty window and even use it!

Original comment by jmlacr...@gmail.com on 27 Jul 2011 at 4:27

GoogleCodeExporter commented 8 years ago
Mintty itself isn't multi-threaded, but the Cygwin DLL uses threads to 
implement various POSIX facilities, e.g. signals. I'm afraid I've got no idea 
how --enable-auto-import makes a difference.

Random failures? Might be worth checking your system against this list: 
http://cygwin.com/faq/faq.using.html#faq.using.bloda.

Sorry I can't be more help.

Original comment by andy.koppe on 27 Jul 2011 at 6:57

GoogleCodeExporter commented 8 years ago
It do look like other tools segfaults too (just tried cppcheck), so Mintty is 
probably not the culprit.

Thanks for your help, I'll report back when I have more info on the source of 
the problem.

Original comment by jmlacr...@gmail.com on 27 Jul 2011 at 8:51

GoogleCodeExporter commented 8 years ago
Thanks. Closing for now.

Original comment by andy.koppe on 28 Jul 2011 at 5:58