After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707010 - atspi_event_listener_register_no_data makes using eventlistener on javascript not possible
atspi_event_listener_register_no_data makes using eventlistener on javascript...
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-core
unspecified
Other Linux
: Normal normal
: ---
Assigned To: At-spi maintainer(s)
At-spi maintainer(s)
Depends on:
Blocks: 647074
 
 
Reported: 2013-08-28 19:08 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2013-08-30 09:26 UTC
See Also:
GNOME target: 3.10
GNOME version: ---


Attachments
gnome-shell patch: basic usage of an atspi-listener at gnome-shell (1.40 KB, patch)
2013-08-28 19:08 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
none Details | Review
Removes the methods atspi_event_listener_[register/deregister]_no_data (4.14 KB, patch)
2013-08-28 19:12 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
none Details | Review
Small javascript program that uses event listener (282 bytes, application/javascript)
2013-08-29 12:54 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
  Details
Skip methods atspi_event_listener_[register/deregister]_no_data (1.29 KB, patch)
2013-08-29 13:31 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-28 19:08:41 UTC
Created attachment 253434 [details] [review]
gnome-shell patch: basic usage of an atspi-listener at gnome-shell

While testing patches uploaded at bug 647074, I found that this piece of code:

this._atspiListener = Atspi.EventListener.new(Lang.bind(this, this._onChanged));

is failing. This is the error message:

(gnome-shell:7981): Gjs-WARNING **: JS ERROR: Exception in callback for signal: sessions-loaded: Error: Function Atspi.register_no_data has a GDestroyNotify but no user_data, not supported

So the problem seems to be that the method is not properly defined. Also seems that it doesn't matter that the method is not used. register_no_data is not used at all for creating an Atspi.EventListener. In fact, as far as I see, it is not used at all.

Although the error starts with a "Gjs-WARNING", it is in fact fatal. I'm also attaching a really small (and silly-placed) patch on current gnome-shell, just doing that registering.

Also not sure why this is failing now, because AFAIK, that was not happening before.
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-28 19:12:36 UTC
Created attachment 253436 [details] [review]
Removes the methods atspi_event_listener_[register/deregister]_no_data

This makes gnome-shell with the patch I uploaded on comment 0 works. Also makes the patch uploaded on bug 647074 not launching that error (although it fails for other reasons).

As far as I see, this method is not used at all, so I think that it would be feasible to just remove it. Notes:

1.) AFAIK, this was not happening before, so it would be good to confirm why it is happening.
2.) 1) is more relevant if we take into account that we are in API freeze, so we would need to justify this change.
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-29 12:54:58 UTC
Created attachment 253498 [details]
Small javascript program that uses event listener

This small program adds a listerner to object:state-changed:focused and prints name and rolename of the object.

In order to run that, you just need to do this: gjs print-focused.js

And the odd thing is that this program works. It doesn't launch the fatal error I found if we try to do the same on gnome-shell. Will keep taking a look to this.
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-29 13:16:53 UTC
FWIW:
<API> Jasper, one question in relation with bug 707010
<Services> Bug http://bugzilla.gnome.org/show_bug.cgi?id=707010 normal, Normal, ---, at-spi-maint, UNCONFIRMED, atspi_event_listener_register_no_data makes using eventlistener on javascript not possible
<API> yes, I know that at-spi2-core bug, but in any case
<API> in summary, using some atspi code on gnome-shell crash
<API> due a method not gobject-introspection friendly
<API> method that is not used
* CruX- (~crux@server.211.71.itcsa.net) has joined #gnome-shell
<API> on my last comment I add a small js program using that code without problem
<API> so the question is : do you know if using gjs with a gjs context (as in gnome-shell)
<API> is somewhat more picky about the modules imported that a basic (pure js) gjs program?
<Jasper> API, I have no idea why it's not failing for everything
<Jasper> API, the code in gjs is clearly broken where it throws if we can't create a certain kind of function
<API> well, but as I said, the wrong function is not called at all
<Jasper> API, you can mark your Atspi method (skip) instead of removing it if you're a bit scared
<API> is just there at the .gir file
<Jasper> API, yeah, when we import the module we scan through the typelib and define all functions/methods
<API> yes, I was just proposing to remove them
<API> because as far as I saw is not used at all
<Jasper> Well, I think we might only define methods when the object is first created?? Not sure.
<API> but it is true that probably a more conservative solution would be just skip it
<API> anyway, k
<API> I was just surprised when I found that the gjs program was working
<Jasper> I'd investigate why it's not failing for the random script.
<Jasper> maybe the code flow is different that it's being caught in that path? the import system is absolutely dreadful
<API> well, not failing in the random script is not a real problem
<API> problem is crashing gnome-shell
<API> just wanted to know the context
<API> thanks for the explanation
<API> probably in the end we will just skip that method
<API> as you suggested
Comment 4 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-29 13:31:07 UTC
Created attachment 253500 [details] [review]
Skip methods atspi_event_listener_[register/deregister]_no_data

Alternative solution. It is less agressive. Instead of removing those methods, they are gobject-introspection skipped, so not included on the gir file.

In any case, this would need a freeze break request, as technically it changes the API published.
Comment 5 Mike Gorse 2013-08-29 14:24:59 UTC
Comment on attachment 253500 [details] [review]
Skip methods atspi_event_listener_[register/deregister]_no_data

I think I added that as a C convenience function, so skipping it is fine. Yeah, release-team needs to approve, I guess.
Comment 6 Magdalen Berns (irc magpie) 2013-08-29 17:23:49 UTC
Review of attachment 253500 [details] [review]:

This patch is great! I can actually debug my work now. Thank you both for finding this and fixing it.
Comment 7 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-30 09:07:48 UTC
Freeze Break request done here:
https://mail.gnome.org/archives/release-team/2013-August/msg00107.html

2 positives votes already.

Patch committed. Closing bug.