Discussion:
[Gc] cordtest, gctest FAIL on OSX
(too old to reply)
John Leung
2014-12-29 21:58:26 UTC
Permalink
Raw Message
cordtest, gctest FAIL on OSX in make check

sys info:
OSX 10.9.2
Xcode 4.5.2
Please let me know what other information I need to provide.
thank you.
make check
...
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-TESTS
./test-driver: line 107: 11117 Abort trap: 6 "$@" > $log_file 2>&1
FAIL: cordtest
./test-driver: line 107: 11137 Abort trap: 6 "$@" > $log_file 2>&1
FAIL: gctest
PASS: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: realloc_test
PASS: staticrootstest
PASS: threadleaktest
PASS: threadkey_test
PASS: subthreadcreate_test
PASS: initsecondarythread_test
PASS: disclaim_test
PASS: disclaim_bench
make[5]: Nothing to be done for `all-am'.
============================================================================
Testsuite summary for gc 7.5.0
============================================================================
# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to ***@lists.opendylan.org
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
cat ./test-suite.log
================================
gc 7.5.0: ./test-suite.log
================================

# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: cordtest
==============


FAIL: gctest
============

pthread_attr_setstacksize failed, error=22
Test failed
Bruce Hoult
2015-01-04 11:32:44 UTC
Permalink
Raw Message
I just tried the same thing with:

OSX 10.10.1
XCode 6.1.1

The latest release, gc 7.4.2, works
git head errors in the same way as yours: pthread_attr_setstacksize failed,
error=22

So you're not doing anything wrong.

If you have time, it would be great if you can find which git commit causes
the problem.

In the meantime, I suggest you use gc 7.4.2.

http://www.hboehm.info/gc/gc_source/gc-7.4.2.tar.gz
Post by John Leung
cordtest, gctest FAIL on OSX in make check
OSX 10.9.2
Xcode 4.5.2
Please let me know what other information I need to provide.
thank you.
Post by John Leung
make check
...
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-TESTS
FAIL: cordtest
FAIL: gctest
PASS: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: realloc_test
PASS: staticrootstest
PASS: threadleaktest
PASS: threadkey_test
PASS: subthreadcreate_test
PASS: initsecondarythread_test
PASS: disclaim_test
PASS: disclaim_bench
make[5]: Nothing to be done for `all-am'.
============================================================================
Testsuite summary for gc 7.5.0
============================================================================
# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
Post by John Leung
cat ./test-suite.log
================================
gc 7.5.0: ./test-suite.log
================================
# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: cordtest
==============
FAIL: gctest
============
pthread_attr_setstacksize failed, error=22
Test failed
--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.
_______________________________________________
bdwgc mailing list
https://lists.opendylan.org/mailman/listinfo/bdwgc
Bruce Hoult
2015-01-04 14:39:22 UTC
Permalink
Raw Message
There are actually two problems here.

The first is in:

7bef74b Fix unresolved vsnprintf in misc.c and snprintf in cordtest (DJGPP,
VC)

OS X for some reason has problems with defining snprintf as a macro and
including another macro expansion in its arguments. Others have found this
in the past e.g.

http://sourceforge.net/p/powerwatershed/discussion/1024808/thread/79db23d3/

The following patch fixes this (and hopefully doesn't break the others):

--------------------------
diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c
index a5a0c30..3edd0b4 100644
--- a/cord/tests/cordtest.c
+++ b/cord/tests/cordtest.c
@@ -206,9 +206,9 @@ void test_extras(void)

#ifdef __DJGPP__
/* snprintf is missing in DJGPP (v2.0.3) */
-# define GC_SNPRINTF sprintf
-# define GC_SNPRINTF_BUFSZ_ARG(bufsz) /* empty */
+# define HAVE_SNPRINTF 0
#else
+# define HAVE_SNPRINTF 1
# if defined(_MSC_VER)
# if defined(_WIN32_WCE)
/* _snprintf is deprecated in WinCE */
@@ -219,7 +219,6 @@ void test_extras(void)
# else
# define GC_SNPRINTF snprintf
# endif
-# define GC_SNPRINTF_BUFSZ_ARG(bufsz) (bufsz),
#endif

void test_printf(void)
@@ -244,8 +243,12 @@ void test_printf(void)
x = CORD_cat(x,x);
if (CORD_sprintf(&result, "->%-120.78r!\n", x) != 124)
ABORT("CORD_sprintf failed 3");
- (void)GC_SNPRINTF(result2, GC_SNPRINTF_BUFSZ_ARG(sizeof(result2))
- "->%-120.78s!\n", CORD_to_char_star(x));
+# if HAVE_SNPRINTF
+ (void)GC_SNPRINTF(result2, sizeof(result2), "->%-120.78s!\n",
+ CORD_to_char_star(x));
+# else
+ (void)sprintf(result2, "->%-120.78s!\n", CORD_to_char_star(x));
+# endif
result2[sizeof(result2) - 1] = '\0';
if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
}
--------------------------

The next problem is in:

0d147af Fix missing error handling of pthread_attr_init/getstacksize

Error 22 is EINVAL. Man pthread_attr_setstacksize gives the following
possible reasons for EINVAL:

[EINVAL] Invalid value for attr.
[EINVAL] stacksize is less than PTHREAD_STACK_MIN.
[EINVAL] stacksize is not a multiple of the system page size.

The following patch fixes the problem, demonstrating that the issue is
"stacksize is not a multiple of the system page size."

--------------------------
diff --git a/tests/test.c b/tests/test.c
index 1f006e4..13ab9a9 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -1881,7 +1881,7 @@ int main(void)
# if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
|| defined(GC_OPENBSD_THREADS)
- if ((code = pthread_attr_setstacksize(&attr, 1000000)) != 0) {
+ if ((code = pthread_attr_setstacksize(&attr, 1000*1024)) != 0) {
GC_printf("pthread_attr_setstacksize failed, error=%d\n", code);
FAIL;
}
--------------------------

With these two changes, all tests pass on OS X with current git HEAD
(0322b83).

Note that both problems are in the test code, not in the GC.
Post by John Leung
cordtest, gctest FAIL on OSX in make check
OSX 10.9.2
Xcode 4.5.2
Please let me know what other information I need to provide.
thank you.
Post by John Leung
make check
...
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-TESTS
FAIL: cordtest
FAIL: gctest
PASS: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: realloc_test
PASS: staticrootstest
PASS: threadleaktest
PASS: threadkey_test
PASS: subthreadcreate_test
PASS: initsecondarythread_test
PASS: disclaim_test
PASS: disclaim_bench
make[5]: Nothing to be done for `all-am'.
============================================================================
Testsuite summary for gc 7.5.0
============================================================================
# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
Post by John Leung
cat ./test-suite.log
================================
gc 7.5.0: ./test-suite.log
================================
# TOTAL: 14
# PASS: 12
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: cordtest
==============
FAIL: gctest
============
pthread_attr_setstacksize failed, error=22
Test failed
--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.
_______________________________________________
bdwgc mailing list
https://lists.opendylan.org/mailman/listinfo/bdwgc
Ivan Maidanski
2015-01-07 19:42:52 UTC
Permalink
Raw Message
Hi Bruce,
Thank you. I merged them both to master.
--
Sunday, 04 Jan 2015, 17:39 +03:00 from Bruce Hoult <***@hoult.org>:
There are actually two problems here.
The first is in:
7bef74b Fix unresolved vsnprintf in misc.c and snprintf in cordtest (DJGPP, VC)
OS X for some reason has problems with defining snprintf as a macro and including another macro expansion in its arguments. Others have found this in the past e.g. 
http://sourceforge.net/p/powerwatershed/discussion/1024808/thread/79db23d3/
The following patch fixes this (and hopefully doesn't break the others):
--------------------------
diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c
index a5a0c30..3edd0b4 100644
--- a/cord/tests/cordtest.c
+++ b/cord/tests/cordtest.c
@@ -206,9 +206,9 @@ void test_extras(void)
 
 #ifdef __DJGPP__
   /* snprintf is missing in DJGPP (v2.0.3) */
-# define GC_SNPRINTF sprintf
-# define GC_SNPRINTF_BUFSZ_ARG(bufsz) /* empty */
+# define HAVE_SNPRINTF 0
 #else
+# define HAVE_SNPRINTF 1
 # if defined(_MSC_VER)
 #   if defined(_WIN32_WCE)
       /* _snprintf is deprecated in WinCE */
@@ -219,7 +219,6 @@ void test_extras(void)
 # else
 #   define GC_SNPRINTF snprintf
 # endif
-# define GC_SNPRINTF_BUFSZ_ARG(bufsz) (bufsz),
 #endif
 
 void test_printf(void)
@@ -244,8 +243,12 @@ void test_printf(void)
     x = CORD_cat(x,x);
     if (CORD_sprintf(&result, "->%-120.78r!\n", x) != 124)
         ABORT("CORD_sprintf failed 3");
-    (void)GC_SNPRINTF(result2, GC_SNPRINTF_BUFSZ_ARG(sizeof(result2))
-                      "->%-120.78s!\n", CORD_to_char_star(x));
+#   if HAVE_SNPRINTF
+        (void)GC_SNPRINTF(result2, sizeof(result2), "->%-120.78s!\n",
+                          CORD_to_char_star(x));
+#   else
+        (void)sprintf(result2, "->%-120.78s!\n", CORD_to_char_star(x));
+#   endif
     result2[sizeof(result2) - 1] = '\0';
     if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
 }
--------------------------
The next problem is in:
0d147af Fix missing error handling of pthread_attr_init/getstacksize
Error 22 is EINVAL.  Man pthread_attr_setstacksize gives the following possible reasons for EINVAL: 
     [EINVAL]           Invalid value for attr.
     [EINVAL]           stacksize is less than PTHREAD_STACK_MIN.
     [EINVAL]           stacksize is not a multiple of the system page size.
The following patch fixes the problem, demonstrating that the issue is "stacksize is not a multiple of the system page size."
--------------------------
diff --git a/tests/test.c b/tests/test.c
index 1f006e4..13ab9a9 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -1881,7 +1881,7 @@ int main(void)
 #   if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
         || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
         || defined(GC_OPENBSD_THREADS)
-        if ((code = pthread_attr_setstacksize(&attr, 1000000)) != 0) {
+        if ((code = pthread_attr_setstacksize(&attr, 1000*1024)) != 0) {
           GC_printf("pthread_attr_setstacksize failed, error=%d\n", code);
           FAIL;
         }
--------------------------
With these two changes, all tests pass on OS X with current git HEAD (0322b83).
Note that both problems are in the test code, not in the GC.
Post by John Leung
cordtest, gctest FAIL on OSX in make check
OSX 10.9.2
Xcode 4.5.2
Please let me know what other information I need to provide.
thank you.
Post by John Leung
make check
...
/Applications/Xcode.app/Contents/Developer/usr/bin/make  check-TESTS
FAIL: cordtest
FAIL: gctest
PASS: leaktest
PASS: middletest
PASS: smashtest
PASS: hugetest
PASS: realloc_test
PASS: staticrootstest
PASS: threadleaktest
PASS: threadkey_test
PASS: subthreadcreate_test
PASS: initsecondarythread_test
PASS: disclaim_test
PASS: disclaim_bench
make[5]: Nothing to be done for `all-am'.
============================================================================
Testsuite summary for gc 7.5.0
============================================================================
# TOTAL: 14
# PASS:  12
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
Post by John Leung
cat ./test-suite.log
================================
   gc 7.5.0: ./test-suite.log
================================
# TOTAL: 14
# PASS:  12
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: cordtest
==============
FAIL: gctest
============
pthread_attr_setstacksize failed, error=22
Test failed
--
This message has been scanned for viruses and
dangerous content by MailScanner , and is
believed to be clean.
_______________________________________________
bdwgc mailing list
https://lists.opendylan.org/mailman/listinfo/bdwgc
Loading...