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
vim segfaults on write #367
Comments
This sounds like a duplicate of Issue #349 |
Additional info: I am on e6a8d55 (develop branch). |
After an additional test I can confirm this! A colleague had not yet python-mode installed (ever). Took him as guinea pig and added python-mode to his bundles. That was about 3 hours ago. His first ever segfault happened just now. So it is indeed caused by python-mode! |
Just now, it also crashed on a simple Is there any way I can find more information on the |
I am having the same problem. I changed using master branch instead of developer branch and the problem is gone. The two branches show different actions when I do ':wq'. While the develop branch shuts down all windows and goes back to shell, the master version closes only the editing window and the lint window leaves alive, so I needed to do ':q' once again but it works without error. |
Same problem. Vim crashes if pylint return a lot of mistakes and user try to save changed file |
@jinhakang Interesting... I am also working on a "develop" branch. I have not paid attention to this fact. I cannot say if the problem exists on both "develop" and "master". But I will try to keep an eye out for this. The problem still persists for me and seems to happen very randomly. |
I have this problem too, I think. |
on the other hand. it works fine with the native osx vim, but brew vim crashes. will investigate further. |
my problem was having a .ropeproject in my home directory. I fixed it by deleting that. |
Just verified. I have no |
I came across this setting that helped for someone else on my research: did you try that yet? |
Not yet. I will do! For me it's very difficult to say, because it only happens very randomly. There can be weeks without problem, but then it can easily happen 5 times as day at other times :( I assume it's linked to how busy the machine is, but it's very hard to tell. I will try disabling the setting and see if I can get 1-2 months without problem. |
Didn't work. Even with |
I can verify that the |
I left python-mode for a while, and the problem disappeared. Came back because indentation and folding in python-mode just rock way too much ;) Alas, the segfaults have come back. Right now it happened when switching buffers (using |
First thing to note is that a SIGSEGV failure means the program accessed an illegal memory address. It means there is a bug in the core python implementation or a dynamically loaded library. Such failures can be triggered by python code (e.g., the python-mode code) doing something unexpected but the bug itself lies elsewhere. What operating system are you running? If it's Mac OS X you should have gotten a "Problem Report" dialog that shows relevant information like the stack of the process. If it's some other flavor of UNIX you may need to run "ulimit -c unlimited" to allow for a core dump to be saved. Then the next time vim dies run
The resulting backtrace might provide enough clues to identify or at least narrow down the cause of the failure. If not then things get more difficult since analyzing a core dump is something of an art form that can't be done via simple recipes. It's often simpler to eliminate variables (e.g., disable python-mode features one at a time) until the problem goes away then infer possible causes from that information. |
Thanks @krader1961 . I will try this on the next occasion. Will the |
The /path/to/core is the filename of the core dump. So if you have the core dump in hand you should know the path. Exactly where the core is written depends on your OS. On OS X it is the directory /cores (see the output of |
Hmmm... I don't see a path in |
Just had another segfault, but I find the
Not sure if the following has anything to do with this:
|
... just 5 minutes later, next segfault. With an identical backtrace. |
You can ignore the "Can't read pathname" warning. The backtrace is surprising but reasonable. I say surprising because I was sort of expecting the fault in a different routine such as one related to the embedded python interpreter. There are only a couple of reasons the update_screen function would SIGSEGV. The first is that the current window variable (curwin) was a bogus address. Not very likely. The second that one of the pointers in the window linked list was bogus (or equivalently the linked list was damaged). The third, and I think most likely, is that the buffer address associated with one of the windows was bogus. My SWAG is that the lint checkers are somehow creating a window to display lint results but not associate a buffer with the window. I find that with these types of problems it greatly helps the debugging if you can find way to reproduce the failure on demand. Or at least frequently enough to make it feasible to explore various hypotheses. Try disabling the lint checkers at file write time: |
I have been trying many times to find a way to reproduce it. I haven't been able to do so yet. Even if I have a file open which causes the crash an re-open/close it multiple times, it refuses to crash in a predictable manner :( I will continue to try. I will also tell my co-workers to do so (we all suffer from the same issue). On a side-note, we mostly work on a multi-user system. So we all use the same vim binary and system libraries. The thing which may vary is everything user-related (plugins, plugin-versions and vim config). I have the sneaking impression that it happens most predictably on As |
I seem to have something which crashes all the time. First, my vim version info:
And then here's a simple bash script which creates an environment which, without fail always crashes (at least so far...). Just run the script from within an empty folder. Alternatively, read it and execute the steps manually ;) Note: I have added the
|
Excellent. I'll try to reproduce in a few hours (it's 0700 where I'm at and I'm about to walk my dogs). I never use |
Sorry but I can't reproduce this on either Linux (Ubuntu) or Mac OS X 10.9.4 using Vim 7.4 (via Homebrew on OS X). Using the native /usr/bin/vim (Vim 7.3) on OS X I also could not reproduce the problem but did see interesting, unexpected, behavior. Specifically, this
was written at the bottom of the screen, no lint message buffer was displayed, and Vim was left in a weird state. Typing 'j' did not move the cursor down one line. Instead it echoed a literal 'j' to the screen on the first line of the window (where the cursor was). Typing ":quit" exited Vim. I suspect that behavior is a different manifestation of the problem you're seeing. Can you try to reproduce the problem using Vim 7.4? |
I'll give it a go. In any case, the machine on which this is running, is scheduled to be upgraded in the next months, so it should automatically get 7.4. We'll see how this goes. I find it useful to investigate nonetheless, as other people seem to run into this as well. Thanks a lot for the effort in any case :) |
Hmmm... I just have vim re-compiled myself (7.3) and don't seem to have the problem anymore. I'm currently on a holiday, but will try next week to do the same at work. |
I seem to able to reproduce the error on each machine where the official vim 7.3 package is installed (All kubuntu by the way). Since this error is really sporadic, and really hard to reproduce in a controlled manner, I have tried to install vim 7.4 and can say that I no longer have this issue. Same as 7.3 in my previous comment. So, normally I would consider it to be a problem with the vim package in *buntu. However, a co-worker is still using the official kubuntu package (I consider him my one-man control-group 😆 ) and he himself has no issues any longer. We all work mostly on one shared development box, so the only thing different between him and me is the installed vim version. I installed 7.4 with a separate prefix, so they don't interfere with each other. I also did not need to install any other system dependencies which could have caused the official package to "suddenly work". I would tend to say that, if anyone else can confirm this, we could consider this issue closed? I am yet a bit reluctant, as neither my personal guinea pig nor me had any issue for the same amount of time. Might still be pure coincidence again... 😢 |
@exhuma I confirm that I have the same issue. It is master branch of python-mode and vim compiled from latest source code. |
Seems, I did not have enough memory in my virtual machine. Vim took 600Mb. |
Interesting. I just checked our graphs, and saw that our sysadmin added some memory around the time I switched to vim 7.4. Apparently, there have been no problems with 7.3 as well now for some time. If this really turns out to be the solution then I feel stupid. However, I wonder why I got a segfault instead of an OOM error. Are segfaults not related to errors where a process tries to access memory it does not have access to? Could it be that the OS interfered with the process somehow? @krader1961 do you have any insight on this? That is a bit out of my area of expertise. You seem to have more experience in that area ;) |
@exhuma As you noted a SIGSEGV failure means the process attempted an invalid memory access. This is usually because the address is invalid (e.g., zero or NULL) but can also occur if, for example, an attempt is made to write to a read-only page. OOM failures will frequently result in SIGSEGV failures because way too much code simply assumes that a malloc() call (or C++ "new", etc.) will always succeed and thus not confirm that the allocation succeeded. When it subsequently tries to use the invalid pointer you get a SIGSEGV. I personally consider failing to check for memory allocation failures and issuing an appropriate diagnostic before gracefully exiting a bug. But the practice is so prevalent that you might as well put on your Don Quixote costume and tilt at windmills. P.S., Note that a kernel OOM is related to but not the same thing as a process OOM. Either can occur without the other occurring at the same time. |
That makes perfect sense. Thank you! I was planning to make a VM with little to no memory to see if this will reproduce the error, but I got held up. If that's the case, I would be okay to mark this as a "won't fix" as it may not be the fault of python-mode at all. I will keep you posted. |
It does not seem to be a memory issue. The problem has suddenly appeared again on both the box where that one team member still works with vim 7.3 and on my personal laptop. Both machines have nothing in common except it being Ubuntu 12.04 LTS and vim 7.3. Really bizarre that it was all fine for the past month and now, within a week a couple of crashes on two distinct machines. I am completely out of ideas. And given that it seems fine in vim 7.4, I would suggest that this is the "recommended workaround" for this? At least that way this ticket can be closed. Given the random nature of this bug, I don't see how we can effectively pinpoint the cause. |
I'm seeing a version of this on Vim 7.3.315 on an old, old Fedora Core 14 install (my university department is horribly behind). Specifically, if I run
printed on the console. |
I'm having this problem too. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closed due to inactivity. |
Edit: Also happens on simple
:w
Two colleagues of mine have told me that thei vim segfaults regularly. But only on save/quit (
:wq
). I tried to find out why, but could not find the culprit. We all have pretty much the same plugins installed. In any case, we have rules out plugins for a while. After all I have all those installed as well, and have no seg-faults.Recently I upgraded python-mode. Since then I get the same problem.
I cannot tell you much more other than it seems to happen only on write+quit.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: