Closed kseistrup closed 12 months ago
Thank you for filing this issue, I hope we can figure this out. It's quite strange, looks like a corrupted string.
Would you be able to update the build to the last version (anything after 9520beb) and attach the output of the following command?
GLOG_alsologtostderr=y GLOG_vmodule=environment=10,help_command=10 edge --tests=run --tests_filter=HelpCommand::GenerateContents.GenerateContents
This should generate a lot of log lines as it runs (in my build that outputs 268 lines; it'll probably be fewer for you, since we expect it to crash), lines like this:
I1114 07:32:46.898674 18848 environment.cc:270] ForEachNonRecursive: Running callback on: terminal_control_d
I1114 07:32:46.898676 18848 help_command.cc:254] Generating view for variable: terminal_control_d
I1114 07:32:46.898679 18848 help_command.cc:255] Type: string
I1114 07:32:46.898680 18848 help_command.cc:258] Adding to output.
If you could upload that output, that would be very helpful: seeing what symbol was being expanded when the crash is triggered may help me narrow down where the problem may be.
Thank you once again for your time/help with this.
Edge built from commit 9520bebb9824bae51761747229f2f9bdb8fa5d03
📎 edge-9520bebb9824bae51761747229f2f9bdb8fa5d03.txt
I don't understand the output, but I do notice that “LTO” occurs a few times. My troubles are not because my default CFLAGS have -flto
, is it?
@ 0x5577e35ce40b _ZNK3afc10concurrent9ProtectedINS_2vm11Environment4DataENS0_14EmptyValidatorIS4_EELb1EE4lockIZNKS3_19ForEachNonRecursiveESt8functionIFvRKNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEERKNS_8language2gc3PtrINS2_5ValueEEEEEEUlRKS4_E_EEDaT_.lto_priv.0
@ 0x5577e33d1b3b _ZN3afc6editor12_GLOBAL__N_111HelpCommand16GenerateContentsERKNS0_15MapModeCommandsERKNS0_10OpenBufferE.lto_priv.0
@ 0x5577e33dbf12 _ZNSt17_Function_handlerIFvvEN3afc6editor12_GLOBAL__N_1L19buffer_registrationMUlvE_EE9_M_invokeERKSt9_Any_data.lto_priv.0
[One hour later…]
Recompiling everything without LTO doesn't change anything:
:paperclip: edge-err-2.txt
Thank you for posting that, that was very helpful and now I understand what's going on.
There's a bug where I'm storing negative numbers inside a std::wstring instances in a few places. I use the negative values (e.g., -7) to represent special characters (i.e., "the user pressed backspace", "the user pressed left arrow"). This happens in terminal_backspace
and a few other related symbols. I had assumed that storing negative values is OK, but ... this is an abuse of the std::wstring type, at best. I don't know why it doesn't crash in my machine.
Fixing that shouldn't be too hard, but I'll need to come up with some separate representation for these values (perhaps a vector of
Thanks again!
Hello.
I expect this issue should be fixed by https://github.com/alefore/edge/commit/3f67b6ca91195365f941736127c96f4e3e2c36ee. That's a fairly large change. Hopefully I didn't break anything else accidentally. :-)
Could you sync to the latest version and confirm that the crash (from pressing ?
) and the test failure (from edge --tests=run --tests_filter=HelpCommand::GenerateContents.GenerateContents
) went away?
Thank you once again!
I hope commit 5cbeacc2db305270439dc71390b97628efc2611d (“Fix use-after-free bug”) is okay.
Pressing ?
no longer crashes the editor, and the test failure doesn't produce any error output.
Great, thank you for confirming. Looks like we nailed it. :)
Edge built from commit 8fdf7f76ffa167497a7e9e9228b26b1f2dcf95e9 crashes with
SIGABRT
if?
is pressed to get help while running Edge:This issue was originally included in #6.