Question

I have flymake enabled in my Emacs configuration. Locally it works fine, but when I try to open a remote html file with tramp, Emacs hangs and I have to kill it.

I tried to check with gdb, and the top of the stack is as follows:

#0  0x00007fcee786c83c in __pselect (nfds=<optimized out>, readfds=<optimized out>, writefds=<optimized out>, exceptfds=<optimized out>, timeout=<optimized out>, sigmask=<optimized out>)
at ../sysdeps/unix/sysv/linux/pselect.c:79
#1  0x00000000004d02f7 in xg_select (fds_lim=13, rfds=0x7fff4d830210, wfds=0x0, efds=0x0, timeout=0x7fff4d830460, sigmask=0x0) at xgselect.c:48
#2  0x00000000005947f3 in wait_reading_process_output (time_limit=<optimized out>, nsecs=0, read_kbd=0, do_display=false, wait_for_cell=12096626, wait_proc=<optimized out>, just_wait_proc=1) at process.c:4633
#3  0x0000000000597429 in Faccept_process_output (process=56383997, seconds=<optimized out>, millisec=<optimized out>, just_this_one=<optimized out>) at process.c:4026

So it seems that for some reason the xmlstarlet process on the remote machine, but I have no idea why.

The command that flymake uses should be xmlstarlet val filename.html, which executes with no problems from the command line. Configuring flymake to use other programs such as tidy or xmllint doesn't change anything.

Any suggestion on what I could do to be able to debug the issue ?

Edit

In fact after a while (at least 1 minute) the command completes. After the startup there are no longer waits for the same buffer, and flymake works as expected.

Details on the system

I'm connecting from an Ubuntu 12.04 machine. I tried to connect to a FreeBSD 9.3 machine, but I have the same problem on a DragonflyBSD machine. The remote shell is zsh on both systems, but changing it to bash doesn't help.

Stacktrace

This is the full lisp stacktrace I get.

https://gist.github.com/mrighele/8371399

the flymake-html-init is the one presented in the emacs wiki

Interestingly, when I send the signal, the content of the file buffer is overwritten with the following, not sure if it is of any interest.

tramp_perl_file_truename () {
function> \perl5 -e '
function quote> use File::Spec;
function quote> use Cwd "realpath";
function quote> sub recursive {
function quote>     my ($volume, @dirs) = @_;
function quote>     my $real = realpath(File::Spec->catpath(
function quote>                    $volume, File::Spec->catdir(@dirs), ""));
function quote>     if ($real) {
function quote>         my ($vol, $dir) = File::Spec->splitpath($real, 1);
function quote>         return ($vol, File::Spec->splitdir($dir));
function quote>     }
function quote>     else {
function quote>         my $last = pop(@dirs);
function quote>         ($volume, @dirs) = recursive($volume, @dirs);
function quote>         push(@dirs, $last);
function quote>         return ($volume, @dirs);
function quote>     }
function quote> }
function quote> $result = realpath($ARGV[0]);
function quote> if (!$result) {
function quote>     my ($vol, $dir) = File::Spec->splitpath($ARGV[0], 1);
function quote>     ($vol, @dirs) = recursive($vol, File::Spec->splitdir($dir)<sive($vol, File::Spec->splitdir($dir))                                       <sive($vol, File::Spec->splitdir($dir));
function quote>     $result = File::Spec->catpath($vol, File::Spec->catdir(@di<>catpath($vol, File::Spec->catdir(@dir                                       <>catpath($vol, File::Spec->catdir(@dirs), "");
function quote> }
function quote> if ($ARGV[0] =~ /\/$/) {
function quote>     $result = $result . "/";
function quote> }
function quote> print "\"$result\"\n";
function quote> ' "$1" 2>/dev/null
function> } 2>/dev/null; echo tramp_exit_status $?
tramp_exit_status 0
Was it helpful?

Solution

Try the following:

(setq debug-on-event 'sigusr2)

and then when Emacs is frozen, do kill -USR2 <emacspid> from a shell. That should hopefully give you a lisp-level backtrace which will help track down the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top