Author Topic: Error saving file  (Read 32258 times)

Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Error saving file
« on: November 01, 2017, 03:40:09 pm »
Hi all,

after applying the latest Windows Creator update (the one with the exploit protection) c::b no longer overwrites an existing file (error saving file). If the file is being deleted the file can be written but the next attempt to overwrite the file is quitted then again with error writing file.

Steps done to narrow down the problem:
- Disabled Exploit protection -> No success
- The file permissions checked (local disk with NTFS) -> Everything is fine
- Created a new project, changed a file and try to save -> no success

Other IDEs tested does not have the issue, e.g. CodeLite

So be careful if you plan to apply the creator update to your productive system. I suspect that this will cause this behaviour

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error saving file
« Reply #1 on: November 01, 2017, 05:14:26 pm »
i can not find anything about this on the net. Have you some resources where i can read about this? (i can not find anyone complaining on stack or other forums)
i do not have windows 10 but i would like to help other people with this...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Error saving file
« Reply #2 on: November 01, 2017, 08:52:47 pm »
What version of codeblocks are you using?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1557
Re: Error saving file
« Reply #3 on: November 01, 2017, 09:24:39 pm »
Microsoft decided some folders (like My documents) should be protected from non secure apps, so you can't update your files without their consent. This is called Controlled Folder Access and supposedly is disable by default. The second link explains how to activate it, but of course it also serves to deactivate it. F**k Microsoft  >:(.

https://www.theregister.co.uk/2017/10/23/fyi_windows_10_ransomware_protection/
https://betanews.com/2017/10/24/windows-10-fall-creators-update-controlled-folder-access/

Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Error saving file
« Reply #4 on: November 02, 2017, 12:12:12 am »
What version of codeblocks are you using?

The stock 16.01. Downloaded again today and reinstalled without success.

Update:
- I played around with the settings in Windows Defender Control Center and explicit deactivated all settings -> No success
- Providing all rights in Exploit Settings for codeblocks.exe -> No success
- Tested directory outside of "My Documents", e.g. D:\Code -> No success

I am at the end of my knowledge here.

Maybe I will try to monitor tomorrow with sysinternals. Until the problem is solved I am coding now on linux only (the windows machine is just for testing)

« Last Edit: November 02, 2017, 12:21:19 am by Blacksheep »

Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Error saving file
« Reply #5 on: November 02, 2017, 12:16:21 am »
Microsoft decided some folders (like My documents) should be protected from non secure apps, so you can't update your files without their consent. This is called Controlled Folder Access and supposedly is disable by default. The second link explains how to activate it, but of course it also serves to deactivate it. F**k Microsoft  >:(.

https://www.theregister.co.uk/2017/10/23/fyi_windows_10_ransomware_protection/
https://betanews.com/2017/10/24/windows-10-fall-creators-update-controlled-folder-access/

Basically this feature is a good one. Any executable not being trusted is not able to manipulate files (e.g. encrypt). I am not sure if this is really the reason for the observed behaviour, it's just my assumption. I will tomorrow setup a VM with Win 10 and test again if the problem really happens after installing the latest windows creator update.

By the way: The windows creator update is being rolled out since some days. If I am right the problem will affect many users running win 10

Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Error saving file
« Reply #6 on: November 02, 2017, 09:37:52 am »
Hm, I tried to reproduce the problem in a VM.

- Installed latest Win10 iso in a VM
- Installed codeblocks

I can save changed files without issues. So the problem appears to be local

Thanks for reading and commenting

Offline 0_0

  • Single posting newcomer
  • *
  • Posts: 7
Re: Error saving file
« Reply #7 on: November 06, 2017, 12:23:25 pm »
Hm, I tried to reproduce the problem in a VM.

- Installed latest Win10 iso in a VM
- Installed codeblocks

I can save changed files without issues. So the problem appears to be local

Thanks for reading and commenting

I think I encountered the same problem as you did. I have checked that microsoft windows 10 is updated already.

How do you use a vm?

Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Error saving file
« Reply #8 on: November 12, 2017, 10:14:36 pm »
I installed Virtualbox (virtualbox.org), created a VM, mounted a Windows10 Iso as a DVD in the VM and so on.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error saving file
« Reply #9 on: November 13, 2017, 09:43:48 am »
isn't the creator update rolled out only in batches? Can you confirm that you have the update installed?
I personally don't think this is the main cause of this problem, because it would make the pc rater useless if i can not modify any files created by other programs....


Offline Blacksheep

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Error saving file
« Reply #10 on: November 13, 2017, 11:09:49 pm »
I can confirm that the Creator Update is implemented because of the options for exploit protection coming with the update exist on my system.

I personally believe that something in Windows has changed that c::b is running into this issue. We will see how many users report this issue in the future. It is definetely not a permission issue. This has been meanwhile checked several times. And if that would be a permission issue c::b would not be able to create a file. But c::b has only issues with overwriting existing files even if they are created just before by c::b itself.


Offline wadhere

  • Single posting newcomer
  • *
  • Posts: 7
Re: Error saving file
« Reply #11 on: November 20, 2017, 07:10:16 pm »
Hi all,

it seems to that I have the same issue. I install c::b first time on two different Windows 10 (64bit) machines with the creator update.
My current WinVersion is Win10 Pro, Version 1709 , Build 16299.64 .
c::b version: 16.01

Steps:
- new installation of C::B , including MinGW
- Create a new Project
- Console Application
- Chossed "C"
- Choosed GNU GCC Compiler
- Build the "Hello World"  without problems
- Let it run ... without problems
- change the main.c , change "Hello"  to"Hellllo"; the star in the file tab "main.c" is visible
- Save file produce the error "...main.c could not be saved ..."  :(
- Edit outside of c::b works , than c::b reload the file and it can build again
- changes and save with c::b editor are not working

I tried this with two PC's, different folders ......




 
« Last Edit: November 20, 2017, 07:11:59 pm by wadhere »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Error saving file
« Reply #12 on: November 20, 2017, 09:07:37 pm »
What happens if you use the rc1 for the upcoming release from here: https://sourceforge.net/projects/codeblocks/files/Binaries/17.xx-RC1/Windows/ ?
Does it work?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wadhere

  • Single posting newcomer
  • *
  • Posts: 7
Re: Error saving file
« Reply #13 on: November 20, 2017, 09:39:56 pm »
Thanks for the quick answer.
I tried the "codeblocks-17.xx-setup-RC1.exe" , but it does not work. Same issue as before. Impossible to save any change.

I'll try try this on a Win7-machine next days.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Error saving file
« Reply #14 on: November 20, 2017, 10:05:27 pm »
What are the security settings on the machine?
What happens if you trace the cb executable with procmon/filemon or some other tool which is used for tracing system calls?

(note: I'm mostly linux developers, so I don't know how to debug such issues on windows)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]