Bug 688225

Summary: Ghostscript errors by valgrind
Product: Ghostscript Reporter: Igor Melichev <igor.melichev>
Component: GeneralAssignee: Alex Cherepanov <alex>
Status: NOTIFIED FIXED    
Severity: normal CC: alex
Priority: P3    
Version: 0.00   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---
Attachments: valgrind log
partial fix - more changes of this kind are needed

Description Igor Melichev 2005-07-20 23:52:21 UTC
A message from Alex :


This is a Valgrind log for the test cass on my GNU+Linux box.
I hope it helps. It looks like there are several errors in the GC code.
The errors about memory and string functions are mostly harmless.
The error about the "Use of uninitialised value of size 4"
will be addressed separately. I think we need to test GS under valgrind
during regression testing, at least occasionaly.
Comment 1 Igor Melichev 2005-07-20 23:53:28 UTC
Created attachment 1554 [details]
valgrind log
Comment 2 Igor Melichev 2005-07-21 00:06:28 UTC
Use of uninitialised value of size 4
Regarding at 0x8244C55: gx_image_enum_begin (./src/gxipixel.c:554) :

The loop condition in the line 553 must use '<' rather than '<='.

I don't think that it's harmful. Only consequence is a non-optimal 
representation of an image. 

Will fix late, because now I concentrate on another problem.
Comment 3 Igor Melichev 2005-07-21 00:08:32 UTC
Regarding " Source and destination overlap in memcpy" :

Must replace all those calls with memmove. IMO the current code isn't well 
portable.
Comment 4 Alex Cherepanov 2005-07-21 03:38:43 UTC
All cases of "Source and destination overlap in memcpy" except the bug 688224
are caused by copying a block of memory into itself.

I think this should be addressed on the higher level than the memmove() fix.
Although we need to fix this, the main benefit is the noise reduction
in the Valgrind log.
Comment 5 Alex Cherepanov 2005-07-24 04:50:39 UTC
Created attachment 1563 [details]
partial fix - more changes of this kind are needed

Pacify Valgrind: don't copy memory on itself and split a logical expression,
which is evaluated out of order by GCC 2.96 .
Comment 6 Alex Cherepanov 2007-05-10 10:43:03 UTC
All errors reported here in bulk are either fixed or
filed separately - one issue per bug report.