tags 567961 patch

On Sun, 2010-02-07 at 12:33 +0100, Svante Signell wrote:
> On Sun, 2010-02-07 at 12:01 +0100, Svante Signell wrote:
> ...
> > > Strange, since the 1.4.2-3.4 works and 1.4.2-3.5 don't.
> > 
> > I built the package myself and it crashes too!
> > gcc (Debian 4.4.3-2) 4.4.3
> > g++ (Debian 4.4.3-2) 4.4.3
> > 
> > gdb backtrace when crashing gedit in the attached file.
> > As you can see I'm not the only one having this problem, see bugs:
> > 567961, 568078, 568129
> 
> More info: 
> Setting CXXFLAGS to -g -O make the crashes disappear. Obviously the
> compiler optimizes too much at the default level -O2 (or has a bug).
> Alternately the code should be rewritten to be more robust.
> 
> Can somebody reduce the optimization level and provide an NMU version
> until the underlying reason is found.

I managed to find out where the crash happen with -O2. The problems are
in src/ispell/ispell_checker.cpp. The attached patch to the
ispell_checker.cpp fixes the problem with the string length. I don't
know if the old construct is correct C++ code. In case it is then there
is a bug in g++-4.4.3.

Since I don't know how to make a debian patch can somebody else do this?
I'm also planning to report to upstream.
--- ispell_checker.cpp.orig	2010-02-07 15:35:00.067310730 +0100
+++ ispell_checker.cpp	2010-02-07 15:36:13.239307199 +0100
@@ -438,11 +438,9 @@
 			
 			if (prefstringchar < 0)
 				{
-					std::string teststring;
 					for(int n1 = 1; n1 <= 15; n1++)
 						{
-							teststring = "latin" + n1;
-							prefstringchar = findfiletype(teststring.c_str(), 1,				      
+							char * teststring = g_strdup_printf("latin%u", n1);
 							prefstringchar = findfiletype(teststring, 1,				      
 										      deftflag < 0 ? &deftflag : static_cast<int *>(NULL));
 							if (prefstringchar >= 0) 

Reply via email to