[vim/vim] Test_write_errors() fails: Expected 'E505: ' but got 'E503: …' (#8205)

11 views
Skip to first unread message

Dominique Pellé

unread,
May 13, 2021, 9:01:04 PM5/13/21
to vim/vim, Subscribed

Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64 machine.

The test was recently introduced by:

commit 36f96a515109dc1fad279571a645c0f0d65f2de4 (tag: v8.2.2849)
Author: Yegappan Lakshmanan <yega...@yahoo.com>
Date:   Thu May 13 18:33:16 2021 +0200

    patch 8.2.2849: bufwrite not sufficiently tested
    
    Problem:    Bufwrite not sufficiently tested.
    Solution:   Add a few more tests. (Yegappan Lakshmanan, closes #8192)

To Reproduce

$ cd vim/src/testdir
$ make test_writefile
...snip...
Executed 28 tests                        in   1.875718 seconds
1 FAILED:
Found errors in Test_write_errors():
command line..script /home/pel/sb/vim/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_write_errors line 53: Expected 'E505: ' but got 'E503: "/dev/loop0" is not a file or writable device': write
$ ls -l /dev/loop0
brw-rw---- 1 root plugdev 7, 0 mei 13 18:37 /dev/loop0

Environment

  • OS: xubuntu-18.04.5
  • Vim version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 14 2021 02:36:52)
Included patches: 1-2850
Compiled by pel@pel-cirrus7
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
+balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
+browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
+clientserver      +job               +persistent_undo   +toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con_gui    +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       +X11
+dnd               +mouse             +sound             -xfontset
-ebcdic            +mouseshape        +spell             +xim
+emacs_tags        +mouse_dec         +startuptime       +xpm
+eval              +mouse_gpm         +statusline        +xsmp_interact
+ex_extra          -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang-12 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DEXITFREE -DABORT_ON_INTERNAL_ERROR 
Linking: clang-12 -Wl,-E -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lselinux -lcanberra -lacl -lattr -lgpm -ldl -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm 


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yegappan Lakshmanan

unread,
May 13, 2021, 9:34:47 PM5/13/21
to vim_dev, reply+ACY5DGA6UBST2Z4EGO...@reply.github.com, vim/vim, Subscribed
Hi Dominique,

On Thu, May 13, 2021 at 6:01 PM Dominique Pellé <vim-dev...@256bit.org> wrote:

Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64 machine.


I am running Ubuntu 21.04 and the test passes there. If you manually
edit /dev/loop0 and run the ":write" and ":write!" commands, what error
code do you see? Do you run as a user who has root privileges?

Thanks,
Yegappan

vim-dev ML

unread,
May 13, 2021, 9:35:11 PM5/13/21
to vim/vim, vim-dev ML, Your activity

Hi Dominique,

On Thu, May 13, 2021 at 6:01 PM Dominique Pellé ***@***.***>
wrote:


> Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64
> machine.
>

I am running Ubuntu 21.04 and the test passes there. If you manually
edit /dev/loop0 and run the ":write" and ":write!" commands, what error
code do you see? Do you run as a user who has root privileges?

Thanks,
Yegappan


> The test was recently introduced by:
>
> commit 36f96a515109dc1fad279571a645c0f0d65f2de4 (tag: v8.2.2849)
> Author: Yegappan Lakshmanan ***@***.***>

> Date: Thu May 13 18:33:16 2021 +0200
>
> patch 8.2.2849: bufwrite not sufficiently tested
>
> Problem: Bufwrite not sufficiently tested.
> Solution: Add a few more tests. (Yegappan Lakshmanan, closes #8192)
>
> *To Reproduce*

>
> $ cd vim/src/testdir
> $ make test_writefile
> ...snip...
> Executed 28 tests in 1.875718 seconds
> 1 FAILED:
> Found errors in Test_write_errors():
> command line..script /home/pel/sb/vim/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_write_errors line 53: Expected 'E505: ' but got 'E503: "/dev/loop0" is not a file or writable device': write
>
> $ ls -l /dev/loop0
> brw-rw---- 1 root plugdev 7, 0 mei 13 18:37 /dev/loop0
>
> *Environment*
>
> - OS: xubuntu-18.04.5
> - Vim version

>
> VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 14 2021 02:36:52)
> Included patches: 1-2850
> Compiled by ***@***.***

Dominique Pellé

unread,
May 14, 2021, 3:36:13 AM5/14/21
to vim/vim, vim-dev ML, Comment

On Fri, May 14, 2021, 03:35 vim-dev ML ***@***.***> wrote:

> Hi Dominique,
>
> On Thu, May 13, 2021 at 6:01 PM Dominique Pellé ***@***.***>
> wrote:
>
> > Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64
> > machine.
> >
>
> I am running Ubuntu 21.04 and the test passes there. If you manually
> edit /dev/loop0 and run the ":write" and ":write!" commands, what error
> code do you see? Do you run as a user who has root privileges?
>

II get E503, as when I run the test.
I do not run as root but as regular user.

Sorry I'm brief as my Internet is currently broken (sent from my phone).

Dominique

>


You are receiving this because you commented.

Yegappan Lakshmanan

unread,
May 14, 2021, 11:47:16 AM5/14/21
to vim_dev, reply+ACY5DGE4ZKLUEVE47N...@reply.github.com, vim/vim, vim-dev ML, Comment
Hi,

On Fri, May 14, 2021 at 12:36 AM Dominique Pellé <vim-dev...@256bit.org> wrote:

On Fri, May 14, 2021, 03:35 vim-dev ML ***@***.***> wrote:

> Hi Dominique,
>
> On Thu, May 13, 2021 at 6:01 PM Dominique Pellé ***@***.***>
> wrote:
>
> > Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64
> > machine.
> >
>
> I am running Ubuntu 21.04 and the test passes there. If you manually
> edit /dev/loop0 and run the ":write" and ":write!" commands, what error
> code do you see? Do you run as a user who has root privileges?
>

II get E503, as when I run the test.
I do not run as root but as regular user.

Sorry I'm brief as my Internet is currently broken (sent from my phone).



I tried running the test on a Xubuntu 18.04.5 system and this test
passes without any problems.

If I manually execute the ":write" and ":write!" commands for
/dev/loop0 as root, then E503 error message is displayed instead
of E505.

- Yegappan

vim-dev ML

unread,
May 14, 2021, 11:47:44 AM5/14/21
to vim/vim, vim-dev ML, Your activity

Hi,

On Fri, May 14, 2021 at 12:36 AM Dominique Pellé ***@***.***>

wrote:

> On Fri, May 14, 2021, 03:35 vim-dev ML ***@***.***> wrote:
>
> > Hi Dominique,
> >
> > On Thu, May 13, 2021 at 6:01 PM Dominique Pellé ***@***.***>
> > wrote:
> >
> > > Test_write_errors() fails all the time on my xubuntu-18.04.5 x86_64
> > > machine.
> > >
> >
> > I am running Ubuntu 21.04 and the test passes there. If you manually
> > edit /dev/loop0 and run the ":write" and ":write!" commands, what error
> > code do you see? Do you run as a user who has root privileges?
> >
>
> II get E503, as when I run the test.
> I do not run as root but as regular user.
>
> Sorry I'm brief as my Internet is currently broken (sent from my phone).
>
>
>
I tried running the test on a Xubuntu 18.04.5 system and this test
passes without any problems.

If I manually execute the ":write" and ":write!" commands for
/dev/loop0 as root, then E503 error message is displayed instead
of E505.

- Yegappan

Dominique Pellé

unread,
May 14, 2021, 2:47:56 PM5/14/21
to vim/vim, vim-dev ML, Comment

What is the output of ls -l /dev/loop0 for you?
I posted the output of that command on my system in the bug description.


You are receiving this because you commented.

Yegappan Lakshmanan

unread,
May 14, 2021, 3:18:39 PM5/14/21
to vim_dev, reply+ACY5DGAAV5LM656BCL...@reply.github.com, vim/vim, vim-dev ML, Comment
Hi,

On Fri, May 14, 2021 at 11:47 AM Dominique Pellé <vim-dev...@256bit.org> wrote:

What is the output of ls -l /dev/loop0 for you?
I posted the output of that command on my system in the bug description.


The output of the relevant commands from the Xubuntu system is below:

$ ls -l /dev/loop0
brw-rw---- 1 root disk 7, 0 May 14 12:15 /dev/loop0

$ uname -a
Linux yega-xubuntu 5.4.0-73-generic #82~18.04.1-Ubuntu SMP Fri Apr 16 15:10:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ id
uid=1000(yega) gid=1000(yega) groups=1000(yega),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),126(sambashare)

$ groups
yega adm cdrom sudo dip plugdev lpadmin sambashare

- Yegappan

vim-dev ML

unread,
May 14, 2021, 3:19:06 PM5/14/21
to vim/vim, vim-dev ML, Your activity

Hi,

On Fri, May 14, 2021 at 11:47 AM Dominique Pellé ***@***.***>

wrote:

> What is the output of ls -l /dev/loop0 for you?
> I posted the output of that command on my system in the bug description.
>
>
> The output of the relevant commands from the Xubuntu system is below:

$ ls -l /dev/loop0

brw-rw---- 1 root disk 7, 0 May 14 12:15 /dev/loop0

$ uname -a
Linux yega-xubuntu 5.4.0-73-generic #82~18.04.1-Ubuntu SMP Fri Apr 16
15:10:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ id
uid=1000(yega) gid=1000(yega)
groups=1000(yega),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),126(sambashare)

$ groups
yega adm cdrom sudo dip plugdev lpadmin sambashare

- Yegappan

Bram Moolenaar

unread,
May 15, 2021, 4:56:16 PM5/15/21
to vim/vim, vim-dev ML, Comment

It appears the problem is that somehow /dev/loop0 is not considered read-only.
The check for it being a special device, which you can't write to anyway comes later.
So the ":write /dev/loop0" may or may not say the file is readonly, but
it always fails for ":write! /dev/loop0" because it's a special device.

We should probably check for a special device earlier, so that it's clear adding a "!" won't help.


You are receiving this because you commented.

Bram Moolenaar

unread,
May 15, 2021, 5:21:33 PM5/15/21
to vim/vim, vim-dev ML, Comment

Closed #8205 via 50157ef.


You are receiving this because you commented.

Dominique Pellé

unread,
May 18, 2021, 12:23:01 PM5/18/21
to vim/vim, vim-dev ML, Comment

I did not reply earlier as I had a broken internet (now resolved).
Anyway, this ticket was fixed in the mean time.
For the record and for comparison with what @yegappan posted earlier, this is what I get on my machine where the test used to fail:

$ ls -l /dev/loop0
brw-rw---- 1 root plugdev 7, 0 mei 18 04:59 /dev/loop0

$ uname -a
Linux pel-cirrus7 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ id
uid=1000(pel) gid=1000(pel) groups=1000(pel),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),126(sambashare),132(libvirt)

$ groups
pel adm cdrom sudo dip plugdev lpadmin sambashare libvirt


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages