retitle 321303 AptPkg::Version->upstream segv
severity 321303 normal
thanks

On Thu, Aug 04, 2005 at 09:42:58PM +0200, Marcin Owsiany wrote:
>$ gdb perl
>[...]
>(gdb) run -MAptPkg::Version -e 'print AptPkg::Version->upstream("1-2")'
>Starting program: /usr/bin/perl -MAptPkg::Version -e 'print 
>AptPkg::Version->upstream("1-2")'
>(no debugging symbols found)
>[...]
>[Thread debugging using libthread_db enabled]
>[New Thread -1209387520 (LWP 25131)]
>
>Program received signal SIGSEGV, Segmentation fault.
>[Switching to Thread -1209387520 (LWP 25131)]
>0xb7f442c4 in Perl_mg_get () from /usr/lib/libperl.so.5.8
>(gdb) bt
>#0  0xb7f442c4 in Perl_mg_get () from /usr/lib/libperl.so.5.8
>#1  0xb7f5fe3d in Perl_sv_2iv () from /usr/lib/libperl.so.5.8
>#2  0xb7df0ea3 in XS_AptPkg__Version_UpstreamVersion ()
>   from /usr/lib/perl5/auto/AptPkg/AptPkg.so
>#3  0xb7f58eba in Perl_pp_entersub () from /usr/lib/libperl.so.5.8
>#4  0xb7f5127a in Perl_runops_standard () from /usr/lib/libperl.so.5.8
>#5  0xb7ef7793 in perl_run () from /usr/lib/libperl.so.5.8
>#6  0x0804936f in main ()
>(gdb)
>
>The same happens for me in sarge and woody.

upstream is not a class method of AptPkg::Version, but requires an
object of that type.

    use AptPkg::Config '$_config';
    use AptPkg::System '$_system';
    use AptPkg::Version;

    $_config->init;
    $_system = $_config->system;
    my $vs = $_system->versioning;

    print $vs->upstream("1-2"), "\n";

See also /usr/share/doc/libapt-pkg-perl/examples/apt-version .

Shouldn't SEGV though, I'll change the code to either return an error
for AptPkg::Version->upstream, or to automagically create one.

--bod


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to