GNOME Bugzilla – Bug 316088
MinGW compilation: fast-stack-trash does not work
Last modified: 2005-11-14 17:18:05 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.
'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?
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).
This code no longer exists in the GStreamer repository.