After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660045 - xsltproc/testThreads.c error: conversion to non-scalar type requested
xsltproc/testThreads.c error: conversion to non-scalar type requested
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-25 08:34 UTC by IlyaS
Modified: 2012-08-16 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make log (1.15 KB, application/octet-stream)
2011-09-25 08:34 UTC, IlyaS
  Details
Suggested xsltproc/testThreads.c patch (986 bytes, patch)
2011-09-25 08:36 UTC, IlyaS
none Details | Review
Log of libxslt-1.1.26 "./configure --prefix=`cd /mingw; pwd -W`" (66.03 KB, application/octet-stream)
2011-09-25 08:39 UTC, IlyaS
  Details
Alternative fix (705 bytes, patch)
2011-12-30 23:31 UTC, Sam Thursfield
none Details | Review

Description IlyaS 2011-09-25 08:34:29 UTC
Created attachment 197417 [details]
make log

libxslt-1.1.26 configured for MinGW has compilation error
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I../libexslt -I.. -I../libxslt -I../libexslt -IC:/MinGW/include/libxml2 -g -O2 -Wall    -g -O2 -Wall -MT testThreads.o -MD -MP -MF .deps/testThreads.Tpo -c -o testThreads.o testThreads.c
testThreads.c: In function 'main':
testThreads.c:203:6: error: conversion to non-scalar type requested
testThreads.c:245:6: error: conversion to non-scalar type requested

Similar to diff in testThreads.c between libxml2-git-snapshot and libxml2-2.7.8 patch for libxslt/xsltproc/testThreads.c would be:

--- libxslt-1.1.26/xsltproc/testThreads.c	2009-08-14 11:14:22 +0400
+++ libxslt/xsltproc/testThreads.c	2011-09-25 11:49:35 +0400
@@ -198,10 +198,8 @@
      */
     printf("Pass 1\n");
     for (repeat = 0;repeat < 500;repeat++) {
-	for (i = 0; i < num_threads; i++) {
-	    results[i] = NULL;
-	    tid[i] = (pthread_t) -1;
-	}
+        memset(results, 0, sizeof(*results)*num_threads);
+        memset(tid, 0xff, sizeof(*tid)*num_threads);
 
 	for (i = 0; i < num_threads; i++) {
 	    ret = pthread_create(&tid[i], NULL, threadRoutine1,
@@ -240,10 +238,8 @@
             fprintf(stderr, "Main failed to compile stylesheet\n");
             exit(1);
         }
-	for (i = 0; i < num_threads; i++) {
-	    results[i] = NULL;
-	    tid[i] = (pthread_t) -1;
-	}
+        memset(results, 0, sizeof(*results)*num_threads);
+        memset(tid, 0xff, sizeof(*tid)*num_threads);
 
 	for (i = 0; i < num_threads; i++) {
 	    ret = pthread_create(&tid[i], NULL, threadRoutine2, (void *) cur);
Comment 1 IlyaS 2011-09-25 08:36:52 UTC
Created attachment 197418 [details] [review]
Suggested xsltproc/testThreads.c patch

At least libxslt-1.1.26 was compiled successfully after patching
Comment 2 IlyaS 2011-09-25 08:39:17 UTC
Created attachment 197419 [details]
Log of libxslt-1.1.26 "./configure --prefix=`cd /mingw; pwd -W`"
Comment 3 Sam Thursfield 2011-12-30 23:31:16 UTC
Created attachment 204365 [details] [review]
Alternative fix

Here's a patch which uses pthread_self() instead of a manual set to -1, as done in https://bugzilla.gnome.org/show_bug.cgi?id=599241
Comment 4 Daniel Veillard 2012-08-16 13:46:53 UTC
Right, I actually went with the first way to keep the code similar to
libxml2 equivalent:

http://git.gnome.org/browse/libxslt/commit/?id=2d6e741ed9a5e54d48d394060590d151a3417dd7

  thanks a lot !

Daniel