https://bugs.kde.org/show_bug.cgi?id=483631

            Bug ID: 483631
           Summary: Legacy VI-Mode config crashes kate and kwrite
    Classification: Applications
           Product: kate
           Version: 24.02.0
          Platform: Neon
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: application
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: hoheneg...@web.de
  Target Milestone: ---

SUMMARY

Kate and kwrite fail to digest certain legacy configuration and crash during
startup.

STEPS TO REPRODUCE
1.  Insert specific config in your $HOME/.config/katevirc :

[Kate Vi Input Mode Settings]
Command Mode Mapping Keys=
Command Mode Mappings=
Command Mode Mappings Recursion=
Insert Mode Mapping Keys=
Insert Mode Mappings=
Insert Mode Mappings Recursion=
Macro Completions=
Macro Contents=
Macro Registers=
Map Leader=,
Normal Mode Mapping Keys=<c-v>,<s-insert>,v<left>w
Normal Mode Mappings="+gP,"+gP,vb
Normal Mode Mappings Recursion=false,false,false
ViRegisterContents=inconclusive,\t\t\t\t\t<p>\n\t\t\t\t\t\tIn contrast to
previous evaluation\\, the evaluator determined that <b>no</b> additional
packages that be acquired this time. The distribution DVDs are in fact
self-contained. \n\t\t\t\t\t\t<!--are clearly identified in the
<bibref>ECG</bibref> and a URL is given so that the administrator can find the
additional packages on the SUSE FTP site. Sufficient instructions are given so
that the administrator can reasonably be expected to find and download the
correct additional packages. The evaluator found also that sufficient
instructions are given so that the administrator can check the integrity of the
downloaded packages using the instructions given.-->\n\t\t\t\t\t</p>\n,<dl>\n  
                  The extended components definition in ASE_ECD.\n             
    </dl>\n                  <dt>\n                  </dt>\n                 
<dl>\n                     The remaining\\, non-mandatory parts of the ST.\n   
              </dl>\n                  <dt>\n                  </dt>\n         
     </ul>
ViRegisterFlags=0,1,0
ViRegisterNames=-,0,^
Visual Mode Mapping Keys=<s-c-a-m-><s->,<c-x>,<c-c>,<c-insert>
Visual Mode Mappings="+y,"+x,"+x,"+y
Visual Mode Mappings Recursion=false,false,false,false

2.  Run kate or kwrite
3.  Observe the crash

OBSERVED RESULT

The application crashes during startup.

Output of "strace kwrite" is:

readlink("/home", 0x7ffc14ffd8f0, 1023) = -1 EINVAL (Invalid argument)
readlink("~", 0x7ffc14ffd8f0, 1023) = -1 EINVAL (Invalid argument)
readlink("~/.config", 0x7ffc14ffd8f0, 1023) = -1 EINVAL (Invalid argument)
readlink("~/.config/katevirc", 0x7ffc14ffd8f0, 1023) = -1 EINVAL (Invalid
argument)
openat(AT_FDCWD, "/home/andreas/.config/katevirc", O_RDONLY|O_CLOEXEC) = 19
statx(19, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL,
{stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600,
stx_size=1666, ...}) = 0
statx(19, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL,
{stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600,
stx_size=1666, ...}) = 0
statx(19, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL,
{stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0600,
stx_size=1666, ...}) = 0
read(19, "[Kate Vi Input Mode Settings]\nCo"..., 16384) = 1666
read(19, "", 14718)                     = 0
close(19)                               = 0
openat(AT_FDCWD, "/dev/tty", O_RDONLY|O_CLOEXEC) = 19
close(19)                               = 0
write(2, "ASSERT: \"rc <= 0xffff\" in file /"..., 89ASSERT: "rc <= 0xffff" in
file /usr/include/x86_64-linux-gnu/qt6/QtCore/qchar.h, line 79
) = 89
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 680280
getpid()                                = 680280
tgkill(680280, 680280, SIGABRT)         = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=680280, si_uid=1001}
---
+++ killed by SIGABRT +++
Aborted

I do not get offered a debug option, therefore, no complete debug logs
included.

EXPECTED RESULT

Kwrite and kate handle the apparently invalid config gracefully and startup
normally.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon user edition
KDE Plasma Version: 6.0.2
KDE Frameworks Version: Version 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

I upgraded from KDE Neon user edition where the config used to work.
It suffices to remove the line 
Visual Mode Mapping Keys=<s-c-a-m-><s->,<c-x>,<c-c>,<c-insert>
from above config.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to