dmtcp icon indicating copy to clipboard operation
dmtcp copied to clipboard

In restore_term_settings(), we can see "skip restore terminal step -- we are in BACKGROUND" for an unknown reason

Open gc00 opened this issue 6 years ago • 1 comments

In test/plugin/applic-initiated-ckpt, if we do 'make check', we correctly see at the end:

===== RESTARTING USING ./dmtcp_restart_script.sh =============
./dmtcp_restart_script.sh
*** dmtcp_checkpoint: This program is now restarting.

*** Process done executing.  Successfully exiting.

But if we then execute ./dmtcp_restart_script.sh (with no intervening make clean), then we see the following warning, and we can no longer place the restarted process in the foreground:

HOSTNAME:applic-initiated-ckpt% ./dmtcp_restart_script.sh 
[40000] WARNING at terminal.cpp:92 in restore_term_settings; REASON='JWARNING(false) failed'
Message: :skip restore terminal step -- we are in BACKGROUND

We should understand why this occurs, and fix it.

gc00 avatar Aug 14 '19 06:08 gc00

I encountered this in a Docker container of CentOS 7 on an OS X host.

In https://github.com/dmtcp/dmtcp/blob/master/src/terminal.cpp#L71

tcgetpgrp(STDIN_FILENO); // 1
getpgrp(); // 40000

I saw this first in a new project, but then again in an unmodified applic-initiated-ckpt. Can I help with any logs?

[root@46af37aa25a3 applic-initiated-ckpt]# dmtcp_launch ./applic
*** dmtcp_checkpoint: This program has now invoked a checkpoint.
      It will resume its execution next.

*** Process done executing.  Successfully exiting.
*** Execute ./dmtcp_restart_script.sh to restart.
[root@46af37aa25a3 applic-initiated-ckpt]# ./dmtcp_restart_script.sh
WARNING:  Running dmtcp_restart as root can be dangerous.
  An unknown checkpoint image or bugs in DMTCP may lead to unforeseen
  consequences.  Continuing as root ....
[root@46af37aa25a3 applic-initiated-ckpt]# [40000] NOTE at processinfo.cpp:498 in restoreHeap; REASON='Area between saved_break and curr_break not mapped, mapping it now'
     _savedBrk = 23728128
     curBrk = 93825006047232
[40000] WARNING at terminal.cpp:92 in restore_term_settings; REASON='JWARNING(false) failed'
Message: :skip restore terminal step -- we are in BACKGROUND
*** dmtcp_checkpoint: This program is now restarting.

*** Process done executing.  Successfully exiting.

whitehat101 avatar May 15 '20 22:05 whitehat101