Re: [Gc] "GC_is_visble_test failed" error on MS-W indows

Ivan Maidanski <ivmai-JGs/[email protected]> Sat, 21 Jun 2014 01:47:21 +0400
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
 Hi Eli,

Thu, 12 Jun 2014 20:24:02 +0300 from Eli Zaretskii <[email protected]>:
>> From: Ivan Maidanski < [email protected] >
>> Cc:  [email protected]
>> Date: Thu, 12 Jun 2014 12:44:16 +0400
>> 
>> The config you sent corresponds to single-threaded one
>> (GC_WIN32_THREAD is not defined)
>
>Yes.  This is the configuration that gives me trouble, the one
>configured with --disable-threads.
>
>> - I checked it with MinGW:
>> gcc -I include -DHAVE_CONFIG_H tests/test.c extra/gc.c
>> 
>> So, I don't understand why you say it uses Win32 threads.
>
>Sorry, I must have failed to explain myself.  I didn't say this
>configuration used threads, I said that the configuration that omits
>the --enable-threads option altogether uses Win32 threads.
>
>While it sounds reasonable to use Win32 threads when none of the
>--enable-threads and --disable-threads switches were specified, my
>question is why the library configured with --disable-threads causes
>the "GC_is_visble_test failed" error.  How is that error related to
>threading?
Looking into GC_is_visible code, in case of threads support on, the check is not thorough (accurate) enough as for single-threaded case. This could be the reason.
Another thing is that all GC tests pass but the Guile variant of tests fails if single-threaded - could Guile be instructed not to use any threads? (sorry I don't know how Guile uses GC - definitely there are the experts on the ML)
>
>
>> If you pass --disable-threads to the configure script, the
>> built library does not use any threading API and does not have any support threads in the client app.
>
>Right, I understand that.
>
>> If your app uses pthreads but GC is not supporting pthreads (in case of MnGW, GC_WIN32_PTHREADS not defined) then garbage collection will malfunction.
>
>No, the application didn't use threads, because I configured it not to
>do so.  Are you saying that the "GC_is_visble_test failed" error is a
>sign that the application tries to use some interface to libgc that
>requires threading, and that is why the error happens?
All threads that manipulate pointers obtained by GC malloc* (or call GC functions) should be registered in the GC (using the corresponding GC API which available only in multi-threaded support on). If pthread_create is never called then it is not the reason of the failure you observe.
>
>
>Thanks again for your help and explanations.
>_______________________________________________
>bdwgc mailing list
>[email protected]
>https://lists.opendylan.org/mailman/listinfo/bdwgc

_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc