Ticket #387 (new crash)

Opened 2 years ago

Last modified 2 years ago

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

Attachments

helloworld.tar.gz Download (196 bytes) - added by karl-michael.schindler@… 2 years ago.
tar archive of helloworld with full debug. created on Intel/10.6

Change History

Changed 2 years ago by karl-michael.schindler@…

tar archive of helloworld with full debug. created on Intel/10.6

Changed 2 years ago by jeremyhu@…

  • version set to 2.5.0 (xserver-1.7)
  • milestone set to 2.5.1

Changed 2 years ago by karl-michael.schindler@…

  • cc karl-michael.schindler@… added

Cc Me!

Changed 2 years ago by jeremyhu@…

Did this work with an older version of X11? If so, can you tell me what is the most recent version that worked?

Changed 2 years ago by karl-michael.schindler@…

This was my first try of fpGUI and it failed. So, I have no idea, whether there is an earlier version, which works. I do not have a system with a version earlier than 2.4.0, except a PowerMac on 10.4. Output of "X -version":

XFree86 Version 4.4.0 / X Window System (protocol Version 11, revision 0, vendor release 6600)

But I guess this does not really help.

KMS.

Changed 2 years ago by jeremyhu@…

Does the Tiger version have this bug?

You can install earlier versions (than 2.4.0) on Leopard.

Changed 2 years ago by karl-michael.schindler@…

trying on powerpc Tiger:

When compiling, I received: Fatal: Can't find unit users used by fpg_x11.

The reason is that the first patch did not work. There are 2 spaces between "users," and "{". Probably scrapped from the output.

The second error was: Fatal: Can't find unit fpg_base used by HelloWorld.

The reason is that on powerpc the command to compile HelloWorld must be:

fpc -gl -gw -Fu../../../lib/powerpc-darwin helloworld.pas

After this the program was built. When executed from terminal.app, it crashed with an exception because it could not start x11. In xterm it gave a very similar error as above. The only differences were the serial numbers. 103 became 102, and 104 became 103.

Trying on 10.5 with various versions later.

Changed 2 years ago by jeremyhu@…

  • milestone changed from 2.5.1 to later

Ok, since this issue has existed since Tiger, it's getting pushed back.

Note: See TracTickets for help on using tickets.