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 694194 - git: crash in git_log_data_command_run
git: crash in git_log_data_command_run
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: git
unspecified
Other All
: Normal normal
: ---
Assigned To: James Liggett
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-19 17:47 UTC by Carl-Anton Ingmarsson
Modified: 2013-02-19 23:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libanjuta: keep a ref on the AnjutaAsyncCommand when its thread is run (1.17 KB, patch)
2013-02-19 17:47 UTC, Carl-Anton Ingmarsson
committed Details | Review
git: use g_signal_connect_object() in GitLogCommand (1.68 KB, patch)
2013-02-19 17:47 UTC, Carl-Anton Ingmarsson
committed Details | Review
git: use g_signal_connect_object() to connect to commands in GitLogPane (3.53 KB, patch)
2013-02-19 21:34 UTC, Carl-Anton Ingmarsson
committed Details | Review

Description Carl-Anton Ingmarsson 2013-02-19 17:47:42 UTC
When switching branches from outside Anjuta I sometimes get
the following crash.


The problem seems to be that the command instance is finalized
before git_log_data_command_run() has finished executing. I've
attached two patches that should fix this.
Comment 1 Carl-Anton Ingmarsson 2013-02-19 17:47:45 UTC
Created attachment 236810 [details] [review]
libanjuta: keep a ref on the AnjutaAsyncCommand when its thread is run
Comment 2 Carl-Anton Ingmarsson 2013-02-19 17:47:47 UTC
Created attachment 236811 [details] [review]
git: use g_signal_connect_object() in GitLogCommand

Use g_signal_connect_object() in GitLogCommand to connect to the signals
on GitLogDataCommand. This way the signals will be disconnected when
GitLogCommand is disposed. The signals need to be disconnected since
the GitLogDataCommand may not be finalized when GitLogCommand releases
its reference to it.
Comment 3 Carl-Anton Ingmarsson 2013-02-19 21:34:18 UTC
Created attachment 236843 [details] [review]
git: use g_signal_connect_object() to connect to commands in GitLogPane
Comment 4 Carl-Anton Ingmarsson 2013-02-19 21:37:14 UTC
So to get this completely correct we probably have to change all places that connect to a GitCommand signal to use g_signal_connect_object().
Comment 5 Johannes Schmid 2013-02-19 22:03:31 UTC
Review of attachment 236811 [details] [review]:

OK
Comment 6 Johannes Schmid 2013-02-19 22:03:54 UTC
Review of attachment 236810 [details] [review]:

OK
Comment 7 Johannes Schmid 2013-02-19 22:04:20 UTC
Review of attachment 236843 [details] [review]:

OK
Comment 8 Johannes Schmid 2013-02-19 22:05:45 UTC
(In reply to comment #4)
> So to get this completely correct we probably have to change all places that
> connect to a GitCommand signal to use g_signal_connect_object().

Could you check that?

Otherwise thanks for you patches, they should make things a bit more solid!
Comment 9 Johannes Schmid 2013-02-19 22:06:31 UTC
*** Bug 605731 has been marked as a duplicate of this bug. ***
Comment 10 Carl-Anton Ingmarsson 2013-02-19 23:00:15 UTC
Attachment 236810 [details] pushed as ccef579 - libanjuta: keep a ref on the AnjutaAsyncCommand when its thread is run
Attachment 236811 [details] pushed as 275d5ef - git: use g_signal_connect_object() in GitLogCommand
Attachment 236843 [details] pushed as d265d89 - git: use g_signal_connect_object() to connect to commands in GitLogPane