Mailing List Archive

Possible binary incompatility issue with patches and dynamic extensions
I've spent several hours today chasing a problem that manifested itself
in a very subtle way. Consider this test code

require Fcntl;
use DBI;

sub foo {
@foo = Fcntl::show_want();
@foo = DBI::show_want();
@foo = Fcntl::show_want();
@foo = want();
}

sub want { print( wantarray ? "wantarray\n" : "wantscalar\n") }

$bar = foo();
@bar = foo();

where show_want() was implemented in DBI and Fcntl (for a test) as

int
show_want(...)
CODE:
dump_op(op);
puts( (GIMME == G_ARRAY) ? "want=array" : "want=scalar" );


The symptom was that the scalar vs list context of the call to
DBI::show_want did not reflect it's immediate calling context
but rather the context in which foo() was called! The surrounding
calls to Fcntl::show_want acted normally. Bizzare.

To cut a long and painful story short it seems to have been due to
version mismatch between perl and extensions. A rebuild of the DBI
against 1n fixed it. I can't be 100% sure since I don't have time
to dig deeper and I can't offhand see anything in the patch that
might have had that effect. Strange.

Sorry to be so vague. Just file it away into your symptom cache in
case anyone else bumps into something similar.

Tim.

p.s. I'll be away until Tuesday pm. Have the appropriate amount of fun!
Possible binary incompatility issue with patches and dynamic extensions [ In reply to ]
>>>>> "Tim" == Tim Bunce <Tim.Bunce@ig.co.uk> writes:

Tim> To cut a long and painful story short it seems to have been due
Tim> to version mismatch between perl and extensions. A rebuild of the
Tim> DBI against 1n fixed it. I can't be 100% sure since I don't have
Tim> time to dig deeper and I can't offhand see anything in the patch
Tim> that might have had that effect. Strange.

I wish I had more than an anacedote, but I experienced a similar
problem (actually AM experiencing, that is) when I changed the default
perl version from 5.001e to 5.001m. Many of the dynamically loaded
extensions needed to be recompiled (eg. Sybperl, Tk, etc.). The
failures were for various reasons, all of them cryptic.

Tim> p.s. I'll be away until Tuesday pm. Have the appropriate amount
Tim> of fun!

By now, we know what a trauma it will be for you to miss a days worth
of perl5-porters. I hope you can handle the trauma ;-)

W. Phillip Moore Phone: (212)-762-2433
Information Technology Department FAX: (212)-762-1009
Morgan Stanley and Co. E-mail: wpm@ms.com
750 7th Ave, NY, NY 10019

"Grant me the serenity to accept the things I cannot change, the
courage to change the things I can, and the wisdom to hide the
bodies of the people that I had to kill because they pissed me
off."
-- Anonymous

"Every normal man must be tempted at times to spit on his
hands, hoist the black flag, and begin slitting throats."
-- H.L. Mencken