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: 1.7.25, Windows 7: dumper doesn't generate core file


Hi Sam,

On Mar 11 10:35, Sam Liapis@constrainttec.com wrote:
> As a disclaimer I'm new to Cygwin and memory mapping that's alluded
> to in this post.
> 
> My brief was to investigate and resolve an issue with dumper not
> producing a core.
> 
> With that I'll proceed with outlining the journey including my
> findings so far.
> 
> I'll begin with the error message given by dumper when run in verbose mode:
> (Note: I modified debug output to provide base address of excluded memory)
> [,..]
> Code analysis reveals a few shortcomings leading up to this failure.
> Firstly the process of
> identifying sections to exclude, includes sorting and checking that
> regions do not overlap.
> Upon closer inspection the function in question at
> ...winsup/utils/parse_pe.cc appears to
> have a couple of problems.
> 
>     a) "if (q == p + 1)" at line 60 always resolves true bypassing
> subsequent loop code.
> 
>     b) The 'size' parameter at line 63 is a global instead of
> p->size. The test expression
>         should be if (p->base + p->size > q->base) in order to test
> for overlapping regions.

This looks very wrong indeed.

> [...]
> Even if sort_and_check () worked correctly it wouldn't prevent
> dumper failure it just raises an alert.
> 
> Secondly when dumper builds a list of memory regions to dump into a
> core file it has no logic to cater
> for overlapping sections to exclude. Here in lies my first question
> regarding this issue:
> 
> 
> Question 1: SHOULD MEMORY REGIONS IDENTIFIED FOR EXCLUSION EVER OVERLAP?

I can't really answer this question safely, but AFAIK, the answer is
no.  The sections and memory layout in a pe/coff file are so that the
sections have unique VMAs, including debug sections.  An overlap of
sections should never occur, otherwise the Windows loader would have
refused to load the executable into memory anyway.  Unless I'm missing
something...

> Question 2: IS THE CODE MODIFICATION AN ACCEPTABLE SOLUTION TO THE PROBLEM?

Maybe, but first it would be helpful if somebody could explain why
sections should be able to overlap at all.  That's puzzeling me.

As for patches, did you see http://cygwin.com/contrib.html
For small, obvious patches, we don't need the copyright assignment.
Rule of thumb is < 10 lines.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpFErTAytX_2.pgp
Description: PGP signature


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