Bug 688225 - Ghostscript errors by valgrind
Summary: Ghostscript errors by valgrind
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 0.00
Hardware: PC Windows XP
: P3 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-20 23:52 UTC by Igor Melichev
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
valgrind log (6.38 KB, text/plain)
2005-07-20 23:53 UTC, Igor Melichev
Details
partial fix - more changes of this kind are needed (2.33 KB, patch)
2005-07-24 04:50 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.