Greetings,
One of the guys on
my team is getting a segfault in Accessible_getChildAtIndex. We've have
been trying to track this down for days and are at wit's end. This is our
environment:
Ubuntu
8.04
Gnome
2.22.3
at-spi
1.22.1
Both he and I run
Ubuntu on VMWare Workstation. We are both running identical Ubuntu images
on VMware. Tthe error does not happen for me, he is getting it all the
time. The main difference between our two laptops: his is
significantly slower than mine.
We have a standalone
application that displays all the apps, (i.e, direct children of desktop), on
the machine. Here is the loop to retrieve them:
1 Accessible *desktop =
SPI_getDesktop(0);
2 int dtChildCount =
Accessible_getChildCount(desktop);
3 int
child;
4 for(child = 0; child < dtChildCount; child++)
{
5 Accessible *desktopChild =
Accessible_getChildAtIndex(desktop,
child);
6 if(desktopChild == 0)
{
7
myLog("getChild returned
0");
8
continue;
9 }
10 ... --
display info about each app
11 }
This loop in the standalone application
works for both of us, although two of the apps get SPI Exceptions. For app
18 (child == 17) we get an SPI_Exception (*) and the Accessible_getChildAtIndex
returns 0 (the call on line 6, above). Here is the
output:
app 1/21
(n:x-session-manager,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
app 2/21 (n:gnome-settings-daemon,d:,r:application)
[actions: ] [subs: Application ] (children: 0)
app 3/21
(n:gnome-screensaver,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
app 4/21 (n:gnome-panel,d:,r:application) [actions: ]
[subs: Application ] (children: 2)
app 5/21
(n:nautilus,d:,r:application) [actions: ] [subs: Application ] (children:
1)
app 6/21 (n:metacity,d:,r:application) [actions: ] [subs:
Application ] (children: 0)
app 7/21
(n:bluetooth-applet,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
app 8/21 (n:update-notifier,d:,r:application) [actions: ]
[subs: Application ] (children: 0)
app 9/21
(n:gnome-volume-manager,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
app 10/21 (n:gnome-power-manager,d:,r:application)
[actions: ] [subs: Application ] (children: 0)
app 11/21
(n:evolution-alarm-notify,d:,r:application) [actions: ] [subs: Application
] (children: 0)
app 12/21 (n:tracker-applet,d:,r:application) [actions:
] [subs: Application ] (children: 0)
app 13/21
(n:applet.py,d:,r:application) [actions: ] [subs: Application ] (children:
0)
app 14/21 (n:gnome-terminal,d:,r:application) [actions: ] [subs:
Application ] (children: 3)
app 15/21 (n:vmware-user,d:,r:application)
[actions: ] [subs: Application ] (children: 0)
---- spiException on app 15/21
retrieving the attributes: Accessible_getAttributes()
app 16/21
(n:notification-daemon,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
app 17/21 (n:nm-applet,d:,r:application) [actions: ]
[subs: Application ] (children: 0)
---- NULL app 18: spiException
app 19/21 (n:Firefox,d:,r:application) [actions:
] [subs: Application ] (children: 1)
app 19/21 - [states:
enabled, sensitive, showing, visible]
app 20/21
(n:evince,d:,r:application) [actions: ] [subs: Application ] (children:
2)
app 21/21 (n:sbq,d:,r:application) [actions: ] [subs: Application ]
(children: 0)
(*) Both
exceptions display as:
TCF
57:30.032: AT-SPI Exception: IDL:omg.org/CORBA/COMM_FAILURE:1.0
TCF
57:30.032: - Code: unknown type or
doesn't fit the other types
TCF
57:30.032: - Type: Do not know or
cannot tell where the problem is
In our primary application, which is
multithreaded, we go through a loop identical in structure to the one
above. This time, when we get to Gnome desktop app 18 our application gets
a SIGSEGV directly. The SPI_ExceptionHandler we pushed does
not get called. We've put in a SIGSEV handler and a stack walker to figure out
what is going on and we get this stack dump:
/usr/lib/libcspi.so.0
[0xb78da969] called by
/usr/lib/libcspi.so.0 [0xb78d6be2]
called by
/usr/lib/libcspi.so.0(Accessible_getChildAtIndex+0x52)
[0xb78d4372] called by <==
Accessible_getChildAtIndex()!
./stp-atspi(getFramesUnderMouse+0x6d)
[0x8063a65] called by
./stp-atspi(stackingOrderUnderMouse+0x9a)
[0x8063c1e] called by
...
Any suggestions for
working around this would be greatly appreciated. Here is some
information we've learned:
If the VMWare image
is rebooted and we comment out all calls to Accessible_getAtttributes(), then we
do not get the segfault (SIGSEGV). However, if we leave the calls in to
Accessible_getAttributes() then we will start getting the SIGSEGV as describe
above. Our theory is that there is a bug in the Accessible_getAttributes
implementation that gets a segfault and leaves some AT-SPI data structure in a
bad state. That bad data structure causes the AT-SPI
implementation to get a suprise SIGSEGV from then on every time we try to
access application 18.
-Sam
PS: Again,
this error does not happen in my VMWare instance, only on my teammate's slower
laptop. But one important fact is that the two of us are running identical
Ubuntu images.