Ticket #387 (new crash)
BadAtom X11 Error with fpGUI
| Reported by: | karl-michael.schindler@… | Owned by: | jeremyhu@… |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | later |
| Component: | xserver | Version: | 2.5.0 (xserver-1.7.6) |
| Keywords: | fpGUI | Cc: | karl-michael.schindler@… |
Description
When running pascal programs based on fpGUI, an X11 based interface package, I get an error if the application needs to create the top level (root?) X11 window. but only then. If there is already a toplevel window, for example because xterm runs, then the application open its window and everything behaves as expected.
the problematic call is this:
XGetWMProtocols(FDisplay, AWindow, @Protocols, @Count);
gdb shows these values (if there is an X11 window, the values are exactly the same):
4: COUNT = 0 3: PROTOCOLS = 0x0 2: AWINDOW = 6291457 1: this->FDISPLAY = 0x803a00
This call produces this X11 error:
X Error of failed request: BadAtom (invalid Atom parameter) Major opcode of failed request: 18 (X_ChangeProperty) Atom id in failed request: 0x0 Serial number of failed request: 103 Current serial number in output stream: 104
System: Mac OS X 10.6.3
X11 version: michael% X -version X.org Release 7.3 X.Org X Server 1.4.2-apple53 Build Date: 20100211
Similar on Intel 10.5.8, with X11 2.4.0 installed from xorg, which is X.org Release 7.4 X.Org X Server 1.5.3-apple14 Build Date: 20090812
***** Log of email with Jeremy Huddleston in order to check for timing issue ******
open -a X11 (wait a few seconds for it to appear in the dock as launched) ./helloworld Does that work as expected?
"open -a X11" starts X11.app including an xterm.
I need to know if it's something that is a strict timing issue or something that is fixed by the started xterm. You need to start X11.app without launching the initial xterm. Do this first, then rerun the expiriment above: defaults write org.x.X11 app_to_run /bin/true
after this "open -a X11" starts X11.app but without xterm and ./helloworld gets the error, whether I wait for a while or not. I would say: no timing issue.
Thanks for investigating. Could you please open a bug report at http://xquartz.macosforge.org with this info, and I'll take a look at it for the next release. Could you also let me know how to get your 'helloworld' on my system for easy testing? Thanks, Jeremy
***** How to build the fpGUI libs/units and helloworld *****
Install the FreePascal compiler with fink:
fink install fpc
Download the source tarball of RC2 of fpGUI from sourceforge:
http://sourceforge.net/projects/fpgui/files/fpGUI/0.7-rc2/fpgui-0.7.rc2.tar.gz/download
Extract the tarball and cd to the directory "fpgui-0.7.rc2/src".
Patch the sources:
sed -i.bak 's| users, {|// users, {|g' corelib/x11/fpg_x11.pas
sed -i.bak 's|GetUserName(TUID(info.st_uid));|IntToStr(info.st_uid);|g' corelib/x11/fpg_x11.pas
sed -i.bak 's|GetGroupName(TGID(info.st_gid));|IntToStr(info.st_gid);|g' corelib/x11/fpg_x11.pas
Build the fpGUI libraries:
./build.sh
Change to the folder of helloworld:
cd ../examples/corelib/helloworld
Build helloworld:
fpc -gl -gw -Fu../../../lib/i386-darwin helloworld.pas
Run helloworld:
./helloworld
Building the fpGUI libs/units with debug information is more involved. I'll post it if it's needed.
Michael Schindler

