<div dir="ltr">Thanks for you guys' previous help.  I really feel like I'm learning a lot.<br><br>This is merely a beginning of what I hope will become a complete PerlQt4 binding using smoke:<br>svn checkout <a href="http://perlqt4.googlecode.com/svn/branches/PerlQtSimple">http://perlqt4.googlecode.com/svn/branches/PerlQtSimple</a><br>
I hope you guys will forgive me putting it in a separate repository, but I don't completely know what I'm doing. :-)  And the Makefile.PL isn't exactly automatic, but I assume you guys will know what to link it to.<br>
<br>I have an XS_AUTOLOAD function that only handles calls to c++.  I'm trying to keep it relatively simple until I fully understand everything, so it doesn't look for any perl subroutines.  It just calls the smoke function, gets the return value, and shoves that back into an SV.<br>
<br>My current problem is this.  I've had to define a custom function for QTableView::setRootIndex.  It has to do less work than XS_AUTOLOAD to figure out what's going on, but the code looks to me like it would do the same thing.  If you compile and run the perl script examples/UsingModelsAndViews (based on <a href="http://doc.trolltech.com/4.4/model-view-using.html">http://doc.trolltech.com/4.4/model-view-using.html</a>), it works just fine.<br>
<br>But now try commenting out the last line of QtSimple.xs, that defines the custom setRootIndex xs function.  On my machine here at home, which is 32 bit running Fedora Core 5 with Qt-4.4.0, I get this when it tries to run line 19:<br>
$table1->setRootIndex( $modelIndex );<br>*** glibc detected *** /usr/bin/perl: realloc(): invalid next size: 0x089143c0 ***<br><br>I threw in some debugging fprintf's, and it gets past the XSRETURN(1) line.  This is what really confuses me, that it's something happening after it leaves XS_AUTOLOAD.<br>
<br>I tried it on a machine at work running ...some version of Suse, Qt-4.3.4, but 64 bit.  The results were inconsistent.  I compiled it once, and it segfaulted.  But when I compiled again later, it worked ok.  Both machines worked fine with the custom setRootIndex xs function.<br>
 <br>Here's the backtrace, if that helps:<br>#0  0x00e1d402 in __kernel_vsyscall ()<br>#1  0x4e4efcce in __lll_mutex_lock_wait () from /lib/libc.so.6<br>#2  0x4e482978 in _L_lock_14004 () from /lib/libc.so.6<br>#3  0x4e481f63 in free () from /lib/libc.so.6<br>
#4  0x4db9ac88 in _dl_map_object_deps () from /lib/ld-linux.so.2<br>#5  0x4db9f301 in dl_open_worker () from /lib/ld-linux.so.2<br>#6  0x4db9b899 in _dl_catch_error () from /lib/ld-linux.so.2<br>#7  0x4db9edaa in _dl_open () from /lib/ld-linux.so.2<br>
#8  0x4e5168be in do_dlopen () from /lib/libc.so.6<br>#9  0x4db9b899 in _dl_catch_error () from /lib/ld-linux.so.2<br>#10 0x4e516a49 in __libc_dlopen_mode () from /lib/libc.so.6<br>#11 0x4e4f5f06 in init () from /lib/libc.so.6<br>
#12 0x4e6ba58b in pthread_once () from /lib/libpthread.so.0<br>#13 0x4e4f5ff4 in backtrace () from /lib/libc.so.6<br>#14 0x4e477551 in __libc_message () from /lib/libc.so.6<br>#15 0x4e48039b in _int_realloc () from /lib/libc.so.6<br>
#16 0x4e482185 in realloc () from /lib/libc.so.6<br>#17 0x4564d7f7 in Perl_safesysrealloc () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#18 0x45668923 in Perl_sv_grow () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>
#19 0x456710c8 in Perl_sv_catpvn_flags () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#20 0x45605f80 in Perl_gv_autoload4 () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#21 0x45606304 in Perl_gv_fetchmethod_autoload () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>
#22 0x456063c3 in Perl_gv_fetchmethod () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#23 0x4565c793 in Perl_pp_const () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#24 0x4565cc8f in Perl_pp_method_named () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>
#25 0x4565c48f in Perl_runops_standard () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#26 0x45601dde in perl_run () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so<br>#27 0x0804934e in main ()<br>
<br>Any ideas?  General advice about what a realloc invalid next size means would be helpful too.<br>Thanks,<br>Chris<br></div>