Author Topic: Cannot open any file from project, Code Blocks crashes immediately? [solved]  (Read 980 times)

Offline iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
I have a problem, because CodeBlocks crashes when I open any file from saved project. I have Windows 10, and CodeBlocks 13.12. Before this, I tried to use CodeBlocks 17.12, it was the same result, it crashed also. This problem appears on my new computer, where I just installed CodeBlocks.

I disabled Windows Deffender, all parts, it means: Defender Threat Protection Service, Defender Antivirus Network Inspection, Defender Antivirus Service. I also disabled Defender Firewall, but in Windows Services next to its icon it is written status: Running.

I tried to disable plug ins in CodeBlocks, and when I disabled all plugins except Scripting wizard and Compile, it is the same, code blocks crashes.

In my project folder I had file with extensions: .layout and .dependent. At the beginnig I could not open neither project in Code Blocks, it crashed immediately. When I deleted files with extensions .layout and .dependent in my project folder, now I can open the project without crash, but I cannot open any *.c or *.h file without crash.What should I do?
« Last Edit: January 04, 2020, 06:44:11 pm by iviviviviv »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #1 on: January 04, 2020, 01:03:34 pm »
Can you share the project?
Can you show a backtrace?
Sometimes CB generates a crashlog xml file. Do you have such file?
What happens if you rename the codeblocks folder in your appdata folder?
Does it crash if you create a simple hello world project?
(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 iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #2 on: January 04, 2020, 02:06:11 pm »
No, it does not crash when I create and execute simple project "hello world".

I attached project here
https://drive.google.com/file/d/1DlXBXB4D14qzM3oQJOj7sRpnFwCDjuyS/view?usp=sharing

I did not find crash xml file, where should I look at?

Do you mean to rename my installation folder of CodeBlocks or something else, what is in appdata? I tried to rename my project, but it is the same.

And what is backtrace, where to search for it?
« Last Edit: January 04, 2020, 02:11:15 pm by iviviviviv »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #3 on: January 04, 2020, 04:27:37 pm »
No, it does not crash when I create and execute simple project "hello world".
Are you able to make it crash if you use the project in a clean folder where you unpack the files from the archive?

I attached project here
https://drive.google.com/file/d/1DlXBXB4D14qzM3oQJOj7sRpnFwCDjuyS/view?usp=sharing

Doesn't crash for me when using the latest version. (but I'm on linux at the moment)
Have you tried a night build?

I did not find crash xml file, where should I look at?
Probably your temp folder, but there should a dialog showing the info. So if you don't see a dialog most probably the xml generation code haven't triggered.

Do you mean to rename my installation folder of CodeBlocks or something else, what is in appdata? I tried to rename my project, but it is the same.
Nope. I mean the folder where the settings are.
Most of the time this is in your user's folder in some appdata sub-folder.

And what is backtrace, where to search for it?
You need a tool (like a debugger or backtrace generator) and build with symbols. But even without symbols it would be useful to see where it crashes.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2590
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #4 on: January 04, 2020, 05:26:16 pm »
Also no crash here on windows with the latest trunk...

If you have .layout files or .depend file try to delete them

else you can try a nightly build from the forum....

Offline iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #5 on: January 04, 2020, 05:44:36 pm »
These are answers when I installed nightly build and try to open main.c file in project, dialogs with answers are attached (it says "assert IsOpened() failed in Length()", "assert IsOpened() failed in Tell()", "assert IsOpened() failed in Read()").

I also got this when I opened nighlty build CB, befeore every action:

Code: [Select]
Scanning for lexers in C:\Users\ivagu\Downloads\CB_20190112_rev11552_win64\share\codeblocks/lexers/...
Found 60 lexers
Loading lexer_A68k
.....
.....
WindowsXPLookNFeel
Running startup script
Script plugin registered: Find Broken Files plugin
Script/function 'edit_startup_script.script' registered under menu '&Settings/-Edit startup script'
SpellChecker: Thesaurus files 'C:\Users\ivagu\Downloads\CB_20190112_rev11552_win64\share\codeblocks\SpellChecker\th_en_GB.idx' not found!

I could not find any xml in my Temp folder, just some log files from Desktop, and there is a lot tasks connected only to OfficeC2RClient.exe in last two days, in that period I am trying to open these c files.

It run my project without crush. It debug it without crash. But when I want to open main.c it crashes.

This is result of debug:
Code: [Select]
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\
Adding source dir: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\
Adding file: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\bin\Debug\RAFGL.exe
Changing directory to: C:/Users/ivagu/OneDrive/DOCUME~1/RAF/5F926~1.SEM/RACUNA~1/Vezbe/3DGRAF~1/Vezbe7/Vezbe7/RAFGL/RAFGL/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\MATLAB\R2016a\runtime\win64;C:\Program Files\MATLAB\R2016a\bin;C:\Program Files\MATLAB\R2016a\polyspace\bin;C:\Users\ivagu\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\ivagu\AppData\Local\Programs\Python\Python38;C:\Users\ivagu\AppData\Local\Microsoft\WindowsApps;C:\Users\ivagu\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.1\bin
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/ivagu/OneDrive/DOCUME~1/RAF/5F926~1.SEM/RACUNA~1/Vezbe/3DGRAF~1/Vezbe7/Vezbe7/RAFGL/RAFGL/bin/Debug/RAFGL.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6.1
Child process PID: 7004
[Inferior 1 (process 7004) exited with code 030000000472]
Debugger finished with status 0
Selecting target:
Debug
Adding source dir: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\
Adding source dir: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\
Adding file: C:\Users\ivagu\OneDrive\Documents\RAF\5.semestar\Racunarska Grafika\Vezbe\3D Grafika\Vezbe7\Vezbe7\RAFGL\RAFGL\bin\Debug\RAFGL.exe
Changing directory to: C:/Users/ivagu/OneDrive/DOCUME~1/RAF/5F926~1.SEM/RACUNA~1/Vezbe/3DGRAF~1/Vezbe7/Vezbe7/RAFGL/RAFGL/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\MATLAB\R2016a\runtime\win64;C:\Program Files\MATLAB\R2016a\bin;C:\Program Files\MATLAB\R2016a\polyspace\bin;C:\Users\ivagu\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\ivagu\AppData\Local\Programs\Python\Python38;C:\Users\ivagu\AppData\Local\Microsoft\WindowsApps;C:\Users\ivagu\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.1\bin
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/ivagu/OneDrive/DOCUME~1/RAF/5F926~1.SEM/RACUNA~1/Vezbe/3DGRAF~1/Vezbe7/Vezbe7/RAFGL/RAFGL/bin/Debug/RAFGL.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6.1
Child process PID: 4144
[Inferior 1 (process 4144) exited with code 030000000472]
Debugger finished with status 0



Also no crash here on windows with the latest trunk...

I also have no crush when I build project, I have crash when I open main.c or any other file from project.
« Last Edit: January 04, 2020, 05:48:13 pm by iviviviviv »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #6 on: January 04, 2020, 05:56:07 pm »
What about the config folder in appdata? Have you tried to rename it?

BTW: I don't want you to debug your executable. You have to provide the debug log when debugging codeblocks.exe.
(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 iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #7 on: January 04, 2020, 06:07:08 pm »
Yes, I found default.conf in appdata and renamed it, and it is the same - it crashes in 17.12

But when I opened it with nightly build I got attached message "storage policy blocks that type of file"


BTW: I don't want you to debug your executable. You have to provide the debug log when debugging codeblocks.exe.
I dont know how to do that, how to debugg codeblocks.exe?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #8 on: January 04, 2020, 06:09:06 pm »
Can you try to move your project from the OneDrive folder to something that is not managed by sharing software?
(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 iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #9 on: January 04, 2020, 06:17:49 pm »
I stopped OneDrive I got the same error as before,  "storage policy blocks that type of file".

And I moved it to another place which is not in OneDrive, it is the same.
« Last Edit: January 04, 2020, 06:27:17 pm by iviviviviv »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #10 on: January 04, 2020, 06:31:48 pm »
This has nothing to do with codeblocks.

After a simple search this is one of the first links: https://thegeekpage.com/unblock-a-file-blocked-by-windows-10/
Fix this and then we could see if the crash is still there.
(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 iviviviviv

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot open any file from project, Code Blocks crashes immediately?
« Reply #11 on: January 04, 2020, 06:43:29 pm »
It works, when I for every file told it "Unblock", CodeBlocks 17.12 opened it without crash. Thanks a lot!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
@devs: If you're running win10 could you try to reproduce this problem locally? These asserts should probably be fixed/muted. I don't have win10, so I'm not sure I can reproduce this on win7.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9528
@devs: If you're running win10 could you try to reproduce this problem locally? These asserts should probably be fixed/muted. I don't have win10, so I'm not sure I can reproduce this on win7.
Dumb question: How would I create a file that is "blocked"? You cannot block, only unblock a file in the properties. And for me, this only applies to executables (incl. scripts etc.), not C nor H files. Any C-file I download opens just fine as it is not blocked in the first place...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
No idea. It is probably some kind of file attribute or something that web browsers do to mark files as downloaded from the internet or whatever unsafe place they thing they are coming from. :(
(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!]