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: cygcheck -svc segfaults on Windows 8.1 with cygwin64


On Nov 18 21:35, Gabriel Marcano wrote:
> cygcheck -svc causes a segfault on Windows 8.1 on line 1610 of cygcheck.cc, based on gdb output. I'm including some gdb output below that showcases this issue:
> 
> 
> 1610ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ strcat (osname, products[prod]);
> (gdb) list
> 1605ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (prod == PRODUCT_UNLICENSED)
> 1606ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ strcat (osname, "Unlicensed");
> 1607ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ else if (prod > PRODUCT_PROFESSIONAL_WMC)
> 1608ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ strcat (osname, "");
> 1609ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ else
> 1610ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ strcat (osname, products[prod]);
> 1611ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
> 1612ÂÂÂÂÂÂÂÂÂÂÂÂÂ else
> 1613ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ {
> 1614ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
> (gdb) p prod
> $1 = 101
> (gdb) p sizeof(products)/sizeof(void*)
> $2 = 101
> 
> 
> 'products[prod]' in this case is accessing memory outside of the
> 'products' array. The odd thing is that a few lines back, the
> declaration of products includes 104 elements. I do not know why this
> discrepancy exists-- anyone have a clue?

Yes.  The size of the array is not what you think it is.  The reason is
that several commas are missing.  Since I created this array, it's all
my fault :}  I didn't notice this because I'm using the Enterprise
version which have a product value 4, which is pretty safe.

I'm going to fix this in CVS today, but at the same time I'm also going
to look for a solution to differ between Windows 8 and 8.1 (also 2012
vs. 2012R2) in the cygcheck output.  Right now cygcheck just prints
Windows 8.


Thanks for the report,
Corinna

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

Attachment: pgpdID1yq6NmD.pgp
Description: PGP signature


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