perl-win32-gui-hackers

cygwin, though I don't believe it is related.
perl-5.8.8 and perl-5.10.0
Win32-GUI-1.05
scripts\win32-gui-demos.pl and Win32-GUI-Scintilla\demos\Editor.pl
crash. The first after starting an app, the 2nd immediately.
This came from the cygwin list, with Vista, but I and others can reproduce
it with XP2. Looks like an Scintilla.xs problem.
Backtrace:
$ gdb perl
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run Editor.pl
Starting program: /usr/bin/perl.exe Editor.pl
Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
Loaded symbols for /usr/bin/cygperl5_10.dll
Loaded symbols for /usr/bin/cygcrypt-0.dll
Program received signal SIGSEGV, Segmentation fault.
0x67503375 in Perl_gv_fetchpvn_flags (my_perl=0x17700e8,
nambeg=0xc5c17c "main::or_Notify", full_len=15, flags=0,
sv_type=13) at gv.c:909
909 if (!stash || !SvREFCNT(stash)) /* symbol table
under destruction */
(gdb) bt
#0 0x67503375 in Perl_gv_fetchpvn_flags (my_perl=0x17700e8,
nambeg=0xc5c17c "main::or_Notify", full_len=15, flags=0,
sv_type=13) at gv.c:909
#1 0x6758dd2d in Perl_get_cvn_flags (my_perl=0x17700e8, name=0xc5c17c
"main::or_Notify", len=15, flags=0)
at perl.c:2479
#2 0x6758de63 in Perl_get_cv (my_perl=0x17700e8, name=0xc5c17c
"main::or_Notify", flags=0) at perl.c:2498
#3 0x6d541270 in DoEvent_Scintilla (my_perl=0x17700e8, Name=0xc5c17c
"main::or_Notify", code=2007, evt=0xc5c3bc)
at Scintilla.xs:67
#4 0x6d54286d in CallWndProc (nCode=0, wParam=0, lParam=12960480) at
Scintilla.xs:213
#5 0x7e4318e3 in UnhookWinEvent ()
#6 0x00000000 in ?? ()
(gdb) x stash
0x1: Cannot access memory at address 0x1
(gdb)
Reason: Someone is overwriting the stash with 1,
and the perlud name is also wrong.
It should be "Editor", not "or"
So I believe the stack is corrupt at all.
--
Reini Urban
http://phpwiki.org/http://murbreak.at/http://spacemovie.mur.at/http://helsinki.at/

On Fri, 2008-01-11 at 10:55 +0000, Jeremy White wrote:
> The doc's say it it should return a hash, but it actually returns an array. Bug or doco shortfall?
>
doco.
IANAL but it actually returns a LIST, (an "associative" one) that can be
assigned to a HASH or an ARRAY, so its a wording detail:
%info = $w->ItemInfo($item); # "return" a hash
Salvador.

On 11/01/2008, Jeremy White <jez_white@...> wrote:
> The doc's say it it should return a hash, but it actually returns an array. Bug or doco shortfall?
>
> ###########################################################################
> # (@)METHOD:GetItem(NODE)
> # (@)METHOD:ItemInfo(NODE)
> # Returns an associative array of information about the given NODE:
> # -children
> # -image
> # -parent
> # -selectedimage
> # -state
> # -text
[snip]
> XSRETURN(12);
> } else {
> XSRETURN_UNDEF;
> }
It does what is says. It returns an associative array (actually a
list, I guess). I assume this is down so that you can write:
my %info = $node->ItemInfo();
However, on failure the code above will warn about an uneven number of
elements in the hash assignment, as the returned list will contain a
single 'undef'.
I'll fix that last XSRETURN_UNDEF to XSRETURN_EMPTY.
Can you suggest a better wording for the docs?
Rob.

On 13/01/2008, Reini Urban <rurban@...> wrote:
> [Sorry for TOFU]
> I found and fixed the error. (Scintilla crash)
>
> Remove the line with #define PERL_GET_NO_CONTEXT at the top of Scintilla.xs
>
> The reason why you cannot reproduce it, it because MSVC obviously is
> compiled with PERL_OBJECT (see GUI.h for the perlud struct),
> Without PERL_OBJECT you may not change the setting of
> PERL_GET_NO_CONTEXT to the one in GUI.xs. Otherwise you are accessing
> the struct with and without the my_perl field, causing Scintilla to
> crash.
>
> It was not the stack corrupt, just perlud.
>
> When I got a decent internet connection tomorrow I'll post my full patch
> with added testcase which catches this problem.
I'll apply your fix. If you have the time to write a test case that
would be much appreciated.
Thanks,
Rob.

2008/1/27, Robert May <robertemay@...>:
> On 13/01/2008, Reini Urban <rurban@...> wrote:
> > [Sorry for TOFU]
> > I found and fixed the error. (Scintilla crash)
> >
> > Remove the line with #define PERL_GET_NO_CONTEXT at the top of Scintilla.xs
> >
> > The reason why you cannot reproduce it, it because MSVC obviously is
> > compiled with PERL_OBJECT (see GUI.h for the perlud struct),
> > Without PERL_OBJECT you may not change the setting of
> > PERL_GET_NO_CONTEXT to the one in GUI.xs. Otherwise you are accessing
> > the struct with and without the my_perl field, causing Scintilla to
> > crash.
> >
> > It was not the stack corrupt, just perlud.
> >
> > When I got a decent internet connection tomorrow I'll post my full patch
> > with added testcase which catches this problem.
>
> I'll apply your fix. If you have the time to write a test case that
> would be much appreciated.
Attached are my tests.
--
Reini Urban
http://phpwiki.org/http://murbreak.at/http://spacemovie.mur.at/http://helsinki.at/

On 28/01/2008, Reini Urban <rurban@...> wrote:
>
> Attached are my tests.
Many thanks. I'll tidy them up and apply them.
Knowing what the problem was, with a bit of code inspection I was able
to get the crash to happen reliably with this one-liner:
perl -mWin32::GUI -mWin32::GUI::Scintilla -e
'Win32::GUI::Window->new->AddScintilla->SetFocus'
I'll use that as the actual test for the crash, allowing me to
simplify the other tests somewhat.
Rob.

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

CountryState

JavaScript is required for this form.

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details