Menu

#2611 toggling fullscreen mode crashes when started with intro movie

Unspecified
closed-fixed
nobody
Java (4)
5
2022-08-21
2013-12-11
Lone_Wolf
No

trunk rev d28c97a

When freecol is started with --no-intro parameter toggling fullscreen works.
In case i start without that parameter, toggling crashes the game.
crash log is attached

1 Attachments

Discussion

  • Lone_Wolf

    Lone_Wolf - 2013-12-11

    I did some more testing, and it seems that the cases where fullscreen toggled worked, are not related to starting with/without intro.

    Attached another crash log, this time freecol was started WITH the --no-intro parameter

     
  • Mike Pope

    Mike Pope - 2013-12-12

    I can not reproduce this one, but the logs suggest a simple improvement.
    Did git.effb92e fix it for you?

     
  • Mike Pope

    Mike Pope - 2013-12-12

    All the stack traces in the logs are deep in the Java libraries. It may be that we are abusing them in actual FreeCol code, but it is unclear how. In each case, all I can do is catch the exception and continue hoping the GUI is not totally borked... and hope that oracle fixes Java. In git.0b34bab I have added such a catcher to the case above where freecol did fall over. See if that at least allows you to continue.

     
  • Lone_Wolf

    Lone_Wolf - 2013-12-12

    I checked with git.0b34bab and when pressing alt+enter during intro movie play, it now crashes differently.
    Before it just went back to desktop, and a java instance was still presen tin memory.
    Now it does fall back to desktop, but freecol is still shown in taskbar.
    When i maximize it, i see a not-fullscreen freecol screen with only a generic background and it can be closed by using the standard window control functions of the titlebar.
    After closing it, no freecol or java process is shown anymore, so this is a cleaner crash. This also suggest that the switch from fullscreen to windowed does work.

    I've looked in the attached log and noticed there's an java.lang.IllegalArgumentException: null source
    BEFORE canvas is called.
    In the earlier log of alt+enter on main menu which doesn't crash freecol, i also see that error.
    It looks to me as if the problem starts here :

    net.sf.freecol.client.gui.video.VideoComponent removeNotify
    WARNING: Mystery crash
    Thu Dec 12 23:57:59 CET 2013
    Thread: 15
    Stack trace:
    java.lang.IllegalArgumentException: null source

    that warning comes from
    /src/net/sf/freecol/client/gui/video , file VideoComponent.java
    and has these comments :
    // Java 1.7.0 as seen on Fedora with:
    // Java version: 1.7.0_40
    // Java WM version: 24.0-b56
    // crashes here deep in the java libraries.

    so a similar crash occured on 2 different linux distros and java versions that are rather far apart.

    Since the crash only occurs if alt+enter is used during the intro movie a simpler solution might be to disable alt+enter / fullscreen toggle keyboard shortcut for intro movie and main menu.

     
  • Mike Pope

    Mike Pope - 2013-12-13

    so a similar crash occured on 2 different linux distros and java versions that are rather far apart.

    Not that far alas. The comment only dates from a few months ago.

    I kicked it again in git.ad4b685. There are a few more things that can be tried, however without digging deep into the Java sources I am working in the dark here.

     
  • Lone_Wolf

    Lone_Wolf - 2013-12-13

    same behaviour with git.53aa4e4 as with git.0b34bab

     
  • Mike Pope

    Mike Pope - 2013-12-18

    This has been kicked again in git.e70a2d9. However crashes that look like:

    java.lang.IllegalArgumentException: null source
    at java.util.EventObject.<init>(EventObject.java:56)
    at java.awt.AWTEvent.<init>(AWTEvent.java:337)
    at java.awt.event.InvocationEvent.<init>(InvocationEvent.java:224)
    at java.awt.event.InvocationEvent.<init>(InvocationEvent.java:188)
    at java.awt.event.InvocationEvent.<init>(InvocationEvent.java:150)
    at sun.awt.X11.XBaseMenuWindow.dispose(XBaseMenuWindow.java:907)
    ...
    look like a Java problem to me.</init></init></init></init></init>

     
  • Lone_Wolf

    Lone_Wolf - 2013-12-19

    rev 9185eb4

    alt+enter during opening movie :
    small change in behaviour
    game falls back to desktop, with freecol in taskbar
    maximizing has no effect
    right-click on taskbar item gives normal freecol popup 'are you sure you want to quit'
    cancel removes popup, has no effect otherwise
    another right-click / close window gives same popup
    pressing ok cleanly shutdowns freecol

    alt+enter on freecol main menu gives errors in log, but doesn't crash at all.

    I do agree this looks a lot like a java bug.
    If possible i think disabling alt+enter (or all keyboard shortcuts) during opening movie is the simplest solution to get rid of the crash.

     
  • Mike Pope

    Mike Pope - 2013-12-20

    If possible i think disabling alt+enter (or all keyboard shortcuts) during opening movie is the simplest solution to get rid of the crash.

    I am quite reluctant to do this.

    • It is surprisingly messy and irksome to get right. I do not want a bunch of "Game starts but keyboard commands are disabled" bugs.
    • It masks the real bug. If we did do this (and get it working), and then oracle fixes Java, we will never know unless someone is diligent enough to keep turning off the workaround and testing. I do not want to make extra work for future developers. There are few enough of us already. What I would really like is a solution that keeps the game running but preserves the crash in the log file so we can see if it is still happening.
    • It disables functionality for anyone whose Java is not broken in this manner. Note that likely includes the non-X11 users. It even includes me ATM (Fedora 19, Java 1.7.0_45, 24.45-b08).
    • Low priority. We have much worse bugs. This one has an easy workaround.
     
  • Lone_Wolf

    Lone_Wolf - 2013-12-20

    It disables functionality for anyone whose Java is not broken in this
    manner. Note that likely includes the non-X11 users. It even includes me ATM
    (Fedora 19, Java 1.7.0_45, 24.45-b08).

    That gives a big clue to the real cause of this problem :
    I have exactly the same java version, but my freecol-git version is compiled with
    ant -Djava.target.version=1.7 package print-manual desktop-entry

    In other words, i'm forcing ant to compile against java 1.7, but the default value for that is still java 1.6 for freecol.

    Can you add a java 7 label to this bug ?

     

    Last edit: Lone_Wolf 2013-12-20
  • Lone_Wolf

    Lone_Wolf - 2013-12-20

    double post

     

    Last edit: Lone_Wolf 2013-12-20
  • Mike Pope

    Mike Pope - 2013-12-24
    • labels: --> openjdk
     
  • Mike Pope

    Mike Pope - 2013-12-24

    That gives a big clue to the real cause of this problem :
    I have exactly the same java version, but my freecol-git version is compiled with ant -Djava.target.version=1.7 package print-manual desktop-entry

    Alas, my testing was compromised. In an unrelated project I had bollixed up the keyboard modifiers on my machine, effectively disabling ALT. After realizing this and resetting I now have the same crashes as you on both versions of Java.

    Googling around shows that other people have the same problem, and that it was indeed caused by a recent openjdk update. See https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1016626 for example.

    I was also wrong on how easy it would be to disable ALT-Enter --- there is a patch about 6 months ago that if reverted would start the video earlier, before the keyboard commands are enabled. Unfortunately the crash still occurs as it is triggered by removal of the video window, and with that patch the crash is much more damaging --- it completely prevents removing the video window.

    So we are back to where we were. All I can do for now is recommend "Do not do that" until they fix openjdk. Indeed to be safe, just disable the opening video completely.

     
  • Mike Pope

    Mike Pope - 2014-06-08
    • labels: openjdk --> Java
     
  • Mike Pope

    Mike Pope - 2022-05-01

    Time has passed, and I can not reproduce this. Any more sightings, particularly on windows?

     
  • Mike Pope

    Mike Pope - 2022-05-01
    • status: open --> open-needs-info
     
  • Stian Grenborgen

    • status: open-needs-info --> closed-fixed
    • Group: Current --> Unspecified
     

Log in to post a comment.

MongoDB Logo MongoDB