Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Threaded perl 5.8.0 for Solaris

by asarih (Hermit)
on Aug 28, 2003 at 14:36 UTC ( #287385=note: print w/replies, xml ) Need Help??


in reply to Re: Threaded perl 5.8.0 for Solaris
in thread Threaded perl 5.8.0 for Solaris

Well, here's the XS routine that's causing the memory fault. Like I said, routine works fine for non-threaded perl.
double __call( sv_class, sv_path, sv_input ) SV * sv_class SV * sv_path SV * sv_input CODE: char *class = SvPV( sv_class, PL_na ); char *path = SvPV( sv_path, PL_na ); double input = SvNV( sv_input ); int fd; door_arg_t arg; double output; fd = open(path, O_RDWR); arg.data_ptr = (char *) &input; arg.data_size = sizeof(double); arg.desc_ptr = NULL; arg.desc_num = 0; arg.rbuf = (char *) &output; arg.rsize = sizeof(double); if ( door_call(fd, &arg) == 0 ) { RETVAL = output; } else { printf("ERRNO: %d\n",errno); RETVAL = -1; } OUTPUT: RETVAL

Replies are listed 'Best First'.
Re: Re: Re: Threaded perl 5.8.0 for Solaris
by liz (Monsignor) on Aug 28, 2003 at 14:47 UTC
    Please know that I have no experience with Solaris, or threaded applications using XS to speak of. That said, it seems you are leaking file descriptors, as you are doing:
    fd = open(path, O_RDWR);
    and you're not closing the file while the "int fd" does go out of scope. This is XS, not Perl! The file will not be automatically closed when its "handle" is destroyed. This may or may not be related to what you're seeing, though.

    Liz

      Thanks for the reminder, Liz. I put close(fd); after door_call(), but the error insists (on threaded perl, that is).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287385]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-10-03 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (14 votes). Check out past polls.

    Notices?