GNOME Bugzilla – Bug 652528
LinkedList causes stack overflow during freeing with large number of elements
Last modified: 2011-06-15 08:26:21 UTC
Example: The snippet hereunder works with a number of elements equal to 100,000 but crashes with a number of elements equal to 1000,000. Serge Hulne // --- using Gee; using Posix; int main(string[] args) { //List var L = new LinkedList<int>(); // Insert in List for (var i=0; i<1000000; i++) { L.add(1); } return 0; } // ---
More generally the tests shipped with the library should contain tests for insertion of large number of elements for all the containers (list, map, etc ...)
*** Bug 652523 has been marked as a duplicate of this bug. ***
*** Bug 652527 has been marked as a duplicate of this bug. ***
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance! PS. I will try to reproduce it today evening however the stacktrace can be most helpful. Also - what's your version of libgee, vala etc.
Libgee version : 0.6 Vala version : 0.12 Hardware : Mac Mini pentium dual core I am running this test under Mac OS 10.6 so I do not know how to get a trace tehe Linux way under Mac, however here is the output of gdb: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3ffff8 0x000000010014e0d5 in gee_linked_list_node_free (self=0x1019c18c0) at linkedlist.c:1183 1183 _gee_linked_list_node_free0 (self->next); (gdb) If needed, I can duplicate this test under Linux by the end of the week to get the required trace.
(In reply to comment #5) > Libgee version : 0.6 > Vala version : 0.12 > Hardware : Mac Mini pentium dual core > > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3ffff8 > 0x000000010014e0d5 in gee_linked_list_node_free (self=0x1019c18c0) at > linkedlist.c:1183 > 1183 _gee_linked_list_node_free0 (self->next); > (gdb) > Could you send the output of "bt full"?
The output of bt full (from gdb) is:
+ Trace 227473
... (repeated over and over) Serge.
I was thinking where the value come from. IMHO it looks like stack overflow. I don't have time right now to fix it but I will do this this afternoon.
(In reply to comment #5) > Libgee version : 0.6 Have you tried 0.6.1? What about current git version? > Vala version : 0.12 > Hardware : Mac Mini pentium dual core > > > I am running this test under Mac OS 10.6 so I do not know how to get a trace > tehe Linux way under Mac, however here is the output of gdb: > 1. compile with -g or -gdb flag 2. don't strip --------------------------- Unfortunatly I cannot reproduce it on Linux. It works with 10000000 and I get OOM on 100000000 (counting 12B of overhead 12B*100000000 = 1200000000B = 1200000kB = 1200MB = 1.2 GB < 1.2 GiB - strange that 4GiB machine cannot handle it). It is not stackflow overflow after looking on code. I'll try to get some Mac OS machine (borrow from friend etc.)
The bug was fixed in 0.6.1 (looking on code) assuming it was the stack overflow. If you still get the problem on 0.6.1 please feel free to reopen the bug.
libgee version 0.6.1 seems to work indeed. I had been using version 0.6.0 instead, because the link on the libgee homepage: http://live.gnome.org/Libgee points to version 0.6.0 instead of pointing to version 0.6.1 Thanks, Serge.