New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault on entry of dead_macron #701
Comments
On 07.06.2016 20:17, Geoff wrote:
Yes, that works for me. |
What keyboard layout has these keys? Pasting into modal dialogs, such as the rename (whatever) text entry box, is known not to work, due to all hotkeys being disabled whenever a modal window is open. |
On 07.06.2016 20:22, Geoff wrote:
The original bug submitter wrote that he uses a custom xmodmap because https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825932#15 So it seems he simply added this character to an arbitrary key.. |
I don't know how to reproduce this input sequence on Windows, so will have difficulty investigating the issue. |
Hi there – I’m the submitter of the Debian bug. I wouldn’t call using AltGr + - to get a deadkey macron “arbitrary,” really... it was the most logical thing I could come up with 😄 A little googling seems to reveal that there’s a “English (New Zealand) - Maori” keyboard layout in Windows that maps the macron deadkey to the backtick <`>. See Keyboard setup for macrons. That seems like it might be the easiest way to test on Windows. Unfortunately, I don’t have admin access to a Windows machine to test that myself. I wasn’t aware that copy/paste worked in chat; I assumed it was universally broken because it doesn’t work in the modal dialog. Testing it now... on my machine, I can paste arbitrary text (including Greek characters and Latin letters with the macron) into chat, but typing the macron deadkey in chat crashes Freeorion just like typing it in a modal dialog. The irony of this, of course, is that the only reason I ever tried to type a macron in the game at all is that characters with macrons appear in star names in the game, and I was just trying to name one of my ships after one of my star systems! |
@geoffthemedio, is there a bug open for the copy/paste thing? I don’t see one... |
I don't keep careful track of such things. If you can't find it, it's probably not there, or was unobviously named. I set up a Maori keyboard layout. If I use it now, I get ā but in FreeOrion I just get `a but no crash. |
frame stack |
@dbenage-cx, yes, that’s exactly what I see – either in chat window or in a modal dialog (like ship or planet rename). Looks like you’re also on a Linux of some kind. |
using
altR+shift+3 results in the same framestack/locals (entry.text.text is different, but 0 is the same) Possible to silently ignore dead keys? @tkinias I am, though I'm just providing feedback in the hopes it is useful. Using the above, AltR+p displays ö. I did not check them all, but noticed many of the glyphs you noted displayed (when not needing dead keys). |
Does it help if you change the start (wrap the first line) of this function to:
|
It prevents the client from crashing, and continues to run
However, you can no longer exit the client (through Exit on menu or X on window)
|
Try
(or minor adjustments if that produces a compile error...) |
Allows exit, logs error on dead_macron. Sample of other typed chars: If Maori does not have dead keys, Greek Polytonic looks like it has a macron key '-' |
Greek Polytonic isn't in my available layouts, alas. So does everything exept macron deadkey work, or are those results not as expected? |
macron deadkey is the only one I've found to produce an exception. Mixed results with other dead keys, they either work or are silently ignored without an error. |
My experience is that many of the glyphs composed with deadkeys don’t work; they silently get replaced with the base character (e.g., ğ -> g, ő -> o). However, it’s only the macron that crashes the client. What it looks like to me is that any diacriticals which aren’t present in the old Latin-1 encoding get stripped out – so <á>, <ç>, etc. work, while diacriticals only present in the old Latin-2/3/4 encodings, for example, don’t. Curiously, I note that some of the characters that don’t work when typed are actually present in stringtables/en.txt and render correctly in the client: e.g., star name <Tàuṛa̋ṛȍ>. This renders correctly both when the star name is generated and when I paste it into chat, but if I try to type <ṛ> in the client I just get . |
Once text is in memory as valid UTF-8, pasted or from a stringtable lookup, it should be rendered fine (assuming fonts support it). Problems with text input / dead keys and such happen in mostly unrelated code, possibly within SDL input handler code, or the code that wraps it. |
Non-functional deadkeys may be an SDL problem: |
Hmm. That could well be. I’ve not encountered problems in any other We’re libsdl2.0-2 2.0.4+dfsg2-1 in Debian/Testing, and my freeorion.log On Wed, Jun 8, 2016 at 3:09 PM, Geoff notifications@github.com wrote:
Thanasis Kinias |
Should be fixed in that version of SDL, so it's probably something about how FreeOrion is interpreting the textinput messages then. |
FWIW, it appears that the “Invalid UTF8” message that’s dumped to STDERR Unfortunately I’m not very good at all with C++, so I’m having trouble On Wed, Jun 8, 2016 at 4:39 PM, Geoff notifications@github.com wrote:
Thanasis Kinias |
I can't test due to lack of a way to reproduce the exception, but I assume that when a problematic deadkey combination is entered, SDL is generating some events which GG handles here: https://github.com/freeorion/freeorion/blob/master/GG/src/SDL/SDLGUI.cpp#L692 (either a keyup, keydown, or textinput message). If it's a textinput event, I'm guessing that the crash within utf8::next happens on this line https://github.com/freeorion/freeorion/blob/master/GG/src/SDL/SDLGUI.cpp#L952 because the text being iterated over isn't valid UTF-8 for some reason. I can't really investigate myself, though. |
For the following tested dead keys, freeorion does not receive a textinput event from SDL:
An event is received only after a valid corresponding keypress, e.g. It does receive one after a macron dead key (see previous log).
Results in a Edit: The tested dead keys were with the |
Try putting breakpoints at line 694 and 702:
|
Need a full listing? |
Looks to me like SDL doesn't know what to do with your macron deadkey event... It appears to be sending just 'e' and not a modified character as occurs with the composed 'ü'. |
copy/cut/paste hotkeys should now work in modal dialogs. |
As the segfault is fixed, and I don't know how to do anything about the other nonfunctional deadkeys, I will close this. |
Hi,
I am hereby forwarding a Debian bug report.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825932
What I’m doing: Try to rename a fleet after the star system ‘Fehū’.
What happens: As soon as I hit the macron deadkey, attempting to type
the ‘ū’, FreeOrion segfaults. The following appears on the console:
The bug submitter also mentioned that:
– acute, grave, circumflex, cedilla, diaresis, tilde, and abovering work
(e.g., é, è, ê, ç, ö, ñ, å)
– micron, ogonek, caron, abovedot, and belowdot don’t cause a crash but do
nothing (e.g., ğ, ę, č, ė, ẹ just print g, e, c, e, e)
– doubleacute causes yet another behaviour: when I type ˝ + o, instead of
ő I get nothing at all
Copy and pasting from a character map doesn't work but this might be another bug.
freeorion.log and freeoriond.log are attached to the Debian bug report. The version is a Git snapshot from 1 May 2016.
The text was updated successfully, but these errors were encountered: