Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Inline CPAN distribution.

Report information
The Basics
Id: 29326
Status: resolved
Priority: 0/
Queue: Inline

People
Owner: Nobody in particular
Requestors: avar [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Inline::C loads .so files on perl version X regardless of whether the .so was made with perl version Y
I wrote some simple Inline::C code in a script and compiled it with 5.8.8, this generated an _Inline directory. I then ran the script with perl 5.9.5 which caused a segfault. It seems that Inline::C (and probably Inline in general) does not check whether the version that's loading the .so is the version that compiled it. Obviously this is a big problem. I worked around it by removing the _Inline directory, then a new one was compiled with 5.9.5 and everything worked.
RT-Send-CC: sisyphus [...] cpan.org
On Wed Sep 12 14:09:52 2007, AVAR wrote: Show quoted text
> I wrote some simple Inline::C code in a script and compiled it with > 5.8.8, this generated an _Inline directory. I then ran the script with > perl 5.9.5 which caused a segfault. It seems that Inline::C (and > probably Inline in general) does not check whether the version that's > loading the .so is the version that compiled it. Obviously this is a
big Show quoted text
> problem.
Inline already provides you with the means to deal with this. You can start your scripts with: ------------------ BEGIN { use Config; mkdir "my_$]" unless -d "my_$]"; }; use Inline C => Config => DIRECTORY => "./my_$]"; . . ------------------ Then, when you run that script using perl-5.8.8 it will use 'my_5008008' as the Inline directory. If you then subsequently run the same script (in the same location) using perl-5.9.5, then the Inline directory becomes 'my_5009005', and the script will be re- compiled - and all will be well. But, say you have 2 versions of perl-5.8.8 that have been built with different (incompatible) config options - eg one version built with multi-threading, the other version without. Then you'll still strike the same problem. To work around this additional issue you could begin your scripts with: ------------------ BEGIN { use Config; mkdir "$Config{archname}-$]" unless -d "$Config{archname}-$]"; }; use Inline C => Config => DIRECTORY => "./$Config{archname}-$]"; . . ------------------ Admittedly, Inline could be amended to take care of all that for the user. Should it be ? I'm a little undecided ... Cheers, Rob
RT-Send-CC: sisyphus [...] cpan.org
This bug has, I believe, been fixed in Inline-0.45 which caches up to four different builds of the same script (for four different perl configurations). However, this is untested by the test suite. If there's a problem with the way this bug has been handled, please feel free to re-open the ticket (or submit a new bug report). For further discussion of this issue (but without re-opening the ticket), consider posting to the Inline mailing list, or send a private email to sisyphus at cpan dot org. Thanks for the report !! Cheers, Rob