public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump
@ 2016-03-20  8:46 Ivan Pozdeev
  2016-03-20 12:47 ` Marco Atzeri
  2016-03-22  9:53 ` Jon Turney
  0 siblings, 2 replies; 4+ messages in thread
From: Ivan Pozdeev @ 2016-03-20  8:46 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1615 bytes --]

bash
----
I'm being plagued by these crashes for about half a month now.
Specifically, it cannot run any `configure' script.
The crashes appear to happen in child bash/sh processes launched while 
processing backticks. Other times, commands with stream redirection fail 
silently or produce nothing. Simple commands or very short scripts do 
not fail.

On trying to open `sh.exe.core', gdb 1.10 crashes, too; gdb 1.9 says 
"get_core_register_section: Assertion `core_vec' failed" (see 
attachment). So I'm unable to diagnose bash's problem right now.

At another machine with the same packages, bash does not fail, but gdb's 
problem stands. Already tried reinstalling all the packages `bash' 
depends on and itself to no effect.

gdb
---
I managed to debug the gdb session with VisualGDB (trial).
It turns out, the root cause is that the /bin/sh executable is x64, but 
the core file `sh.exe.core' - of the same executable - has i386 format!
(objdump: <...>sh.exe.core:     file format elf32-i386)

And gdb doesn't check that. Created ticket (incl. patch):
https://sourceware.org/bugzilla/show_bug.cgi?id=19834

Now I'm stumped. How can this be?! Does this mean `dumper' is faulty?
If this was normal, gdb would likely be able to process the dumps.

further action
--------------
Since the crash dump is unusable, I'm now going the only way available, 
checking `dumper''s workings (this needs to be done anyway)

summary
-------
Writing this primarily to alert the community of these apparent critical 
bugs.
Hints on where to look inside `dumper' would be more than welcome, too.

--
Regards,
Ivan Pozdeev







[-- Attachment #2: gdb.out --]
[-- Type: text/plain, Size: 1669 bytes --]

$ gdb /bin/sh UU/sh.exe.core
GNU gdb (GDB) Cygwin 7.9.1-1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /bin/sh...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
[New Thread 0x1288]
[New Thread 0x2f38]
/wip/cygport-git/gdb/gdb-7.9.1-1.x86_64/src/gdb-7.9.1/gdb/corelow.c:542: internal-error: get_core_register_section: Assertion `core_vec' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/wip/cygport-git/gdb/gdb-7.9.1-1.x86_64/src/gdb-7.9.1/gdb/corelow.c:542: internal-error: get_core_register_section: Assertion `core_vec' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
*** starting debugger for pid 6248, tid 9044
*** continuing pid 6248 from debugger call (1)
Aborted (core dumped)

[-- Attachment #3: cygcheck.out.gz --]
[-- Type: application/gzip, Size: 15990 bytes --]

[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump
  2016-03-20  8:46 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump Ivan Pozdeev
@ 2016-03-20 12:47 ` Marco Atzeri
  2016-03-21  0:21   ` Ivan Pozdeev
  2016-03-22  9:53 ` Jon Turney
  1 sibling, 1 reply; 4+ messages in thread
From: Marco Atzeri @ 2016-03-20 12:47 UTC (permalink / raw)
  To: cygwin

On 20/03/2016 10:05, Ivan Pozdeev wrote:
> bash
> ----
> I'm being plagued by these crashes for about half a month now.
> Specifically, it cannot run any `configure' script.
> The crashes appear to happen in child bash/sh processes launched while
> processing backticks. Other times, commands with stream redirection fail
> silently or produce nothing. Simple commands or very short scripts do
> not fail.

Any BLODA around ?

> On trying to open `sh.exe.core', gdb 1.10 crashes, too; gdb 1.9 says
> "get_core_register_section: Assertion `core_vec' failed" (see
> attachment). So I'm unable to diagnose bash's problem right now.
>
> At another machine with the same packages, bash does not fail, but gdb's
> problem stands. Already tried reinstalling all the packages `bash'
> depends on and itself to no effect.
>
> gdb
> ---
> I managed to debug the gdb session with VisualGDB (trial).
> It turns out, the root cause is that the /bin/sh executable is x64, but
> the core file `sh.exe.core' - of the same executable - has i386 format!
> (objdump: <...>sh.exe.core:     file format elf32-i386)

Are you sure about the 64 bit dumper ?
https://www.cygwin.com/cygwin-ug-net/dumper.html


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump
  2016-03-20 12:47 ` Marco Atzeri
@ 2016-03-21  0:21   ` Ivan Pozdeev
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Pozdeev @ 2016-03-21  0:21 UTC (permalink / raw)
  To: cygwin



20.03.2016 15:47, Marco Atzeri пишет:
> On 20/03/2016 10:05, Ivan Pozdeev wrote:
>> bash
>> ----
>> I'm being plagued by these crashes for about half a month now.
>> Specifically, it cannot run any `configure' script.
>> The crashes appear to happen in child bash/sh processes launched while
>> processing backticks. Other times, commands with stream redirection fail
>> silently or produce nothing. Simple commands or very short scripts do
>> not fail.
>
> Any BLODA around ?
None that I managed to find (checked with AVZ for interceptors, autoruns 
from a boot disk for suspicious entries, procmon for 3rd-party drivers 
in call chain).
There might be something from hardware drivers, but none were installed 
two weeks ago.
>
>> On trying to open `sh.exe.core', gdb 1.10 crashes, too; gdb 1.9 says
>> "get_core_register_section: Assertion `core_vec' failed" (see
>> attachment). So I'm unable to diagnose bash's problem right now.
>>
>> At another machine with the same packages, bash does not fail, but gdb's
>> problem stands. Already tried reinstalling all the packages `bash'
>> depends on and itself to no effect.
>>
>> gdb
>> ---
>> I managed to debug the gdb session with VisualGDB (trial).
>> It turns out, the root cause is that the /bin/sh executable is x64, but
>> the core file `sh.exe.core' - of the same executable - has i386 format!
>> (objdump: <...>sh.exe.core:     file format elf32-i386)
>
> Are you sure about the 64 bit dumper ?
> https://www.cygwin.com/cygwin-ug-net/dumper.html
There's only one copy on my system and it's a 64-bit exe:
$ which dumper
/usr/bin/dumper
$ cygcheck -f `which dumper`
cygwin-2.4.1-1
$ objdump -h `which dumper` | head
/usr/bin/dumper:     file format pei-x86-64
<...>
Already tried reinstalling the package as well as trying other versions 
available (2.3.1 and 2.5.0).
specifying full windows-style path to the exe as `man dumper' says 
doesn't change anything.
>
>
> -- 
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

-- 
Regards,
Ivan


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump
  2016-03-20  8:46 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump Ivan Pozdeev
  2016-03-20 12:47 ` Marco Atzeri
@ 2016-03-22  9:53 ` Jon Turney
  1 sibling, 0 replies; 4+ messages in thread
From: Jon Turney @ 2016-03-22  9:53 UTC (permalink / raw)
  To: cygwin; +Cc: Ivan Pozdeev

On 20/03/2016 09:05, Ivan Pozdeev wrote:
> gdb
> ---
> I managed to debug the gdb session with VisualGDB (trial).
> It turns out, the root cause is that the /bin/sh executable is x64, but
> the core file `sh.exe.core' - of the same executable - has i386 format!
> (objdump: <...>sh.exe.core:     file format elf32-i386)
>
> And gdb doesn't check that. Created ticket (incl. patch):
> https://sourceware.org/bugzilla/show_bug.cgi?id=19834
>
> Now I'm stumped. How can this be?! Does this mean `dumper' is faulty?
> If this was normal, gdb would likely be able to process the dumps.
>
> summary
> -------
> Writing this primarily to alert the community of these apparent critical
> bugs.
> Hints on where to look inside `dumper' would be more than welcome, too.

This is clearly a bug in dumper, which doesn't look like it's been 
ported to x86_64. See [1]

Ideally gdb wouldn't crash when presented with such an invalid core dump.

The strangeness which is a cygwin core dump doesn't appear to be 
documented anywhere but in the source code of dumper, but it is an elf 
file containing the memory image of the dumper process, with elf notes 
containing various Win32 API status structures.

[1] 
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/utils/dumper.cc;hb=HEAD#l628


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-22  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-20  8:46 2.4-2.5 x64: bash crashes on backticks, gdb crashes on opening core dump Ivan Pozdeev
2016-03-20 12:47 ` Marco Atzeri
2016-03-21  0:21   ` Ivan Pozdeev
2016-03-22  9:53 ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).