You can make your test even simpler if you read the source for FindWindowLike. You'll seeing that the first call is to GetRootWindow and a little testing will show that it is in fact crashing when it trys to execute that bit.
So a simpler mod.pm is:
The source for GetRootWindow is in GUITest.xs and is pretty short and sweet:use X11::GUITest; X11::GUITest::GetRootWindow;
Window GetRootWindow() CODE: RETVAL = RootWindow(TheXDisplay, TheScreen); OUTPUT: RETVAL
But... Where are TheXDisplay or TheScreen defined? This is C, after all, and things don't just auto-vivify. In fact, both are set up in SetupXDisplay.
SetupXDisplay is called from the INIT block at the end of GUITest.pm. If the INIT block hasn't been called yet (INIT blocks aren't called until just before the main program is executed -- which would be after the statements in mod.pm are executed), then TheXDisplay is NULL when it is used in the above code and we get a segfault.
The fix, then is to make sure that SetupXDisplay is called before TheXDisplay is used.
To answer your question: this is a bug in X11::GUITest.
In reply to Re^3: Bug in perl, or X11::GUITest
by hexmode
in thread Bug in perl, or X11::GUITest
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |