[Gambas-user] problems in trie class

Charlie Reinl Karl.Reinl at ...2345...
Tue Nov 18 22:34:45 CET 2014


Am Dienstag, den 18.11.2014, 21:48 +0100 schrieb Tobias Boege:
> On Tue, 18 Nov 2014, Karl Reinl wrote:
> > Salut Tobi,
> > 
> > played with you trie example (trietest)
> >
> 
> I'm glad to hear that :-)
> 
> >
> > it crash if 
> > p = h.GetPrefix("texte") find nothing (p=null), even when change
> > to p = h.GetPrefix("Texte")
> > 
> > My change is h["texte"] to h["Texte"] (source attached)
> 
> Not so glad about that...
> 
> Did it really crash (i.e. segfault or abort or ...)? When I run the project
> it stops at line 25 with the error "Null object" which is to be expected
> because the prefix "texte" doesn't exist anymore after your changes. If I
> change line 25 to p = h.GetPrefix("Texte"), then it runs through flawlessly
> here.
> 
It is a #11, CRASH REPORT windows opens

> If it really crashes, I need to know your Gambas version / revision and your
> system specs, especially your 32- or 64-bitness. It would also help if you
> provided a gdb backtrace and a valgrind log of the crash. Do you know how to
> do that?
> 
[System]
Gambas=3.6.90     ----------------->  rev.6647
OperatingSystem=Linux
Kernel=3.2.0-70-generic
Architecture=x86 ------------------>  32 bit
Distribution=Ubuntu 12.04.5 LTS
Desktop=GNOME
Theme=QPlastique
Language=de_DE.UTF-8
Memory=3025M
[Libraries]
Cairo=libcairo.so.2.11000.2
Curl=libcurl.so.4.2.0
DBus=libdbus-1.so.3.5.8
GStreamer=libgstreamer-0.10.so.0.30.0
GTK+3=libgtk-3.so.0.400.2
GTK+=libgtk-x11-2.0.so.0.2400.10
Poppler=libpoppler.so.19.0.0
Qt4=libQtCore.so.4.8.1
SDL=libSDL-1.2.so.0.11.3



> Regards,
> Tobi
> 

(gdb) run
Starting program: /usr/bin/gbx3 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
 -> root
q -> p
Texte -> french
tall -> small
term -> 2+3
test -> tomorrow
text -> words


Program received signal SIGSEGV, Segmentation fault.
0x00337331 in destroy_trie (trie=0x80b53ac, dtor=0x3379f8 <value_dtor>)
    at trie.c:256
256			destroy_trie(trie->children[i], dtor);
(gdb) bt
#0  0x00337331 in destroy_trie (trie=0x80b53ac, dtor=0x3379f8
<value_dtor>)
    at trie.c:256
#1  0x00338368 in Trie_free (_object=0x80aeeec, _param=0xb74a8050)
    at c_trie.c:68
#2  0x08051f54 in EXEC_native () at gbx_exec.c:1366
#3  0x08052657 in EXEC_special (special=1, class=0x80b1884, 
    object=<optimized out>, nparam=0, drop=1 '\001') at gbx_exec.c:1674
#4  0x080527d2 in EXEC_special_inheritance (special=1, class=0x80b1884, 
    object=0x80aeeec, nparam=0, drop=1 '\001') at gbx_exec.c:1730
#5  0x08055895 in CLASS_free (object=0x80aeeec) at gbx_class.c:754
#6  0x08050175 in RELEASE_many (value=<optimized out>, n=0) at
gbx_exec.c:240
#7  0x08050cf0 in EXEC_leave_drop () at gbx_exec.c:795
#8  0x080514fb in EXEC_function_loop () at gbx_exec.c:1053
#9  0x08051826 in EXEC_function_real () at gbx_exec.c:895
#10 0x0804b568 in main (argc=1457883477, argv=0xbffff384) at gbx.c:416
(gdb) 


but I have to say also this. I can NOT run the IDE with gdb 


:~/src/gambas/3/gambas-svn30/app/src/gambas3$ gdb gbx3
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/gbx3...done.
(gdb) run
Starting program: /usr/bin/gbx3 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
ERROR: #2: Cannot load class 'AngleBox': Unable to load class file
[Inferior 1 (process 7146) exited with code 01]
(gdb) 

-- 
Amicalement
Charlie
-------------- next part --------------
==7196== Memcheck, a memory error detector
==7196== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==7196== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==7196== Command: gbx3
==7196== 
==7196== Invalid read of size 4
==7196==    at 0x403B331: destroy_trie (trie.c:256)
==7196==    by 0x403C367: Trie_free (c_trie.c:68)
==7196==    by 0x8051F53: EXEC_native (gbx_exec.c:1366)
==7196==    by 0x8052656: EXEC_special (gbx_exec.c:1674)
==7196==    by 0x80527D1: EXEC_special_inheritance (gbx_exec.c:1730)
==7196==    by 0x8055894: CLASS_free (gbx_class.c:754)
==7196==    by 0x8050174: RELEASE_many (gbx_exec.c:240)
==7196==    by 0x8050CEF: EXEC_leave_drop (gbx_exec.c:795)
==7196==    by 0x80514FA: EXEC_function_loop (gbx_exec.c:1053)
==7196==    by 0x8051825: EXEC_function_real (gbx_exec.c:895)
==7196==    by 0x804B567: main (gbx.c:416)
==7196==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==7196== 
==7196== 
==7196== Process terminating with default action of signal 11 (SIGSEGV)
==7196==  Access not within mapped region at address 0x0
==7196==    at 0x403B331: destroy_trie (trie.c:256)
==7196==    by 0x403C367: Trie_free (c_trie.c:68)
==7196==    by 0x8051F53: EXEC_native (gbx_exec.c:1366)
==7196==    by 0x8052656: EXEC_special (gbx_exec.c:1674)
==7196==    by 0x80527D1: EXEC_special_inheritance (gbx_exec.c:1730)
==7196==    by 0x8055894: CLASS_free (gbx_class.c:754)
==7196==    by 0x8050174: RELEASE_many (gbx_exec.c:240)
==7196==    by 0x8050CEF: EXEC_leave_drop (gbx_exec.c:795)
==7196==    by 0x80514FA: EXEC_function_loop (gbx_exec.c:1053)
==7196==    by 0x8051825: EXEC_function_real (gbx_exec.c:895)
==7196==    by 0x804B567: main (gbx.c:416)
==7196==  If you believe this happened as a result of a stack
==7196==  overflow in your program's main thread (unlikely but
==7196==  possible), you can try to increase the size of the
==7196==  main thread stack using the --main-stacksize= flag.
==7196==  The main thread stack size used in this run was 8388608.
 -> root
q -> p
Texte -> french
tall -> small
term -> 2+3
test -> tomorrow
text -> words

==7196== 
==7196== HEAP SUMMARY:
==7196==     in use at exit: 42,656 bytes in 419 blocks
==7196==   total heap usage: 511 allocs, 92 frees, 53,384 bytes allocated
==7196== 
==7196== LEAK SUMMARY:
==7196==    definitely lost: 0 bytes in 0 blocks
==7196==    indirectly lost: 0 bytes in 0 blocks
==7196==      possibly lost: 40,816 bytes in 386 blocks
==7196==    still reachable: 1,840 bytes in 33 blocks
==7196==         suppressed: 0 bytes in 0 blocks
==7196== Rerun with --leak-check=full to see details of leaked memory
==7196== 
==7196== For counts of detected and suppressed errors, rerun with: -v
==7196== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


More information about the User mailing list