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 719666 - crashing with --background option
crashing with --background option
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-02 00:21 UTC by Geraldine Bernard
Modified: 2013-12-16 20:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace -- using MATE desktop environment (3.86 KB, application/octet-stream)
2013-12-13 14:17 UTC, Geraldine Bernard
  Details
Use hold() instead of background window (1.63 KB, patch)
2013-12-15 14:48 UTC, Aurimas Černius
committed Details | Review

Description Geraldine Bernard 2013-12-02 00:21:23 UTC
So, first I start Gnote in the background as follows:
gnote --background

A "WARNING" is output to the terminal, but this doesn't have any obvious consequence at this point.

Next, I use a Custom Application Launcher from the MATE panel to open a specific note in Gnote as follows:
gnote --open-note "name_of_note"

The note opens instantaneously and without issue. I close the note without issue. I open it again without issue. When I close it the second time, some "GLib-GObject-CRITICAL" errors and "Segmentation fault" are output to the terminal, and the gnote background process crashes.

Here is the terminal output ...


[Geraldine@localhost ~]$ gnote --background

** (gnote:1554): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(gnote:1554): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed

(gnote:1554): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed
Segmentation fault
Comment 1 Aurimas Černius 2013-12-02 21:09:18 UTC
> ** (gnote:1554): WARNING **: Couldn't register with accessibility bus: Did not
> receive a reply. Possible causes include: the remote application did not send a
> reply, the message bus security policy blocked the reply, the reply timeout
> expired, or the network connection was broken.

This seems to be the issue with accessibility. In GNOME 3 it's always on and available. Is it on in MATE. Honestly, I don't know if this is the cause, as Gnome doesn't do anything here, it's GTK+ working.


> (gnote:1554): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion
> 'G_IS_OBJECT (object)' failed
> 
> (gnote:1554): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion
> 'G_IS_OBJECT (object)' failed
> Segmentation fault

Stack trace would help here. Could you provide it?
Comment 2 Geraldine Bernard 2013-12-03 01:42:20 UTC
How would I provide a stack trace?

I don't know if accessibility is on. It doesn't look like there's anything related to that in the startup applications....
Comment 3 Geraldine Bernard 2013-12-12 15:26:42 UTC
If I try the same thing using the Cinnamon desktop environment, I get the same result, except that there is no "WARNING" ...

If I try to run gnote --background in Gnome, it seems to treat it the same as if I hadn't used the --background option at all....
Comment 4 Aurimas Černius 2013-12-12 19:17:43 UTC
Ok, so here are few things to check:
- What distribution do you use
- What is the version of GTK+
- Is Gnote running on start-up (is there gnote process when you execute the command)

Finally, try get the stacktrace:
gdb gnote --background
run
# wait for crash
bt

Thanks.
Comment 5 Geraldine Bernard 2013-12-13 14:16:25 UTC
-- What distribution do you use
-> Fedora 20 beta (I can try on Fedora 19 final, if that would be helpful)

-- What is the version of GTK+
-> Not sure which of these you need: gtk+1:1.2.10-76 / gtk2-2.24.22-2 / gtk3-3.10.5-1

-- Is Gnote running on start-up (is there gnote process when you execute the
command)
-> Gnote is not running on startup for MATE or Cinnamon, but it is for Gnome (which I presume explains why the --background option seemed to be ignored in Gnome). (I don't know how Gnote is starting automatically in Gnome, since it's not in the "Startup Applications," nor is the option to remember running applications checked, but anyway....) Now that I know Gnote is running at startup in Gnome, I have tested gnote --open-note "name_of_note" with the same result reported in the report description (well, since I don't have the gnote --background process running from a terminal, I can't see exactly what the error is, but I can see the process crashes at the same point in System Monitor, and the Automatic Bug Reporting Tool notified me of the same).

I will attach the backtrace momentarily ...
Comment 6 Geraldine Bernard 2013-12-13 14:17:37 UTC
Created attachment 264148 [details]
backtrace -- using MATE desktop environment
Comment 7 Aurimas Černius 2013-12-15 14:48:20 UTC
Created attachment 264224 [details] [review]
Use hold() instead of background window

Try to apply this patch, this should solve the issue.
Comment 8 Aurimas Černius 2013-12-15 14:50:35 UTC
> I don't know how Gnote is starting automatically in Gnome, since it's
> not in the "Startup Applications," nor is the option to remember running
> applications checked, but anyway...

Gnote integrates with GNOME Shell search and is started by shell.
Can you try the patch I've just attached, I think it will help.
Comment 9 Aurimas Černius 2013-12-15 14:53:28 UTC
I've openned Bug 720491 for --background openning new window.
Comment 10 Geraldine Bernard 2013-12-15 16:13:57 UTC
Could you instruct me how to apply this patch automatically (or must it be done by manually editing the source files)?

Also, the source tar for Gnote 3.11.0 has a README which says "See the INSTALL file" for compiling, but the INSTALL file seems to be absent. It's been a while since I've compiled anything; do I just?:
./configure
make
make install
Comment 11 Aurimas Černius 2013-12-15 18:01:55 UTC
(In reply to comment #10)
> Could you instruct me how to apply this patch automatically (or must it be done
> by manually editing the source files)?

The best way is to get Gnote version for git:

git clone git://git.gnome.org/gnote

then cd to gnote directory and apply the patch:

git am <patch_file>

Or you can apply it using patch, from inside gnote dir run:

patch -p 1 < <patch_file>


> Also, the source tar for Gnote 3.11.0 has a README which says "See the INSTALL
> file" for compiling, but the INSTALL file seems to be absent. It's been a while
> since I've compiled anything; do I just?:
> ./configure
> make
> make install

Pretty much, except that you need if using git version. On fedora you need to pass --prefix=/usr to configure. If you're on 64bit, then also --libdir=/usr/lib64

So it's (libdir only on 64 bit):

./autogen.sh --prefix=/usr --libdir=/usr/lib64
or
./configure --prefix=/usr --libdir=/usr/lib64

make
make install
Comment 12 Geraldine Bernard 2013-12-15 23:03:46 UTC
The patch works brilliantly! This will be included in the next release of Gnote, I assume?

Thanks, Aurimas :-)
Comment 13 Aurimas Černius 2013-12-16 20:25:46 UTC
> The patch works brilliantly! This will be included in the next release of
> Gnote, I assume?

Committed to master, will backport to 3.10 branch. Hopefully a bug-fix release this year :)