Re: [E-devel] Eet testsuite failures

2013-01-13 Thread Cedric BAIL
On Sat, Jan 12, 2013 at 8:22 PM, Albin Tonnerre
albin.tonne...@gmail.com wrote:
 On Tue, Jan 8, 2013 at 11:18 PM, Gustavo Sverzut Barbieri
 barbi...@profusion.mobi wrote:
 Hi Lutin,

 both seem correct to me. Let's wait for others to chime in, but they should
 be okay.

 I'd like to upload those fixes to Debian soon, so now would be a good
 time for anyone who'd like to object :)

Yep, you can. They are also now in svn and backported.
--
Cedric BAIL

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Eet testsuite failures

2013-01-12 Thread Albin Tonnerre
On Tue, Jan 8, 2013 at 11:18 PM, Gustavo Sverzut Barbieri
barbi...@profusion.mobi wrote:
 Hi Lutin,

 both seem correct to me. Let's wait for others to chime in, but they should
 be okay.

I'd like to upload those fixes to Debian soon, so now would be a good
time for anyone who'd like to object :)
--
Albin

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Eet testsuite failures

2013-01-08 Thread Albin Tonnerre
Hi,

I recently uploaded Eet 1.7.4 to Debian; this was the first version to
have the testsuite enabled and to my suprise, it failed on all
bigendian architectures
(https://buildd.debian.org/status/package.php?p=eetsuite=experimental)

I tried to find the cause of the issue, and it would seem there's a
code path in eet_data_image_lossless_compressed_convert that fails to
appropriately convert the input data to little endian before
compressing it; this data is then uncompressed in
_eet_data_image_decode_inside and, on bigend machines, converted
back to bigend which obviously yields incorrect results.

I've used the following patch to solve the issue, but since I'm no eet
expert I'd gladly appreciate any input :)

diff --git a/src/lib/eet_image.c b/src/lib/eet_image.c
index 7116a3c..5a37bf2 100644
--- a/src/lib/eet_image.c
+++ b/src/lib/eet_image.c
@@ -746,13 +746,26 @@ eet_data_image_lossless_compressed_convert(int
  *size,

{
   unsigned char *d, *comp;
-  int *header, ret, ok = 1;
+  int *header, *bigend_data, ret, ok = 1;
   uLongf buflen = 0;

   buflen = (((w * h * 101) / 100) + 3) * 4;
   ret = LZ4_compressBound((w * h * 4));
   if ((ret  0)  ((uLongf)ret  buflen)) buflen = ret;
-
+
+  if (_eet_image_words_bigendian)
+{
+   int i;
+   int *bigend_data = (int *) malloc(w * h * 4);
+
+   if (!bigend_data) return NULL;
+
+   memcpy(bigend_data, data, w * h * 4);
+   for (i = 0; i  w * h; i++) SWAP32(bigend_data[i]);
+
+   data = (const char *) bigend_data;
+}
+
   comp = malloc(buflen);
   if (!comp) return NULL;

@@ -803,6 +816,7 @@ eet_data_image_lossless_compressed_convert(int
*size,
unsigned int i;

for (i = 0; i  8; i++) SWAP32(header[i]);
+   free(bigend_data);
 }

   memcpy(d + (8 * sizeof(int)), comp, buflen);



On a related matter, the testsuite also dies with SIGBUS on SPARC due
to what seems to be an arbitrarily-aligned void* used as an int* in
eet_cipher. The following patch fixes the issue for me:

diff --git a/src/lib/eet_cipher.c b/src/lib/eet_cipher.c
index 3317538..4e1433c 100644
--- a/src/lib/eet_cipher.c
+++ b/src/lib/eet_cipher.c
@@ -706,9 +706,13 @@ eet_identity_check(const void   *data_base,
  return NULL;

/* Get the header */
-   magic = ntohl(header[0]);
-   sign_len = ntohl(header[1]);
-   cert_len = ntohl(header[2]);
+   memcpy(magic,header, sizeof(int));
+   memcpy(sign_len, header+1, sizeof(int));
+   memcpy(cert_len, header+2, sizeof(int));
+
+   magic = ntohl(magic);
+   sign_len = ntohl(sign_len);
+   cert_len = ntohl(cert_len);

/* Verify the header */
if (magic != EET_MAGIC_SIGN)


Please let me know if you want me to rework the patches, submit them
with ChangeLog entries for the stable releases or whatever :)

Cheers,
--
Albin

--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Eet testsuite failures

2013-01-08 Thread Gustavo Sverzut Barbieri
Hi Lutin,

both seem correct to me. Let's wait for others to chime in, but they should
be okay.


On Tue, Jan 8, 2013 at 8:11 PM, Albin Tonnerre lu...@debian.org wrote:

 Hi,

 I recently uploaded Eet 1.7.4 to Debian; this was the first version to
 have the testsuite enabled and to my suprise, it failed on all
 bigendian architectures
 (https://buildd.debian.org/status/package.php?p=eetsuite=experimental)

 I tried to find the cause of the issue, and it would seem there's a
 code path in eet_data_image_lossless_compressed_convert that fails to
 appropriately convert the input data to little endian before
 compressing it; this data is then uncompressed in
 _eet_data_image_decode_inside and, on bigend machines, converted
 back to bigend which obviously yields incorrect results.

 I've used the following patch to solve the issue, but since I'm no eet
 expert I'd gladly appreciate any input :)

 diff --git a/src/lib/eet_image.c b/src/lib/eet_image.c
 index 7116a3c..5a37bf2 100644
 --- a/src/lib/eet_image.c
 +++ b/src/lib/eet_image.c
 @@ -746,13 +746,26 @@ eet_data_image_lossless_compressed_convert(int
   *size,

 {
unsigned char *d, *comp;
 -  int *header, ret, ok = 1;
 +  int *header, *bigend_data, ret, ok = 1;
uLongf buflen = 0;

buflen = (((w * h * 101) / 100) + 3) * 4;
ret = LZ4_compressBound((w * h * 4));
if ((ret  0)  ((uLongf)ret  buflen)) buflen = ret;
 -
 +
 +  if (_eet_image_words_bigendian)
 +{
 +   int i;
 +   int *bigend_data = (int *) malloc(w * h * 4);
 +
 +   if (!bigend_data) return NULL;
 +
 +   memcpy(bigend_data, data, w * h * 4);
 +   for (i = 0; i  w * h; i++) SWAP32(bigend_data[i]);
 +
 +   data = (const char *) bigend_data;
 +}
 +
comp = malloc(buflen);
if (!comp) return NULL;

 @@ -803,6 +816,7 @@ eet_data_image_lossless_compressed_convert(int
 *size,
 unsigned int i;

 for (i = 0; i  8; i++) SWAP32(header[i]);
 +   free(bigend_data);
  }

memcpy(d + (8 * sizeof(int)), comp, buflen);



 On a related matter, the testsuite also dies with SIGBUS on SPARC due
 to what seems to be an arbitrarily-aligned void* used as an int* in
 eet_cipher. The following patch fixes the issue for me:

 diff --git a/src/lib/eet_cipher.c b/src/lib/eet_cipher.c
 index 3317538..4e1433c 100644
 --- a/src/lib/eet_cipher.c
 +++ b/src/lib/eet_cipher.c
 @@ -706,9 +706,13 @@ eet_identity_check(const void   *data_base,
   return NULL;

 /* Get the header */
 -   magic = ntohl(header[0]);
 -   sign_len = ntohl(header[1]);
 -   cert_len = ntohl(header[2]);
 +   memcpy(magic,header, sizeof(int));
 +   memcpy(sign_len, header+1, sizeof(int));
 +   memcpy(cert_len, header+2, sizeof(int));
 +
 +   magic = ntohl(magic);
 +   sign_len = ntohl(sign_len);
 +   cert_len = ntohl(cert_len);

 /* Verify the header */
 if (magic != EET_MAGIC_SIGN)


 Please let me know if you want me to rework the patches, submit them
 with ChangeLog entries for the stable releases or whatever :)

 Cheers,
 --
 Albin


 --
 Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
 and more. Get SQL Server skills now (including 2012) with LearnDevNow -
 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only - learn more at:
 http://p.sf.net/sfu/learnmore_122512
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel




-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Eet testsuite failures

2013-01-08 Thread Leandro Dorileo
Hi,

On Tue, Jan 08, 2013 at 08:18:11PM -0200, Gustavo Sverzut Barbieri wrote:
 Hi Lutin,
 
 both seem correct to me. Let's wait for others to chime in, but they should
 be okay.
 
 
 On Tue, Jan 8, 2013 at 8:11 PM, Albin Tonnerre lu...@debian.org wrote:
 
  Hi,
 
  I recently uploaded Eet 1.7.4 to Debian; this was the first version to
  have the testsuite enabled and to my suprise, it failed on all
  bigendian architectures
  (https://buildd.debian.org/status/package.php?p=eetsuite=experimental)
 
  I tried to find the cause of the issue, and it would seem there's a
  code path in eet_data_image_lossless_compressed_convert that fails to
  appropriately convert the input data to little endian before
  compressing it; this data is then uncompressed in
  _eet_data_image_decode_inside and, on bigend machines, converted
  back to bigend which obviously yields incorrect results.
 
  I've used the following patch to solve the issue, but since I'm no eet
  expert I'd gladly appreciate any input :)
 
  diff --git a/src/lib/eet_image.c b/src/lib/eet_image.c
  index 7116a3c..5a37bf2 100644
  --- a/src/lib/eet_image.c
  +++ b/src/lib/eet_image.c
  @@ -746,13 +746,26 @@ eet_data_image_lossless_compressed_convert(int
*size,
 
  {
 unsigned char *d, *comp;
  -  int *header, ret, ok = 1;
  +  int *header, *bigend_data, ret, ok = 1;
 uLongf buflen = 0;
 
 buflen = (((w * h * 101) / 100) + 3) * 4;
 ret = LZ4_compressBound((w * h * 4));
 if ((ret  0)  ((uLongf)ret  buflen)) buflen = ret;
  -
  +
  +  if (_eet_image_words_bigendian)
  +{
  +   int i;
  +   int *bigend_data = (int *) malloc(w * h * 4);


Shadowed declaration of bigend_data here.


  +
  +   if (!bigend_data) return NULL;
  +
  +   memcpy(bigend_data, data, w * h * 4);
  +   for (i = 0; i  w * h; i++) SWAP32(bigend_data[i]);
  +
  +   data = (const char *) bigend_data;
  +}
  +
 comp = malloc(buflen);
 if (!comp) return NULL;
 
  @@ -803,6 +816,7 @@ eet_data_image_lossless_compressed_convert(int
  *size,
  unsigned int i;
 
  for (i = 0; i  8; i++) SWAP32(header[i]);
  +   free(bigend_data);
   }
 
 memcpy(d + (8 * sizeof(int)), comp, buflen);
 
 
 
  On a related matter, the testsuite also dies with SIGBUS on SPARC due
  to what seems to be an arbitrarily-aligned void* used as an int* in
  eet_cipher. The following patch fixes the issue for me:
 
  diff --git a/src/lib/eet_cipher.c b/src/lib/eet_cipher.c
  index 3317538..4e1433c 100644
  --- a/src/lib/eet_cipher.c
  +++ b/src/lib/eet_cipher.c
  @@ -706,9 +706,13 @@ eet_identity_check(const void   *data_base,
return NULL;
 
  /* Get the header */
  -   magic = ntohl(header[0]);
  -   sign_len = ntohl(header[1]);
  -   cert_len = ntohl(header[2]);
  +   memcpy(magic,header, sizeof(int));
  +   memcpy(sign_len, header+1, sizeof(int));
  +   memcpy(cert_len, header+2, sizeof(int));
  +
  +   magic = ntohl(magic);
  +   sign_len = ntohl(sign_len);
  +   cert_len = ntohl(cert_len);
 
  /* Verify the header */
  if (magic != EET_MAGIC_SIGN)
 
 
  Please let me know if you want me to rework the patches, submit them
  with ChangeLog entries for the stable releases or whatever :)
 
  Cheers,
  --
  Albin
 
 
  --
  Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
  and more. Get SQL Server skills now (including 2012) with LearnDevNow -
  200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
  SALE $99.99 this month only - learn more at:
  http://p.sf.net/sfu/learnmore_122512
  ___
  enlightenment-devel mailing list
  enlightenment-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
 
 
 
 
 -- 
 Gustavo Sverzut Barbieri
 http://profusion.mobi embedded systems
 --
 MSN: barbi...@gmail.com
 Skype: gsbarbieri
 Mobile: +55 (19) 9225-2202
 --
 Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
 and more. Get SQL Server skills now (including 2012) with LearnDevNow -
 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only - learn more at:
 http://p.sf.net/sfu/learnmore_122512
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

-- 
Leandro Dorileo
ProFUSION embedded systems
http://profusion.mobi

--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with 

Re: [E-devel] Eet testsuite failures

2013-01-08 Thread Albin Tonnerre
On Wed, Jan 9, 2013 at 1:27 AM, Leandro Dorileo dori...@profusion.mobi wrote:
 Hi,

  {
 unsigned char *d, *comp;
  -  int *header, ret, ok = 1;
  +  int *header, *bigend_data, ret, ok = 1;
 uLongf buflen = 0;
 
 buflen = (((w * h * 101) / 100) + 3) * 4;
 ret = LZ4_compressBound((w * h * 4));
 if ((ret  0)  ((uLongf)ret  buflen)) buflen = ret;
  -
  +
  +  if (_eet_image_words_bigendian)
  +{
  +   int i;
  +   int *bigend_data = (int *) malloc(w * h * 4);


 Shadowed declaration of bigend_data here.

Oops, correct. That must have crept in while doing some refactoring :)
Obvisouly the first declaration is the one we need to keep, since we
free the pointer later on.
--
Albin

--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel