Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
38 user(s) are online (36 user(s) are browsing Forums)

Members: 0
Guests: 38

more...

Support us!

Headlines

 
  Register To Post  

« 1 2 3 (4) 5 6 7 »
Re: VIM the editor
Home away from home
Home away from home


See User information
@All
As i say before grabbing the 7.1 version of VIM from os4depot , and there swap files deletes fine.

Then i grab 7.1 vesion of vim sources from https://ftp.nluug.nl/pub/vim/amiga/
and build them myself, and bah : deleting of swap files not works !

So or author of 7.1 port for aos4 do fix something in that terms, or, newer SDK/Compiler/whatever made a differences.

The files which is used for, just 2:

https://github.com/vim/vim/blob/master/src/fileio.c

and

https://github.com/vim/vim/blob/master/src/memfile.c

But what is puzzling me, is why 7.1 version from os4depot have it working, but my build from official sources are not..

As i say protection bits clears exactly on closing/exit , while you works with it, protection bits are fine.

Any help welcome as usual :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
I run 'snoopy' over 7.1 from os4depot which delete .swp files on exit, and 7.1 builded from original sources which not delete .swp files on exit.

There is results when i already open "bugreport.txt", and start to catch logs when press ":q!".

7.1. from os4depot with working delete:

Log Generated bySnoopy 53.44 (22.9.2018)

00001 vim_7           o.k. = Open("VIM:viminfo",OLD) = [0x194AEBC2] [79uS]
00002 vim_7           FAIL IsInteractive("VIM:viminfo")
00003 vim_7           o.k. = IsFileSystem("VIM:") [17uS]
00004 vim_7           FAIL Lock("VIM:viminfo.tmp",SHARED) [31uS]
00005 vim_7           FAIL Lock("VIM:viminfo.tmp",SHARED) [30uS]
00006 vim_7           o.k. = Open("VIM:viminfo.tmp",RW ) = [0x194AEC2E] [119uS]
00007 vim_7           FAIL IsInteractive("VIM:viminfo.tmp")
00008 : 
vim_7           o.k. = IsFileSystem("VIM:") [18uS]
00009 : 
vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [93uS]
00010 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [70uS]
00011 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [68uS]
00012 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [67uS]
00013 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [69uS]
00014 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [68uS]
00015 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [68uS]
00016 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [70uS]
00017 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [68uS]
00018 : 
vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [69uS]
00019 : 
vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [69uS]
00020 vim_7           FAIL GetVar("HOME",0x62C3B4A0,1024,0x00000000) [70uS]
00021 vim_7           DIR  ParentOfFH(0x194AEC2E"VIM:viminfo.tmp" [4uS]
00022 vim_7           o.k. = ExamineFH("viminfo.tmp") [9232uS]
00023 vim_7           :        SetCurrentDir("Utilities")
00024 vim_7           o.k. = SetProtection("viminfo.tmp",0x00000002) [11836uS]
00025 vim_7           :        SetCurrentDir("<untracked>")
00026 vim_7           DIR  ParentOfFH(0x194AEBC2"VIM:viminfo" [4uS]
00027 vim_7           o.k. = ExamineFH("viminfo") [15095uS]
00028 : 
vim_7           o.k. = Lock("VIM:viminfo.tmp",SHARED) [3454uS]
00029 : 
vim_7           o.k. = Examine("viminfo.tmp") [3696uS]
00030 vim_7           o.k. = Lock("VIM:viminfo.tmp",SHARED) [35uS]
00031 vim_7           o.k. = Delete("VIM:viminfo") [11007uS]
00032 vim_7           o.k. = Rename("VIM:viminfo.tmp" -> "VIM:viminfo") [1444uS]
00033 vim_7           o.k. = SetMode("<untracked>",[LINE]) [578uS]
00034 vim_7           DIR  ParentOfFH(0x194AEBF8"<untracked>" [10uS]
00035 vim_7           o.k. = ExamineFH(".bugreport.txt.swp") [3713uS]
00036 vim_7           :        SetCurrentDir("<untracked>")
00037 vim_7           o.k. = SetProtection(".bugreport.txt.swp",0x00000002) [12629uS]
00038 : 
vim_7           :        SetCurrentDir("<untracked>")
00039 : 
vim_7           o.k. = Delete("Work:vim/.bugreport.txt.swp") [165uS]
00040 vim_7           : <----- RunCommand(0x196FAA55 "vim_7",,"bugreport.txt ",15) = [0x00000000] [8356709uS]
00041 Shell Process   o.k. = SetMode("<untracked>",[LINE]) [4354uS]
00042 Shell Process   FAIL GetVar("_Title",0x648A840C,256,0x00000200) [6uS]
00043 Shell Process   FAIL GetVar("Echo",0x62DA0D38,32,0x00000200) [4uS]
00044 Shell Process   FAIL GetVar("OldRedirect",0x62DA0D38,32,0x00000200) [2uS]
00045 Shell Process   FAIL GetVar("KeepDoubleQuotes",0x62DA0D38,32,0x00000200) [2uS]
00046 Shell Process   FAIL GetVar("Interactive",0x62DA0D38,32,0x00000200) [2uS]


And 7.1 builded from original sources by me and where deleting not works:

Log Generated bySnoopy 53.44 (22.9.2018)

00001 Vim71           o.k. = Open("VIM:viminfo",OLD) = [0x194AED12] [79uS]
00002 Vim71           o.k. = ExamineObject(0x619A2048 [viminfo]) [15uS]
00003 Vim71           FAIL IsInteractive("VIM:viminfo")
00004 Vim71           o.k. = IsFileSystem("VIM:") [18uS]
00005 Vim71           FAIL Lock("VIM:viminfo.tmp",SHARED) [33uS]
00006 Vim71           FAIL Lock("VIM:viminfo.tmp",SHARED) [30uS]
00007 Vim71           o.k. = Open("VIM:viminfo.tmp",RW ) = [0x194AEDF6] [20580uS]
00008 : 
Vim71           o.k. = ExamineObject(0x619A2048 [viminfo.tmp]) [13uS]
00009 : 
Vim71           FAIL IsInteractive("VIM:viminfo.tmp")
00010 Vim71           o.k. = IsFileSystem("VIM:") [23uS]
00011 Vim71           o.k. = ExamineObject(0x619A2198 [viminfo]) [14uS]
00012 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [94uS]
00013 Vim71           o.k. = ExamineObject(0x619A1CE8 [viminfo.tmp]) [13uS]
00014 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [71uS]
00015 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [68uS]
00016 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [1272uS]
00017 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [1628uS]
00018 : 
Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [2045uS]
00019 : 
Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [296uS]
00020 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [69uS]
00021 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [68uS]
00022 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [70uS]
00023 Vim71           FAIL GetVar("HOME",0x60F33040,1024,0x00000000) [68uS]
00024 Vim71           FAIL GetVar("HOME",0x60F33248,1024,0x00000000) [69uS]
00025 Vim71           DIR  ParentOfFH(0x194AEDF6"VIM:viminfo.tmp" [6uS]
00026 Vim71           o.k. = ExamineObject(0x619A2408 [viminfo.tmp]) [12uS]
00027 Vim71           :        SetCurrentDir("<untracked>")
00028 : 
Vim71           o.k. = SetProtection("viminfo.tmp",0x00000002) [9656uS]
00029 : 
Vim71           :        SetCurrentDir("<untracked>")
00030 Vim71           DIR  ParentOfFH(0x194AED12"VIM:viminfo" [5uS]
00031 Vim71           o.k. = ExamineObject(0x619A2408 [viminfo]) [12uS]
00032 Vim71           o.k. = Lock("VIM:viminfo.tmp",SHARED) [36uS]
00033 Vim71           o.k. = ExamineObject(0x619A1F98 [viminfo.tmp]) [11uS]
00034 Vim71           o.k. = Lock("VIM:viminfo.tmp",SHARED) [33uS]
00035 Vim71           o.k. = Delete("VIM:viminfo") [4092uS]
00036 Vim71           o.k. = Rename("VIM:viminfo.tmp" -> "VIM:viminfo") [1810uS]
00037 Vim71           o.k. = SetMode("<untracked>",[LINE]) [314uS]
00038 : 
Vim71           DIR  ParentOfFH(0x194AED48"<untracked>" [9uS]
00039 : 
Vim71           o.k. = ExamineObject(0x619A2468 [.bugreport.txt.swp]) [13uS]
00040 Vim71           :        SetCurrentDir("<untracked>")
00041 Vim71           o.k. = SetProtection(".bugreport.txt.swp",0x0000000F) [2116uS]
00042 Vim71           :        SetCurrentDir("<untracked>")
00043 Vim71           FAIL Delete("Work:vim/.bugreport.txt.swp") [46uS]
00044 Vim71           :        SetCurrentDir("<untracked>")
00045 Vim71           : <----- RunCommand(0x19E2A5D1 "Vim71",,"bugreport.txt ",15) = [0x00000000] [4820994uS]
00046 Shell Process   o.k. = SetMode("<untracked>",[LINE]) [16521uS]
00047 Shell Process   FAIL GetVar("_Title",0x648A840C,256,0x00000200) [5uS]
00048 : 
Shell Process   FAIL GetVar("Echo",0x62DA0D38,32,0x00000200) [4uS]
00049 : 
Shell Process   FAIL GetVar("OldRedirect",0x62DA0D38,32,0x00000200) [3uS]
00050 Shell Process   FAIL GetVar("KeepDoubleQuotes",0x62DA0D38,32,0x00000200) [2uS]
00051 Shell Process   FAIL GetVar("Interactive",0x62DA0D38,32,0x00000200) [2uS]


As i can see, at the end, when called SetProtection, for non working version if called with 0x0000000F , and after that delete fail.

And for working version, SetProtection is called with 0x00000002, and then Delete didn't fail.

Also for working version i see there ExamineFH() before SetProtection is called, while in non-working vesion, there is ExamineObject(). So maybe those functions reacts different somehow which cause different SetProtection bits ?

Maybe it's os_amiga.c in end:

https://github.com/vim/vim/blob/master/src/os_amiga.c

I see there some amigaos4 ifdefs, which maybe coming after 7.1 public release on os4depot.

One of ifdefs is AllocDosObject() instead of FileInfoBlock stuff, so maybe that one differes a bit ..

And it seems that SetProtection didn't called from vim's code per-se there. Its some other function indirectly call it (dunno what one through).


Edited by kas1e on 2019/5/6 16:07:05
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

Good findings!

SetProtection is called indirectly (via mch_setperm) in several places in Vim.

The values $2 and $f are interesting. $2 is HSPARWD and $f is HSPA.

8 7 6 5 4 3 2 1 <- Bit number
h s p a r w e d <- corresponding protection flag

0 = flag set
1 = flag clear

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@sTix
Quote:

SetProtection is called indirectly (via mch_setperm) in several places in Vim.


Yeah, i checked all the places where mch_setperm called : its is fileio.c only.

So i purely commented them out for tests: no changes. SetProtection still called which mean its inderectly called not from Vim, but from other DOS functions (seems so). Maybe when Examine called (and wchich replaced automatically on ExamineObject on compiling stage or so), dunno. But as far as i can tell, commenting out all calls to mch_setperm didn't stop SetProtect being called when i exit from vim.

The only explains i have that 7.1 version from os4depot works there, are :

1. it was build over clib2 (i checked, its indeed clib2, not newlib version)
2. it was compiled with much older DOS sdk.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just can't stay away
Just can't stay away


See User information
@sTix

Quote:

The values $2 and $f are interesting. $2 is HSPARWD and $f is HSPA.

8 7 6 5 4 3 2 1 <- Bit number
h s p a r w e d <- corresponding protection flag

0 = flag set
1 = flag clear


Only the owner rwed flags are reversed (0 = enabled, 1 = disabled), the hspa and group and other rwed flags are set the normal way (0 = disabled, 1 = enabled).

Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@salass00

Ah, then $f is really null, nix, nada.

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@All

Ok ! Some good and intersting news related to that strange issue.

I build vim with clib2 (as done for 7.1 version on os4depot), and that bug disappear !

I.e. everything deletes on exit fine, and final SetProtection also 0x00000002 and not 0x0000000f as in case when build with Newlib.

Any ideas ?:)

It is probabaly os_amiga.c still, just as it works with clib2 as expected, and set some strange 0 to protection only with newlib (and what DOS function do it?), it is probabaly newlib/dos doing something nasty there ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

It's also called from f_setperm(..) in evalfunc.c.

Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

Very nice!

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@sTix
Quote:

It's also called from f_setperm(..) in evalfunc.c.


I even test it all with 7.1 sources (not mui gui, etc), there is no f_setfperm was at this time. So it definately called from some other dos function when need it.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

Ah, my bad. I was grep:in through 8.1.x sources.

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@sTix
And builded latest 8.1 version with mui-gui over clib2 : backup files also deletes fine.

So something definatelly differs between how newlib and clib2 handle DOS functions probabaly..

If we don't want to spend time to understand what wrong when we build it with newlib, easy way can be just build it over clib2.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

Yes, clib2 is a good idea.

Who's maintaining newlib?

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@sTix
Quote:

Who's maintaining newlib?


Some Belgian company full of laywers, update to os from which is probabaly unpossible to get anymore, taking aside any new SDK on which no one work :) clib2 from other side is free, opensourced , and hosted on adtools page together with latest binutils and gcc ports.

It can be that it also not newlib itself guilty, but code done in "wrong" for newlib way or something ..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Just popping in
Just popping in


See User information
@kas1e

Quote:
Some Belgian company full of laywers, update to os from which is probabaly unpossible to get anymore, taking aside any new SDK on which no one work :) clib2 from other side is free, opensourced , and hosted on adtools page together with latest binutils and gcc ports.


Sounds like clib2 is the way to go ;)

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@kas1e
The empty filepermissions bug occurs because of a bug with dup2().

If the original file descriptor is closed before the duplicated one then the back reference got lost somehow (I forget the fine details) and the file permission got cleared.

This was reported by me in BZ 9294 (found whilst porting perl) and is fixed in newlib 53.34

Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@broadblues
Its something else, because vim doesn't call dup2() anywhere (there is in code only one place, but its not used for amigaos builds, i tested it twice to be sure).

It has some plain dup() calls, but they all ifdefed via #HAVE_DUP, which is not enabled for amiga builds, so dup() also in no use.

Also i do all my tests on newlib.library 53.50 , so bug definately not in dup2() and happens even on latest beta builds.

I retest also your test-case code from BZ 9294, and it indeed works with 53.50, so it mean that its another scenario of the same bug.

What functions of dos (or of newlib?) call SetProtection as well inderectly ? I mean, it can be bug just in Examine() in newlib, if it call SetProtection by itself. Or, it can be bug with SetCurrentDir or something which is called before that SetProtection bug happens based with above snoopy logs.


Edited by kas1e on 2019/5/7 15:13:42
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Home away from home
Home away from home


See User information
@pvanni, walkero & all

Uploaded new version of vim_mui to os4depot: which rebuilded now with clib2 instead of newlib, as newlib still have a bug with file permission got cleared, which in end lead to non-deleted swap files in VIM. clib2 will be used until fixed version of newlib will be publicaly available, or we will add workoround to VIM's code.

In other words, swap file deletion on exit/close will works now.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: VIM the editor
Not too shy to talk
Not too shy to talk


See User information
@kas1e,
great work, many thanks to you and to sTix

Go to top
Re: VIM the editor
Not too shy to talk
Not too shy to talk


See User information
@kas1e,
wow, now all work very well, swap files and even persistent undo

Go to top

  Register To Post
« 1 2 3 (4) 5 6 7 »

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project