New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.17.7 breaks rules of assignment #12663
Comments
From @sisyphusHi, In a nutshell, with 5.17.7: $buffer = ‘some string’; Then call an XSub that writes into $buf (by using sprintf, say). Cheers, |
From @sisyphusCreated by sisyphus@Owner-PC311012The demo: ######################################## #use Inline C => Config => use Inline C => <<'EOC'; SV * foo(char * buffer) { EOC my $buffer = 'XOXO' x 3; foo($buf); print "\$buf: $buf\n"; On 5.16 (and earlier) this correctly outputs: ######################################## But with 5.17.7, I'm getting: ######################################## How on earth did $buffer get altered by 5.17.7 ?? Cheers, Perl Info
|
From @doyOn Thu, Dec 20, 2012 at 04:33:23PM -0800, Sisyphus wrote:
5.17.7 expanded perl's use of copy on write quite a bit. Inline::C -doy |
The RT System itself - Status changed from 'new' to 'open' |
From @sisyphus-----Original Message-----
Inline::C is just the easiest means by which I could demonstrate the 'orrible behaviour. Attached is a simple extension (Broken-0.01) which also demonstrates the issue. Extract, then run 'perl Makefile.PL', followed by 'make test' Cheers, |
From @nwc10On Thu, Dec 20, 2012 at 06:37:19PM -0600, Jesse Luehrs wrote:
Woah. As will potentially many many other XS modules. char * is a mutable C function argument. As char * is mutable, then I (A const char * typemap does not) Nicholas Clark |
From @tseeOn 12/21/2012 08:29 AM, Nicholas Clark wrote:
Generally speaking, I would consider the use of any char* typemap that --Steffen |
From @bulk88On Fri Dec 21 01:06:40 2012, smueller@cpan.org wrote:
https://github.com/bulk88/Win32API-File/blob/641b818af8828a687440020a97aa53c40b977d8e/typemap#L32 This is one way I picked up of doing it. Change that and instead of Regarding that a T_PV uses SvPV_nolen and not SvPV and the XS coder 1. "#error" in T_PV, force everyone to rewrite their XS code and also 2. have parse XS add a sentinal to the end of the PV buffer, if it is -- |
From @cpansproutOn Fri Dec 21 01:06:40 2012, smueller@cpan.org wrote:
Not necessarily. Some code doesn’t have to deal with embedded nulls. Can we fix char* typemaps to work the way they did in 5.005 (by using I do find the idea of a mutable char* pointer questionable, though.
Well, fixing this particular copy-on-write case should not depend on I suspect it is actually a regression in 5.10, and can probably be -- Father Chrysostomos |
From @jkeenanIt appears that we had *two* tickets in RT titled "5.17* breaks rules of Could those who participated in the discussion in *this* RT re-evaluate Thank you very much. |
From @jkeenanOn Sun May 19 19:32:46 2013, jkeenan wrote:
Slight correction: Sisyphus recommended that ticket be closed, and I |
Migrated from rt.perl.org#116158 (status was 'open')
Searchable as RT116158$
The text was updated successfully, but these errors were encountered: