Re: [Vala] Strangeness with sorting using Gee ArrayList



On Sun, Jun 13, 2010 at 1:53 PM, Christer <christer nissen gmail com> wrote:
Hi Ali,

Thanks a lot for testing it. Would you mind testing it against your /usr/bin
folder that probably has lots of files? For me, I can list folders with a
small amount of files with no problem, but not large folders like /usr/bin
(mine has 2069 files).

/ Christer


I tried it on /usr/bin before replying (my /usr/bin has 2906 files)

Cheers,
Ali



2010/6/13 Ali Sabil <ali sabil gmail com>

On Sun, Jun 13, 2010 at 12:45 PM, Christer <christer nissen gmail com>
wrote:
Hi all,

Ive been stuck with this problem for a week now. I have been asking on
the
irc channel as well but nobody so far has been able to see a problem
with
the code. I have gotten the suggestion to compile gee with debug info to
dig
deeper but I dont know how to do that. Im just a newbie using prebuilt
packages. Im providing a test case below so anyone can compile and run
it
and maybe help me spot the problem. Could this be a bug in Gee?

TEST CASE CODE
=====================
http://pastebin.com/ufnyXdpg

- Replace directory path at line 93 with your own testing paths.
- Try folders with many files and folders, it tends to cause the crash.
- If you comment out the sorting at line 71, the program will not crash,
so
it seems to be the bad guy.


COMPILER WARNINGS
==================
gui.vala:22.1-22.25: warning: method `GUI.abort_started' never used
gui.vala:28.1-28.26: warning: method `GUI.abort_complete' never used
Test.vala.c: In function ‘file2_gee_comparable_interface_init’:
Test.vala.c:323:20: warning: assignment from incompatible pointer type
DirList.vala.c: In function
‘file_info_collection_file_gee_comparable_interface_init’:
DirList.vala.c:318:20: warning: assignment from incompatible pointer
type
<b>Process return 0  execution time: 1.42 s</b>


GDB OUTPUT:
===========
(gdb) run
Starting program: /home/chriniss/Code/Vala_Workspace/Static/Static
[Thread debugging using libthread_db enabled]
(process:4250): GLib-GObject-WARNING **: invalid uninstantiatable type
`(null)' in cast to `GeeComparable'
(process:4250): GLib-GObject-WARNING **: gtype.c:3097: invalid class
pointer
`0x8088790'
Program received signal SIGSEGV, Segmentation fault.
0xb78cdc67 in gee_comparable_compare_to () from /usr/lib/libgee.so.2



Im hopeful somebody can spot the problem with the code or Gee itself and
I
would really, really appreciate some pointers on how to fix this. Im
stuck...

Kind regards,
Christer


Hi Christer,

I just tried your code and it works perfectly here using Vala 0.8.1
and libgee 0.5.0

Cheers,

Ali





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]