Hi,
here's an annoying bug: When compiling a static library with SDCC, the whole IDE crashes.
The report file .rpt shows that it's a NULL read in compiler.dll: http://www.mirari.fr/vAxK
- What is the problem?
CodeBlocks crashes, either in the 8.02 release or in the latest svn nightly (21 june)
- What did you do to when it happened?
Compiled a static lib containing a few C source files
- Can you reproduce it? How?
install codeblocks as usual
install SDCC-win32-2.9.0-setup.exe from sourceforge
create a "static lib project" with the SDCC compiler. The wizard complains about compiler settings, discard.
No need to add new files, the crash is there with the default file.
run "rebuild"
*crash*
- What release of Code::Blocks are you using?
both release 8.02 and 21 june nightly showed the problem
- Which was the latest release that did not have this problem?
no idea :)
Any clue?
I noticed that in the advanced compiler settings, the macro for compiling static libraries was empty.
I tried to fill it, to add what it should be, ie " $lib_linker $static_output $link_objects "
When closing dialogs with OK, then reopening the advanced settings, the macro has gone.
I suspect a bad textbox reading, then the command to execute is not defined and calling it results in null pointer dereference.
But I don't know C::B internals so someone with this knownledge may be faster than me to detect the problem.
Thanks in advance.
Sebastien
SDCC Compiler most likely is not compatible with the Static Lib Template; It crashed on my also.
Will see if I can find cause; but, might not be worth it.
An Line of code in file src\plugins\compilergcc\compilerSDCC.cpp is commented out; it defines ctLinkStaticCmd which is needed in the code that crashes (src/plugins/compilergcc/directcommands.cpp:575). Removing comment and seeing what breaks with the old code.
Tim S
Patch that appears to fix the problem, but should be tested by an more regular SDCC user. It looks like it is working using the sdcclib -m (option -m lists modules in library).
Tim S
Index: src/plugins/compilergcc/compilerSDCC.cpp
===================================================================
--- src/plugins/compilergcc/compilerSDCC.cpp (revision 5679)
+++ src/plugins/compilergcc/compilerSDCC.cpp (working copy)
@@ -138,7 +138,7 @@
m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
m_Commands[(int)ctLinkExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $options $link_options $libs $link_objects")));
m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $options $link_options $libs $link_objects")));
- //m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -r $static_output $link_objects\n\tranlib $exe_output")));
+ m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -r $static_output $link_objects")));
m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // unsupported currently
LoadDefaultRegExArray();
Hi,
I will test today with my project that builds a binary with dependencies on 3 different static libs.
Keeping you up to date.
Hey, HUGE thanks Tim, That's really nice to see so strong support! C::B is definitely the only IDE I need (along with netbeans :) )
Well, I tried to recompile CB from SVN sources, and while the program builds, it does not run. All I get is a splash screen, then a windows crash message, and nothing more, not even a crash report.
I have mingw with gcc 3.4.5, I recompiled wxmsw 2.8.4.
The share/ folder was empty except the plugins subdirectory. This makes CB complains of missing resources, thus the crash comes after this check, if that helps.
I copied the share/subdirectory (except plugins) from my 8.02 release.
Do I have to use a gcc 4 series? not sure.
Do I have to recompile contrib plugins? I think not.
PS: Also tried to replace the 8.02 compiler.dll with the just compiled version (no patch applied yet) but it does not work :(
Any help ? I feel lame :(
I posted the patch in the current nightly thread so it might be added to the next build.
Building Code::Blocks from source is easy for me; but, first time it took a day or two to figure it out.
My compiler setup is not the same as the Code::Blocks build so I have to replace every thing not just the Code::Blocks SDK DLL.
Tim S
I am uploading my compiled Code::Blocks without contrib plugins output folder to
http://www.savefile.com/projects/1039215
"CodeBlocks with SDCC patch"
12 Megabytes 7Zipped file.
Marked file as removed.
Direct link to file is http://www.savefile.com/files/2136539
NOTE: Please copy your default.conf file in case it is damaged or erased by this Code::Blocks.
The default.conf file in folder %APPDATA%\codeblocks
You should be able to download and unzip file to folder and use the CodeBlocks.exe to test patch.
PLEASE: Respond that you got the file and it works; because it is very large and I want to delete it as soon as I can.
Hi, I just got the big file, you can remove it.
It worked out of the box on my first PC.
It also worked fine on my other PC.
I can confirm the libraries are compiled OK and the application HEX file that uses the libraries are identical when compiled using makefiles and codeblocks.
HUGE thanks.
In a bug tracker I would mark this issue as "resolved" :)
And BTW, I got codeblocks svn to compile, then run in safe mode, but the autocompletion plugin crashes.