I'm seeing the same issue on 17.12 on Ubuntu 16.04. I followed the instructions in the post above to produce debug output, see the session below.
I can't actually remember now for sure, but I think I compiled codeblocks from source. To get the error I changed the brace completion to false and exited codeblocks.
$ codeblocks --debug-log -v > codeblock_log.txt 2>&1
$ cat codeblock_log.txt
10:12:59: Debug: Failed to connect to session manager: SESSION_MANAGER environment variable not defined
10:13:00: Debug: WindowPosition[200 150 300 400]
10:13:00: Debug: Adding duplicate image handler for 'XPM file'
10:13:00: Debug: WindowPosition[200 150 300 400]
10:13:00: Debug: CodeSnippetsWindowLoadingFile:/home/rcrozier/.config/codeblocks/codesnippets.xml
10:13:00: Debug: Personality is[]
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_BODY_BGCOLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_TEXT_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:01: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:01: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x2d11420
(codeblocks:10309): Gtk-CRITICAL **: IA__gtk_tree_model_iter_nth_child: assertion 'n >= 0' failed
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxKeyConfigPanel::OnProfileSelected
10:13:08: Debug: wxKeyConfigPanel::OnTreeCommandSelected
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxKeyConfigPanel::UpdateDesc
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_INFOBK'
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_INFOTEXT'
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_HIGHLIGHT'
10:13:12: Debug: wxKeyConfigPanel::ApplyChanges
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [1] targets
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x2d11420
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x3fdd780
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x3ffbe90
10:13:13: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:13: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:17: Debug: SavingWindowPosition[200 150 300 400]
10:13:18: Debug: wxKeyBinder::DetachAll - detaching from all my [3] targets
10:13:18: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:22: Debug: 3 threads were not terminated by the application.
Starting Code::Blocks Release 17.12 rev 11256 Aug 3 2018, 13:55:49 - wx3.0.2 (Linux, unicode) - 64 bit
$ ls -l ~/.config/
total 84
drwxr-xr-x 2 rcrozier rcrozier 4096 Oct 2 10:21 codeblocks
I am user rcrozier. in the actual codeblocks folder
$ ls -l ~/.config/codeblocks/
total 132
-rw-rw-r-- 1 rcrozier rcrozier 128 Oct 2 10:13 BrowseTracker.ini
-rw-rw-r-- 1 rcrozier rcrozier 38435 Oct 2 10:21 cbKeyBinder10.ini
-rw-rw-r-- 1 rcrozier rcrozier 38154 Oct 2 10:13 cbKeyBinder10.ini.bak
-rw-rw-r-- 1 rcrozier rcrozier 239 Oct 2 10:13 codesnippets.ini
-rw-r--r-- 1 root root 40596 Aug 17 12:42 default.conf
-rw-rw-r-- 1 rcrozier rcrozier 231 Oct 2 10:13 DragScroll.ini
-rw-rw-r-- 1 rcrozier rcrozier 0 Oct 2 10:13 en_GB_personaldictionary.dic
so default.conf is owned by root, should this be the case?
Anyway, I changed ownership of default.conf to rcrozer and the problem has gone. My suspicion is that this file is created during installation when using sudo and is therefore owned by root?