[Users] Oddity: Recent upgrade to claws leaves my external editor with a blank page

Thorsten Maerz info at netztorte.de
Wed Jan 12 06:50:00 UTC 2022


On Sun, 9 Jan 2022 15:58:51 -0500
Steven Lembark <lembark at wrkhors.com> wrote:

> > The "tmpfile.*" contains the full email message including headers.
> > The "tmpmsg.*" contains the extracted message body passed to the
> > external editor.  
> 
> Ran "strace claws-mail", truncated the file to the point where I've
> right-clicked on the message and picked reply. Result was the c-m
> window showing up with the original input and a copy of xvile with
> empty text. 
> 
> https://pastebin.com/T7Lq4U87

Your editor *does* fork.

Starting from line 2174:

  openat(AT_FDCWD, "/home/lembark/.claws-mail/tmp/tmpmsg.0x56296f6ce010", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 18
  fchmod(18, 0600)                        = 0
  newfstatat(18, "", {st_mode=S_IFREG|0600, st_size=0, ...}, AT_EMPTY_PATH) = 0
  write(18, "On Sun, 9 Jan 2022 10:53:05 +010"..., 781) = 781
  close(18)                               = 0

Here, the message body gets written to tmpmsg.0x56296f6ce010.
It wanted to write 781 chars, starting with "On Sun, 9 Jan"
and succeeded: write() returned 781 written chars.

Immediately(!) after that, Claws receives the SIGCHLD:CLD_EXITED signal.
It means, the editor process terminated normally - either because it
really terminated (why should it?) or spawned a new process for staying
in the background and killed its father (expected behaviour, though
unwanted, because it shouldn't spawn):

Lines 2179..2192
  pipe2([18, 19], 0)                      = 0
  clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7efc0cd4cf50) = 27661
  close(19)                               = 0
  read(18, "", 8)                         = 0
  close(18)                               = 0
  rt_sigaction(SIGCHLD, {sa_handler=0x7efc1022bb30, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_NOCLDSTOP, sa_restorer=0x7efc0fd57830}, NULL, 8) = 0
  wait4(27661, 0x56296ed8c954, WNOHANG, NULL) = 0
Here the editor has closed:
  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=27661, si_uid=1024, si_status=0, si_utime=0, si_stime=0} ---
  write(17, "\1\0\0\0\0\0\0\0", 8)        = 8
  rt_sigreturn({mask=[]})                 = 94735956188112
  poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN|POLLPRI}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 7, 0) = 1 ([{fd=5, revents=POLLIN}])
  read(5, "\4\0\0\0\0\0\0\0", 16)         = 8
  poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN|POLLPRI}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 7, 0) = 0 (Timeout)
  poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN|POLLPRI}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 7, 0) = 0 (Timeout)

And finally (directly afterwards), Claws read the same file again.
It tried to read max. 4096 chars and successfully read 781 chars,
starting with "On Sun, 9 Jan". Looks exactly like the content, that got
written to it first.

Lines 2193..2198:
  newfstatat(AT_FDCWD, "/home/lembark/.claws-mail/tmp/tmpmsg.0x56296f6ce010", {st_mode=S_IFREG|0600, st_size=781, ...}, 0) = 0
  openat(AT_FDCWD, "/home/lembark/.claws-mail/tmp/tmpmsg.0x56296f6ce010", O_RDONLY) = 18
  newfstatat(18, "", {st_mode=S_IFREG|0600, st_size=781, ...}, AT_EMPTY_PATH) = 0
  read(18, "On Sun, 9 Jan 2022 10:53:05 +010"..., 4096) = 781
  read(18, "", 4096)                      = 0
  close(18)                               = 0

The next line explains the empty text in vile:
Immediately after reading, the tmpmsg gets deleted.
If spawning a new vile process takes longer than deleting the file,
it can only display empty content.

Line 2199:
  unlink("/home/lembark/.claws-mail/tmp/tmpmsg.0x56296f6ce010") = 0


Everything works as expected.
Except you didn't prevent your editor from forking.


-- 
Best regards,
Thorsten


More information about the Users mailing list