in reply to Re^15: Help with Lorcon XS library
in thread Help with Lorcon XS library

Hi friend, after some hours of works I think I've finally understood the problem, in few words in the source code
our @AS = qw( driver interface _drv _context ); __PACKAGE__->cgBuildAccessorsScalar(\@AS); __PACKAGE__->cgBuildIndices; sub new { my $self = shift->SUPER::new( driver => "madwifing", interface => "wlo1", @_, );
the @_ (under the "new" ) assign a value to $self->_drv and $self->_context, this explain the "undef" obtained in the previous posts, the output of this small program confirm it:
udo perl -e ' use Net::Lorcon2 qw( :subs ); my $lorcon = Net::Lorcon2->new(); use Data::Dumper; print Dumper($lorcon); '
outputs
$VAR1 = bless( [ 'madwifing', 'wlo1', \152948280, \152839568 ], 'Net::Lorcon2' );
including the $lorcon variable into the  Net::Lorcon2::lorcon_open_inject( $lorcon ) still crash but I think that the problem now stands in the BLESS reference, some hints? Regards Edoardo M

Replies are listed 'Best First'.
Re^17: Help with Lorcon XS library
by Bpl (Scribe) on Jul 22, 2020 at 22:10 UTC
    Hi again, I've tried to convert the example script "inject.pl" into an executable file though pp and then, with GDB, I've analyzed the SIGSEGV causes, the output is the following:
    Program received signal SIGSEGV, Segmentation fault. 0xb78ab7a7 in madwifing_openmon_cb (context=0x890eda8) at drv_madwifin +g.c:71 71 drv_madwifing.c: File o directory not exists.
    Now I am pretty sure that the library search a file which has the _drv and the  driver parameters, the situation seems more intrigate than I expected, I've already examined the Lorcon2.so file which is auto generate inside blib/arch/auto/Net/ ... but it doesn't seem to exist the  madwifing_openmon_cb symbols, any hints? Thanks again Rob, Edoardo M.