Discussion:
[anjuta-devel] Help with fixing Anjuta crash
Harish U
2015-07-28 22:36:17 UTC
Permalink
Hi,

I have built Anjuta from source. I have tried multiple versions including
the latest.


The issues noticed:
1. Anjuta does not seem to save preferences when I quit. It asks which
editor to use every time it launches.
2. Anjuta crashes when I try to build a project that was already open by
default when anjuta launches. It does not crash if I open a project/create
new project after launching Anjuta.
The reason for the crash appears to do with the failure to load the build
configurations when Anjuta starts. (Any thread sync issue ?)
3. Also autotools plugin is not enabled by default when Anjuta launches
even if I enable it in the preferences.

4. Strangely everything works fine as expected if I start Anjuta -> close
the project loaded by default -> then re-open the same project from recent
projects menu. If I do this, the build configurations are loaded as
expected(so this workaround fixes the crash issue)

I suspect that while exiting Anjuta settings are not correctly
persisted/saved.

Please let me know if you can think of any reasons as to why I see this
behaviour and how I could fix this.

Thanks,
Harish
Abderrahim Kitouni
2015-07-29 08:44:00 UTC
Permalink
Hello Harish,
Post by Harish U
Hi,
I have built Anjuta from source. I have tried multiple versions including
the latest.
1. Anjuta does not seem to save preferences when I quit. It asks which
editor to use every time it launches.
Did you also build glib from source (if you built using jhbuild then
you did). In that case you also need to build dconf. In general it is
easier to build only anjuta from source, since we rarely require the
newest version of libraries.

I'm not sure about the other problems though.

HTH,

Abderrahim
Harish U
2015-07-29 18:29:11 UTC
Permalink
Hi Abderrahim,

Thanks very much for you response. I build Anjuta without using JHBuild. I
see that I have not used dconf. I would give it a try including it to see
if that fixes this issue. May be other issues are related.

Thanks,
Harish
Post by Abderrahim Kitouni
Hello Harish,
Post by Harish U
Hi,
I have built Anjuta from source. I have tried multiple versions including
the latest.
1. Anjuta does not seem to save preferences when I quit. It asks which
editor to use every time it launches.
Did you also build glib from source (if you built using jhbuild then
you did). In that case you also need to build dconf. In general it is
easier to build only anjuta from source, since we rarely require the
newest version of libraries.
I'm not sure about the other problems though.
HTH,
Abderrahim
Sébastien Granjoux
2015-07-29 17:34:54 UTC
Permalink
Hi,
Post by Harish U
1. Anjuta does not seem to save preferences when I quit. It asks which
editor to use every time it launches.
2. Anjuta crashes when I try to build a project that was already open by
default when anjuta launches. It does not crash if I open a
project/create new project after launching Anjuta.
The reason for the crash appears to do with the failure to load the
build configurations when Anjuta starts. (Any thread sync issue ?)
3. Also autotools plugin is not enabled by default when Anjuta launches
even if I enable it in the preferences.
4. Strangely everything works fine as expected if I start Anjuta ->
close the project loaded by default -> then re-open the same project
from recent projects menu. If I do this, the build configurations are
loaded as expected(so this workaround fixes the crash issue)
I suspect that while exiting Anjuta settings are not correctly
persisted/saved.
Please let me know if you can think of any reasons as to why I see this
behaviour and how I could fix this.
Is it something similar to this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=740497 ?

I don't get those issues here. If you can, it would be useful to check
exactly what's happen with a debugger.

Let's start with the first issue.

1. Create a file foo.txt
2. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
3. Select Edit->Preferences->Preferred plugin, click Forget selected plugin
4. Close Anjuta window

5. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
6. You should have a dialog asking you which editor to use, choose one
and check Remember this selection.
7. You should see your file opened
8. Close Anjuta window

9. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
10. You should directory see your file opened with the selected editor
11. In Edit->Preferences->Preferred plugin, you should see it
12. Open dconf-editor
13. The key org.gnome.anjuta.remembered-plugins should be
anjuta-editor:EditorPlugin,anjuta-sourceview:SourceviewPlugin,=anjuta-editor:EditorPlugin;
if you use Scintilla as default.

Could you do all these steps and check where it fails, I suppose at step 10.


Regards,

Sébastien
Harish U
2015-07-30 00:25:57 UTC
Permalink
Hi Sebastien,

Adding dconf fixed the issue with preferences not getting saved.
It appears like I am facing the same issue as the bug 740497. Was this bug fixed ? I am wondering if I am missing any dependency like I did (with dconf). Do you have any idea from the below stack trace and attached warnings file ?

I have attached the stack trace below(top 7 frames):
#0 build_configuration_get_name (cfg=0x0) at configuration-list.c:394
#1 0x00007fffdfdf78a1 in build_configure_dialog (plugin=0x55555577fab0, func=0x0, file=0x0,
callback=0x0, user_data=0x0, error=0x0) at build.c:1195
#2 0x00007ffff26721a8 in g_closure_invoke (closure=0x555556a25b80, return_value=0x0,
n_param_values=1, param_values=0x7fffffffdad0, invocation_hint=0x7fffffffda70) at gclosure.c:768
#3 0x00007ffff26833cd in signal_emit_unlocked_R (node=***@entry=0x555555a26440,
detail=***@entry=0, instance=***@entry=0x5555567d3270,
emission_return=***@entry=0x0,
instance_and_params=***@entry=0x7fffffffdad0) at gsignal.c:3553
#4 0x00007ffff268b0b8 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>,
detail=<optimized out>, var_args=***@entry=0x7fffffffdc58) at gsignal.c:3309
#5 0x00007ffff268b372 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>,
detail=<optimized out>) at gsignal.c:3365
#6 0x00007ffff6e59470 in ?? () from /lib/libgtk-3.so.0
#7 0x00007ffff26723d7 in _g_closure_invoke_va (closure=0x5555557905a0, return_value=0x0,
instance=0x555556a42710, args=0x7fffffffdf28, n_params=0, param_types=0x0) at gclosure.c:831

#0 build_configuration_get_name (cfg=0x0) at configuration-list.c:394
394 return cfg->name;

#1 0x00007fffdfdf78a1 in build_configure_dialog (plugin=0x55555577fab0, func=0x0, file=0x0,
callback=0x0, user_data=0x0, error=0x0) at build.c:1195
1195 old_config_name = build_configuration_get_name (build_configuration_list_get_selected (plugin->configurations));

(gdb) print plugin
$1 = (BasicAutotoolsPlugin *) 0x55555577fab0

(gdb) print plugin->configurations
$2 = (BuildConfigurationList *) 0x5555560ba4a0

(gdb) print plugin->configurations->cfg
$3 = (BuildConfiguration *) 0x0
(gdb) print plugin->configurations->selected
$4 = (BuildConfiguration *) 0x0
(gdb) print plugin->configurations->project_root_uri
$5 = (gchar *) 0x555556a76b20 "file:///root/scratch/simpleC3”

#2 0x00007ffff26721a8 in g_closure_invoke (closure=0x555556a25b80, return_value=0x0,
n_param_values=1, param_values=0x7fffffffdad0, invocation_hint=0x7fffffffda70) at gclosure.c:768
768 marshal (closure,

I could see couple of directories

This is what happens when I try to build a project as soon as I launch Anjuta. If I close the project and re-open the same project, the build configurations are loaded correctly when I debug it.

Thanks,
Harish
Post by Sébastien Granjoux
Hi,
Post by Harish U
1. Anjuta does not seem to save preferences when I quit. It asks which
editor to use every time it launches.
2. Anjuta crashes when I try to build a project that was already open by
default when anjuta launches. It does not crash if I open a
project/create new project after launching Anjuta.
The reason for the crash appears to do with the failure to load the
build configurations when Anjuta starts. (Any thread sync issue ?)
3. Also autotools plugin is not enabled by default when Anjuta launches
even if I enable it in the preferences.
4. Strangely everything works fine as expected if I start Anjuta ->
close the project loaded by default -> then re-open the same project
from recent projects menu. If I do this, the build configurations are
loaded as expected(so this workaround fixes the crash issue)
I suspect that while exiting Anjuta settings are not correctly
persisted/saved.
Please let me know if you can think of any reasons as to why I see this
behaviour and how I could fix this.
https://bugzilla.gnome.org/show_bug.cgi?id=740497 ?
I don't get those issues here. If you can, it would be useful to check exactly what's happen with a debugger.
Let's start with the first issue.
1. Create a file foo.txt
2. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
3. Select Edit->Preferences->Preferred plugin, click Forget selected plugin
4. Close Anjuta window
5. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
6. You should have a dialog asking you which editor to use, choose one and check Remember this selection.
7. You should see your file opened
8. Close Anjuta window
9. Open it with Anjuta running 'anjuta -c -n -f foo.txt'
10. You should directory see your file opened with the selected editor
11. In Edit->Preferences->Preferred plugin, you should see it
12. Open dconf-editor
13. The key org.gnome.anjuta.remembered-plugins should be anjuta-editor:EditorPlugin,anjuta-sourceview:SourceviewPlugin,=anjuta-editor:EditorPlugin; if you use Scintilla as default.
Could you do all these steps and check where it fails, I suppose at step 10.
Regards,
Sébastien
Sébastien Granjoux
2015-07-30 20:01:20 UTC
Permalink
Hi,
Post by Harish U
Adding dconf fixed the issue with preferences not getting saved.
Ok so only the issues 2,3,4 are remaining.
Post by Harish U
It appears like I am facing the same issue as the bug 740497. Was this
bug fixed ?
No.
Post by Harish U
I am wondering if I am missing any dependency like I did
(with dconf). Do you have any idea from the below stack trace
It seems that the configuration list is wrong. I don't remember for sure
but I think it's created in the function
build_configuration_list_from_string_list. Can you check what's happen here.

This list is saved in anjuta project preference file
.anjuta/session/anjuta.session, [Build] section, Configuration list key.
Post by Harish U
and attached warnings file ?
All these warnings and even errors looks quite normal. The critical
errors should be fixed but I get several of them to without visible issues.


Regards,

Sébastien
Harish U
2015-08-03 18:42:59 UTC
Permalink
Hi Sebastien,


Based on further debugging, I found the following I found why this happens
but still there are some questions I have.

In Anjuta-Shell.c anjuta_shell_session_load() loads session in multiple
phases.
This invokes all the plugins one at a time (I suppose).

I see different behaviour when Anjuta loads a project on startup as against
when it doesnt load any project.

When Anjuta doesn't load any project, in build-basic-autotools/plugin.c
on_session_load() is invoked with all the phases in order. However, when
Anjuta loads a project on start up, on_session_load() is only invoked with
ANJUTA_SESSION_PHASE_START and never with ANJUTA_SESSION_PHASE_NORMAL even
though anjuta_shell_session_load() is invoked with all the phases. I
suspect if this could be an issue with plugin loading order.

I would further debug and let you know if I find anything interesting.

Thanks,
Harish
Post by Sébastien Granjoux
Hi,
Post by Harish U
Adding dconf fixed the issue with preferences not getting saved.
Ok so only the issues 2,3,4 are remaining.
It appears like I am facing the same issue as the bug 740497. Was this
Post by Harish U
bug fixed ?
No.
I am wondering if I am missing any dependency like I did
Post by Harish U
(with dconf). Do you have any idea from the below stack trace
It seems that the configuration list is wrong. I don't remember for sure
but I think it's created in the function
build_configuration_list_from_string_list. Can you check what's happen here.
This list is saved in anjuta project preference file
.anjuta/session/anjuta.session, [Build] section, Configuration list key.
and attached warnings file ?
All these warnings and even errors looks quite normal. The critical errors
should be fixed but I get several of them to without visible issues.
Regards,
Sébastien
Sébastien Granjoux
2015-08-05 17:41:50 UTC
Permalink
Hi Harish,
Post by Harish U
In Anjuta-Shell.c anjuta_shell_session_load() loads session in multiple
phases.
This invokes all the plugins one at a time (I suppose).
Yes
Post by Harish U
I see different behaviour when Anjuta loads a project on startup as
against when it doesnt load any project.
If I remember correctly, le anjuta_session_load is triggered by loading
the project. The project file is kept with other files in the default
session an when the project file is loaded, it trigger the loading of
the project session.
Post by Harish U
I would further debug and let you know if I find anything interesting.
Ok, I have looked at this some time ago and I remember that it's a bit
complex, so potentially bug but I have few time to look at this at the
moment. I will try to reply to you questions though.

Regards,

Sébastien

Loading...