Woohoo...! I've tracked down at least one of the situations that's been causing this strange crashing problem. I think there might be other situations too - but maybe it's best to deal with one problem at a time. Consider this C::B project (my actual project is much bigger but I can still reproduce the problem, even from this cut-down version).
To see the crash, the following steps are necessary:-
1) Add this project to a workspace (unfortunately, it doesn't crash with every workspace - but it does with the majority of them)
2) Launch a terminal window and type 
gdb codeblocks - followed by 
run3) After C::B starts, open the workspace to which you added the project below
4) Change one or more of the global settings (for example, one of the Compiler & Debugger settings)
5) Exit Code::Blocks. At this point you get a segmentation fault and your new change(s) are lost.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="6" />
   <Project>
      <Option title="Ardour" />
      <Option pch_mode="2" />
      <Option compiler="gcc" />
      <Build>
         <Target title="Debug">
            <Option output="$(#output)/ardour2/ardour-2.0.5" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Debug/" />
            <Option type="0" />
            <Option compiler="gcc" />
            <Option host_application="ardour-2" />
            <Compiler>
               <Add option="-DDEBUG" />
            </Compiler>
            <Linker>
               <Add directory="$(#output)/ardour2/" />
               <Add directory="$(#base)/ardour2/libs/pbd/" />
            </Linker>
         </Target>
         <Target title="Release">
            <Option output="bin/Release/ardour-2.0.5" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Release/" />
            <Option type="1" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-O3" />
            </Compiler>
            <Linker>
               <Add directory="$(#output)/ardour2/" />
               <Add directory="$(#base)/ardour2/libs/pbd/" />
            </Linker>
         </Target>
      </Build>
      <Compiler>
         <Add option="-Wall" />
      </Compiler>
      <Linker>
         <Add library="jack" />
      </Linker>
      <Unit filename="waveview.cc" />
      <Unit filename="waveview.h" />
      <Unit filename="waveview_p.h" />
      <Extensions>
         <code_completion />
         <debugger />
      </Extensions>
   </Project>
</CodeBlocks_project_file>
Pay particular attention to the red lines. If they'd been written like this:-
<Option output="$(#output)/ardour2/ardour-2.0.5" prefix_auto="0" extension_auto="0" /><Option output="bin/Release/ardour-2.0.5" prefix_auto="0" extension_auto="0" />(in other words, auto prefix and extension disabled, instead of enabled) the crash doesn't occur. Similarly, if the output target filename doesn't include fullstops, the crash doesn't occur either. I hope this will go some way towards identifying the problem.