gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
303 stars 99 forks source link

Reload #85

Closed pcaillou closed 9 years ago

pcaillou commented 9 years ago
What steps will reproduce the problem?
1. Run a model
2. Click on the reload button

What is the expected output? What do you see instead?

The state of the simulation is "Simulation Ready" in green in the box.
Nevertheless there is only the red circle button right to the box, and GAMA freezes.

We need to kill it and relaunch GAMA... 

Please use labels and text to provide additional information.

Windows XP(32bits) and 7(64 bits)

Original issue reported on code.google.com by benoit.gaudou on 2011-06-03 08:51:21

pcaillou commented 9 years ago
Is this behavior still occuring in the latest commit ? I am a little bit worried because
I haven't seen this problem recently and it might be specific to Windows. 

Original issue reported on code.google.com by alexis.drogoul on 2011-06-03 15:09:39

pcaillou commented 9 years ago
Yes, it still occurs in the latest commit (update this morning).
The only clue that I can give you is the following message in the eclipse console:

111938 [Reloading thread] DEBUG gama  - Selection has changed :null

Original issue reported on code.google.com by benoit.gaudou on 2011-06-04 05:28:03

pcaillou commented 9 years ago
Note that this issue does not occur when there is no display in the output section.

Original issue reported on code.google.com by benoit.gaudou on 2011-06-04 06:42:54

pcaillou commented 9 years ago
This is a log when reloading "models/delegation/pedestrian_flow.gaml" model:

83659 [Thread-0] DEBUG gama  - Selection has changed :null
83659 [Thread-0] DEBUG gama  - Selection has changed :null
83659 [Thread-0] DEBUG gama  - View to close : msi.gama.gui.application.view.LayeredDisplayView
: 'Display'
83667 [Thread-0] DEBUG gama  - View to close : msi.gama.gui.application.view.LayeredDisplayView
: Execution_time

This just happens on "output" having display defined. The problem may come from the
fact that GAMA doesn't succeed in reopening the displays!

Original issue reported on code.google.com by voducanvn on 2011-06-04 09:09:12

pcaillou commented 9 years ago
... and the simulation still runs when clicking on the "start" button.

On my machine, this is an intermittent problem but it happens almost 90% of times.

With luck, I can reload the simulation a couple of times. But once GAMA can't reopen
the displays on a reload, from there on, the reloading action won't be able to reopen
these displays again!

Original issue reported on code.google.com by voducanvn on 2011-06-04 09:23:48

pcaillou commented 9 years ago
Can you both try out the new revision ? I may have fixed the problem, although I can't
tell for sure (since I still can't reproduce it). The only drawback, however, is that
it has involved temporarily disabling the possibility to cancel the launching of an
experiment (a problem of threads blocking each other). 

Tell me what you find. 

Original issue reported on code.google.com by alexis.drogoul on 2011-06-06 02:32:17

pcaillou commented 9 years ago
When I try to launch a model with a display, it freezes everything.

I can launch a model without display.
Nevertheless, after launching an experiment default with a model without display, I
was unable to run experiment with another model. The first model was launch instead.

Original issue reported on code.google.com by godzounet on 2011-06-06 03:40:50

pcaillou commented 9 years ago
Hum… I do not understand exactly what's happening. I'm waiting for An to give me his
feedback. It would be nice, too, to have someone using Ubuntu and trying this new version.

The heart of the problem lies in the interblocking of several threads : SWT gui thread,
AWT gui thread, GAMA own scheduler thread, and the threads used to launch/relaunch
experiments. Right now, I have disabled the two last ones, but it seems to have worsened
the problem :) Since the freeze happens with displays, I can only think of a problem
of priority between the AWT thread and SWT/Java threads. 

Moreover, the way these threads interact seems to be specific to each operating system
: in MacOS X, Windows and Ubuntu, I have recorded different interactions (and blocking
schemes). 

What I will probably do it to post a version with a lot of logging and ask you to send
me the corresponding trace. 

Original issue reported on code.google.com by alexis.drogoul on 2011-06-06 05:05:09

pcaillou commented 9 years ago
Can you please try out the new version ? If that's still not working, I will have to
install Windows 7 to do the tests :(

Original issue reported on code.google.com by alexis.drogoul on 2011-06-06 11:12:39

pcaillou commented 9 years ago
I update to the last version.
It works better than this morning. But the problem remains: 
we can run an experiment, but when we reload it, GAMA freezes.
Note that: the simulation state box displays: "Simulation ready" and there is the red
button beside.

The messages in the console were:
After the experiment run : 

!ENTRY org.eclipse.jface 2 0 2011-06-06 13:57:25.890
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator
operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-06-06 13:57:25.890
!MESSAGE A conflict occurred for CTRL+SHIFT+P:
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(msi.gama.gui.application.commands.StepByStepSimulation,Next
Step,
        ,
        Category(org.eclipse.core.commands.categories.autogenerated,Uncategorized,Commands
that were either auto-generated or have no category,true),
        ,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    msi.gama.gui.application.simulation.context,,,system)
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(org.eclipse.xtext.ui.GotToMatchingBracketAction,Go to
Matching Bracket,
        Go to Matching Bracket,
        Category(org.eclipse.xtext.ui.category.XtextEditor,Source,Xtext Editing Commands,true),
        LegacyHandlerWrapper(ActionHandler(action=org.eclipse.xtext.ui.editor.bracketmatching.GoToMatchingBracketAction@e1b771)),
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.xtext.ui.XtextEditorScope,,,system)
66860 [main] DEBUG gama  - GamlExpressionFactory initialized
67313 [main] DEBUG gama  - Gama listener added :msi.gama.gui.application.views.AgentInspectView@f811b1
79985 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 started

=======================================================

And after the reload :

=======

94797 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 stopped
95297 [Thread-23] DEBUG gama  - Selection has changed :null
95297 [Thread-23] DEBUG gama  - Selection has changed :null
95297 [Thread-23] DEBUG gama  - Selection has changed :null
=============================================================================

Moreover when I run an Experiment with e.g. the StupidModel16, I start it, and that
afterwards I run a Experiment on another model, the StupidModel16 is actually run bt
without its display.

Hope it could help

Original issue reported on code.google.com by benoit.gaudou on 2011-06-06 12:05:10

pcaillou commented 9 years ago
Hi All,

I use windows XP, 32 bit.

My case seems to be like this, when I update the lastest version, then press CTRL +
R to run the model (because there is no run button activated) , there are some error
messages in eclipse console:

----------------------------------------------------------
!ENTRY org.eclipse.jface 2 0 2011-06-07 12:37:16.937

!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator
operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-06-07 12:37:16.937

!MESSAGE A conflict occurred for CTRL+SHIFT+P:
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(msi.gama.gui.application.commands.StepByStepSimulation,Next
Step,
        ,
        Category(org.eclipse.core.commands.categories.autogenerated,Uncategorized,Commands
that were either auto-generated or have no category,true),
        ,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    msi.gama.gui.application.simulation.context,,,system)
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(org.eclipse.xtext.ui.GotToMatchingBracketAction,Go
to Matching Bracket,
        Go to Matching Bracket,
        Category(org.eclipse.xtext.ui.category.XtextEditor,Source,Xtext Editing Commands,true),
        LegacyHandlerWrapper(ActionHandler(action=org.eclipse.xtext.ui.editor.bracketmatching.GoToMatchingBracketAction@827472)),

        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.xtext.ui.XtextEditorScope,,,system)
----------------------------------------------------------------------

I did not know the reason why?, please help me to correct this,

Cheers,
Nguyen Vinh

Original issue reported on code.google.com by nngvinh on 2011-06-07 05:45:28

pcaillou commented 9 years ago
Hi Vinh,

Your errors do not have anything to do with the reload. Are you sure you only get these
messages. 

Anyway, I've committed a version with more logging about the activity of threads, in
order to pinpoint the cause of the freezing on reloading. If anyone on Windows can
check, run the same models, and report the logs, it would be very helpful.

One bug that occured to me (and that I do not understand) is that, when trying to load
an experiment two times (not reloading it using the reload button, but loading it two
times in a rom), I sometimes lose all the displays (not the other outputs, just the
displays). Does it occur to others ? (it seems to be related to this case).

Original issue reported on code.google.com by alexis.drogoul on 2011-06-07 11:27:52

pcaillou commented 9 years ago
I just tested the last commit (windows 7, 64 bits), and I got this log:
...
58173 [Thread-12] DEBUG gama  - Experiment default: instantiating and initializing
a new simulation
67362 [Thread-12] DEBUG gama  - Experiment default: building outputs
70078 [main] DEBUG gama  - GamlExpressionFactory initialized
71895 [main] DEBUG gama  - Gama listener added :msi.gama.gui.application.views.AgentInspectView@10507ed5
75324 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 started
81927 [Thread-15] DEBUG gama  - Reloading experiment default on model StupidModel16
81928 [Thread-15] DEBUG gama  - Experiment default: Stopping current simulation
81928 [Thread-15] DEBUG gama  - Experiment default: closing current simulation
81928 [Thread-15] DEBUG gama  - Simulation 0 of experiment default being disposed
81928 [Thread-15] DEBUG gama  - Scheduler being disposed
81928 [Thread-15] DEBUG gama  - Setting the running flag to false
81929 [Thread-15] DEBUG gama  - Waiting for the output thread to finish updating
81929 [Thread-15] DEBUG gama  - Waiting for the execution thread to stop
81934 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 stopped
81934 [Thread-15] DEBUG gama  - Cleaning the different components
81993 [Thread-15] DEBUG gama  - Experiment default: instantiating and initializing
a new simulation
82397 [Thread-15] DEBUG gama  - Experiment default: building outputs
82399 [Thread-15] DEBUG gama  - Selection has changed :null
82408 [Thread-15] DEBUG gama  - Selection has changed :null
82408 [Thread-15] DEBUG gama  - Selection has changed :null

Patrick

Original issue reported on code.google.com by patrick.taillandier on 2011-06-07 11:53:02

pcaillou commented 9 years ago
Hi
I have exactly the same results on windows XP 32 bits...
Moreover to be more precise, I tested to
- run an experiment
- start it 
- then run another experiment on another model (NOT reload)
- start this second experiment (Note that this new experiment is actually run on the
first model and without any display (but with other outputs))
- finally reload the experiment (Note that in this case, as there is no display GAMA
does not freeze).

I tried to be as precise as possible in the following comments:

==================== Launch of GAMA ========================
....
1422 [main] DEBUG gama  - Processing ActionCommand
1422 [main] DEBUG gama  - Processing GamaIntMatrix

!ENTRY org.eclipse.team.svn.core.svnnature 4 0 2011-06-07 14:44:41.140
!MESSAGE SVN: 'Failed to run discovery connectors' operation finished with error
!SUBENTRY 1 org.eclipse.team.svn.core.svnnature 4 0 2011-06-07 14:44:41.140
!MESSAGE SVN: 'Failed to run discovery connectors' operation finished with error: Errors
occured while initializing provisioning framework. This make cause discovery install
to fail.
!STACK 0
org.eclipse.team.svn.core.operation.UnreportableException: Errors occured while initializing
provisioning framework. This make cause discovery install to fail.
    at org.eclipse.team.svn.ui.discovery.DiscoveryConnectorsHelper.run(DiscoveryConnectorsHelper.java:82)
    at org.eclipse.team.svn.ui.SVNTeamUIPlugin$1.run(SVNTeamUIPlugin.java:153)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.eclipse.team.svn.ui.discovery.DiscoveryConnectorsHelper.getInstallJob(DiscoveryConnectorsHelper.java:116)
    at org.eclipse.team.svn.ui.discovery.DiscoveryConnectorsHelper.run(DiscoveryConnectorsHelper.java:79)
    ... 2 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/equinox/p2/ui/ProvisioningUI
    at org.eclipse.team.svn.ui.discovery.PrepareInstallProfileJob_3_6.<init>(PrepareInstallProfileJob_3_6.java:78)
    ... 8 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.equinox.p2.ui.ProvisioningUI
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 9 more

================ Apres lancement ==========================

=================== Click-droit sur le model ==============

24437 [main] DEBUG gama  - #### Parsing + compile time : 0.104956636

26406 [main] DEBUG gama  - #### Parsing + compile time : 0.015851177

========== Apres Click-droit sur un model 

=== Run experiment =====

63890 [main] DEBUG gama  - #### Parsing + compile time : 0.009278274

64031 [main] DEBUG gama  - #### Parsing + compile time : 0.008462249

!ENTRY org.eclipse.jface 2 0 2011-06-07 14:45:40.125
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator
operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-06-07 14:45:40.125
!MESSAGE A conflict occurred for CTRL+SHIFT+P:
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(msi.gama.gui.application.commands.StepByStepSimulation,Next
Step,
        ,
        Category(org.eclipse.core.commands.categories.autogenerated,Uncategorized,Commands
that were either auto-generated or have no category,true),
        ,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    msi.gama.gui.application.simulation.context,,,system)
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(org.eclipse.xtext.ui.GotToMatchingBracketAction,Go to
Matching Bracket,
        Go to Matching Bracket,
        Category(org.eclipse.xtext.ui.category.XtextEditor,Source,Xtext Editing Commands,true),
        LegacyHandlerWrapper(ActionHandler(action=org.eclipse.xtext.ui.editor.bracketmatching.GoToMatchingBracketAction@1e6da0b)),
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.xtext.ui.XtextEditorScope,,,system)
66609 [Thread-19] DEBUG gama  - Experiment default: instantiating and initializing
a new simulation
84703 [Thread-19] DEBUG gama  - Experiment default: building outputs

================= Simulation REady ================

================= Click on start ===========
112984 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 started

============Run of a new model and experiment ============

162312 [main] DEBUG gama  - Experiment default: Stopping current simulation
162312 [main] DEBUG gama  - Simulation 0 of experiment default being disposed
162312 [main] DEBUG gama  - Scheduler being disposed
162312 [main] DEBUG gama  - Setting the running flag to false
162312 [main] DEBUG gama  - Waiting for the output thread to finish updating
162312 [main] DEBUG gama  - Waiting for the execution thread to stop
162328 [Scheduler execution thread #1] DEBUG gama  - Execution thread #1 stopped
162328 [main] DEBUG gama  - Cleaning the different components
162328 [main] DEBUG gama  - Selection has changed :null
162328 [main] DEBUG gama  - View to close : msi.gama.gui.application.view.LayeredDisplayView
: Rumor
162390 [Thread-23] DEBUG gama  - Experiment default: instantiating and initializing
a new simulation
162437 [Thread-23] DEBUG gama  - Experiment default: building outputs

====== Effect : no display AND same model !!

======= Start simulation ===========================

201890 [Scheduler execution thread #2] DEBUG gama  - Execution thread #2 started
212140 [Thread-24] DEBUG gama  - Reloading experiment default on model RumorMills
212140 [Thread-24] DEBUG gama  - Experiment default: Stopping current simulation
212140 [Thread-24] DEBUG gama  - Experiment default: closing current simulation
212140 [Thread-24] DEBUG gama  - Simulation 1 of experiment default being disposed
212140 [Thread-24] DEBUG gama  - Scheduler being disposed
212140 [Thread-24] DEBUG gama  - Setting the running flag to false
212140 [Thread-24] DEBUG gama  - Waiting for the output thread to finish updating
212140 [Thread-24] DEBUG gama  - Waiting for the execution thread to stop
212140 [Scheduler execution thread #2] DEBUG gama  - Execution thread #2 stopped
212140 [Thread-24] DEBUG gama  - Cleaning the different components
212140 [Thread-24] DEBUG gama  - Experiment default: instantiating and initializing
a new simulation
212187 [Thread-24] DEBUG gama  - Experiment default: building outputs
219640 [Scheduler execution thread #3] DEBUG gama  - Execution thread #3 started

Original issue reported on code.google.com by benoit.gaudou on 2011-06-07 13:02:01

pcaillou commented 9 years ago
Dear All,

I also get the latest update 2576 and run on Windows xp, 32 bit, when I run a model
by press ctrl + R and it seems to be freezed although I tried many times,  it occurs
the same messages as email before:

--------------------------------------------------------------------
!ENTRY org.eclipse.jface 2 0 2011-06-07 20:19:52.859
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator
operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-06-07 20:19:52.859
!MESSAGE A conflict occurred for CTRL+SHIFT+P:
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(msi.gama.gui.application.commands.StepByStepSimulation,Next
Step,
        ,
        Category(org.eclipse.core.commands.categories.autogenerated,Uncategorized,Commands
that were either auto-generated or have no category,true),
        ,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    msi.gama.gui.application.simulation.context,,,system)
Binding(CTRL+SHIFT+P,
    ParameterizedCommand(Command(org.eclipse.xtext.ui.GotToMatchingBracketAction,Go to
Matching Bracket,
        Go to Matching Bracket,
        Category(org.eclipse.xtext.ui.category.XtextEditor,Source,Xtext Editing Commands,true),
        LegacyHandlerWrapper(ActionHandler(action=org.eclipse.xtext.ui.editor.bracketmatching.GoToMatchingBracketAction@109f38f)),
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.xtext.ui.XtextEditorScope,,,system)
----------------------------------------------------------

Cheers,

Original issue reported on code.google.com by nngvinh on 2011-06-07 13:28:23

pcaillou commented 9 years ago
Well… Thanks for the feedback! There are actually two different bugs (the reloading
one and running a model after another), and I've been able to reproduce the second
one, on which I'm working right now. But still no luck for the first (original) one
: I get EXACTLY the same log reports as the ones mentioned by Patrick when running
a model and reloading it, but the display does not freeze (and the model is correctly
relaunched). I will probably post another update with more logging details to pinpoint
the problem...

Original issue reported on code.google.com by alexis.drogoul on 2011-06-07 15:23:56

pcaillou commented 9 years ago
In the latest commit, I have completely eradicated the "second" bug (loading a different
model than the one displayed, from the Simulation perspective). I have also tried a
solution to workaround the problem of reloading an experiment, by managing the updates
of the displays asynchronously rather than synchronously. Can you try it out ? 

Original issue reported on code.google.com by alexis.drogoul on 2011-06-07 19:31:27

pcaillou commented 9 years ago
I just tested the last revision of GAMA, and it seems to work perfectly now (Windows
7, 64 bits).

Original issue reported on code.google.com by patrick.taillandier on 2011-06-08 07:19:10

pcaillou commented 9 years ago
same same on Windows XP 32 bits 
:-)

Original issue reported on code.google.com by godzounet on 2011-06-08 15:57:48

pcaillou commented 9 years ago
It works correctly on my machine now (Snow Leopard, JVM6 32Bits).

Original issue reported on code.google.com by voducanvn on 2011-06-08 16:30:35

pcaillou commented 9 years ago
Good. We can probably consider this bug as fixed — although I'm still wondering why
I never had been able to reproduce it ! Thanks for all your comments and help!

Original issue reported on code.google.com by alexis.drogoul on 2011-06-10 03:24:47