bryanh@giraffe-data.com via RT wrote on 03/30/2016 11:10 PM:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=113390 >
>
> Yes, we're both talking about the same thing: providing a module that has
> a normal Perl interface without any C pointers involved and the user cannot
> use it in any way that would cause an invalid memory reference.
>
> I'm proposing to call that module Curses2, and to leave Curses as it is for
> backward compatibility and also as a great tool for implementing Curses2.
Actually, we're not talking the same thing. I'm not proposing a
"Curses2" or any such substantial modification. I did offer up an
"improvement" in my original report, but I understood your original
response as to why that is not appropriate and/or desired. My point was
that if the current Curses module is left unpatched, the user has to go
to extraordinary and undocumented measures, far beyond the messy "pack"
construct (which is adequately documented), and be exceedingly careful
to make sure his Perl "pack" variables have the correct scope and
lifetime in order to even *use* the current Curses module as provided
without risk of SEGV. The original demo program will not run, as is,
and I'm sure there is other code written by users based on those
examples which is at risk of SEGV. In order for the Curses module to
function *as originally advertised* it must be patched to fix this SEGV.
I know it is scary to even touch such a long-standing module. But when
the module is found to have a fundamental flaw such as this, it must be
fixed. The correct procedure would be to create a new version number
with the relevant patch applied. This addresses any compatibility
concerns - users can choose to upgrade, or not. But at least a user
caught in the "trap" I found myself has an option to fix mysterious
SEGVs in existing code, without being required to rewrite that code with
some obscure workaround that requires precise understanding of the
subtleties involved in order to even function.
I again offer such a patch for your review. This time with fixes for
both the items problem and the form fields problem, written in "correct"
Perl XS syntax, with understandable comments. In my opinion, this
minimal patch fixes this problem and maintains 100% compatibility with
existing programs. I believe the patch to be consistent with the
original objectives of the Curses module, and simply restores it to the
"as written" functionality that was originally thought to be there.