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 316088 - MinGW compilation: fast-stack-trash does not work
MinGW compilation: fast-stack-trash does not work
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Windows
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 316073
 
 
Reported: 2005-09-12 14:31 UTC by Michal Benes
Modified: 2005-11-14 17:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michal Benes 2005-09-12 14:31:06 UTC
Fast stack trash does not work in MinGW. It should not be enabled on this platform. 

This bug causes an infinite loop in function gst_mem_chunk_alloc since
gst_trash_stack_pop never returns a memory chunk.
Comment 1 Michael Smith 2005-09-13 14:24:11 UTC
'Does not work' isn't very specific. 

As far as I know, there's no fundamental reason why this shouldn't work fine on
MinGW - so if it doesn't, that's likely to be a bug.

So, what is the actual bug you indirectly refer to here?
Comment 2 Michal Benes 2005-09-13 15:21:37 UTC
Sorry, for the general title. I did not known much more that before. 

Now it seems I have found the problem:
gst_mem_chunk_alloc ends in infinite cycle, since
gst_trash_stack_pop always returns NULL.

(The function gst_mem_chunk_alloc is trying to allocate new chunks and push them
to TrashStack until gst_trash_stack_pop returns non-NULL)

When I try to add debug output to gst_mem_chunk_alloc:
    210 gpointer
    211 gst_mem_chunk_alloc (GstMemChunk * mem_chunk)
    212 {
    213   GstMemChunkElement *chunk;
    214 
    215   g_return_val_if_fail (mem_chunk != NULL, NULL);
    216 
    217 again:
    218   printf("HERE\n");
    219   chunk = gst_trash_stack_pop (&mem_chunk->stack);
it prints infinite number of HERE messages. 

However, if I try the following debug prints
    210 gpointer
    211 gst_mem_chunk_alloc (GstMemChunk * mem_chunk)
    212 {
    213   GstMemChunkElement *chunk;
    214 
    215   g_return_val_if_fail (mem_chunk != NULL, NULL);
    216 
    217 again:
    218   printf("HERE %d\n", mem_chunk->stack.count);
    219   chunk = gst_trash_stack_pop (&mem_chunk->stack);
    220   printf(" ----- %p\n", chunk);
it works! (Note that it does not work without the second printf).

So it seems that it is some optimization problem in GCC (probably related to the
use of inline assmebler). 
Comment 3 Andy Wingo 2005-11-14 17:18:05 UTC
This code no longer exists in the GStreamer repository.