New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to save file via Tramp mode leads to abort #500
Comments
I ran this again inside a gdb session, and it's somewhat more informative... #0 0x00007ffff1ea2f9f in raise () at /lib/x86_64-linux-gnu/libpthread.so.0 |
Hello @cbbrowne , is this happening for any arbitrary file? That stack trace is leading me to believe that this is tied to the data that is being base64 encoded in the region. The code in question: encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg),
encoded, length, NILP (no_line_break),
!NILP (BVAR (current_buffer, enable_multibyte_characters)));
if (encoded_length > allength)
emacs_abort (); |
I did test with multiple files; all were pretty plain text. In the case for which I dropped in the backtrace, the only file edited in the session was a shell script. (An "init" script to start up PostgreSQL in user space, though that's probably not highly relevant!) There should not have been any base64 portions of the buffer; it was plain old shell script, no UTF-8 or such to complicate life. That said, this was in Tramp mode, using ssh to transmit data. I would not be at all surprised if Tramp mode re-encodes data into base64 for transmission. |
This reproduces easily. Fire up remacs, make a region out of some text and do |
To be more exact, it appears to fail when the entire buffer is encoded. So open a file and try to encode the whole thing. |
So it turns out we were not passing the option we needed to the base64 crate. This leads to us using more memory than expected and triggering the check which called The PR sets the proper value. |
With that change, I am no longer experiencing the aborts, so that sure does look like an improvement. |
👍 |
I'm running latest (git pull on 2017-11-23), on Linux, which consistently aborts in the following case...
Using Tramp mode to access a remote file via ssh (/ssh:cbbrowne@remotehost:~/somefile.sh)
Make some changes to the file
Use c-x c-s to save the file
On stderr, I see output of the form...
Backtrace:
remacs[0x505d17]
remacs[0x4ecb37]
remacs[0x505db3]
remacs[0x561d29]
remacs[0x55e888]
remacs[0x55eeb8]
remacs[0x55c67b]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x55e050]
remacs[0x55c700]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x55e050]
remacs[0x55c700]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x55fb4c]
remacs[0x521bea]
remacs[0x522c2f]
remacs[0x55d671]
remacs[0x55c700]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x55919d]
remacs[0x55c700]
remacs[0x559a49]
remacs[0x55c700]
remacs[0x58e015]
remacs[0x55c67b]
remacs[0x55c7ba]
remacs[0x4faffc]
remacs[0x55b93e]
remacs[0x4ecef4]
remacs[0x55b8ad]
...
[1] + 1780 abort remacs
The entire remacs session terminates at that point.
This has been repeatable for a couple of weeks. This is obviously a few layers deep into ssh + tramp, and I'm not sure at all what to point at as cause or effect.
The text was updated successfully, but these errors were encountered: