|
Bugzilla – Full Text Bug Listing |
| Summary: | convert spits out rubbish to standard output | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.3 | Reporter: | Christopher Yeleighton <giecrilj> |
| Component: | Other | Assignee: | Petr Gajdos <pgajdos> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P3 - Medium | CC: | meissner |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE 11.3 | ||
| URL: | http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18037&p=68978#p68978 | ||
| Whiteboard: | . | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Deadline: | 2011-10-06 | ||
|
Description
Christopher Yeleighton
2011-02-18 10:39:52 UTC
Oops, my bad: malformed text gets printed to standard error. (In reply to comment #1) > Oops, my bad: malformed text gets printed to standard error. So ,it is not a bug ? I close it ,please reopen it if I am wrong . It is just like in the old April Fools‘ joke: — Mom, Mom, come quick! Dad has hanged himself in the attic! — But there is nobody here! — Mom, it is April Fools’! Dad has hanged himself in the basement! Reopening. This is resolved upstream and available in Graphics, so switching to the Graphics repository will fix the bug. However, this bug must remain open until an update is pushed to Updates (IMHO). (In reply to comment #4) > This is resolved upstream and available in Graphics, so switching to the > Graphics repository will fix the bug. However, this bug must remain open until > an update is pushed to Updates (IMHO). Not sure if wrong error message is important enough to do an update. Mr. Maintenance, what's your opinion? The reason of this distortion seems to be a stack corruption in the x64 world. * <URL: http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=18662 > Not nice. However, if you feel like letting it go because printf is not a good attack vector, how about fixing that one? * <URL: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18282&p=70505&hilit=TIFF#p70505 > (In reply to comment #6) > The reason of this distortion seems to be a stack corruption in the x64 world. > > * <URL: http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=18662 > > > Not nice. However, if you feel like letting it go because printf is not a good That's to be decided by openSUSE maintenance team. Nevertheless thanks for information, good to know. > attack vector, how about fixing that one? > * <URL: > http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18282&p=70505&hilit=TIFF#p70505 > > The same as above. That's bug 682238, you can reopen it and ask maintenance team for an update as I did for this bug. Thanks I doubt ThrowWandException is the cause of this, as the error above is a file open error. I suspect another error position. The ThrowWandException macro is of course also buggy, as it seems it calls fprintf(stderr,"%s %s %lu %s",2 arguments) is called instead with 4 arguments in nearly all occurences of #define ThrowWandException(wand) \ This will also result in garbage being printed The bad color conversion is yet another bug, as Petr wrote, do not mix it into this one. Not sure if we want a version update of ImageMagick to fix this, only if you consider it sensible, Petr. +1 if we get an OK from Petr. I am not sure if version update of ImageMagick wouldn't be problematic http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=12841 Petr, backport possible? (In reply to comment #11) > Petr, > > backport possible? I will look into it later. Hmm,
strerror in GetExceptionMessage returns invalid pointer, no idea why so far. There should be "No such file or directory" after "`+1570': ".
MagickExport char *GetExceptionMessage(const int error)
{
char
exception[MaxTextExtent];
#if defined(MAGICKCORE_HAVE_STRERROR_R)
(void) strerror_r(error,exception,sizeof(exception));
#else
(void) CopyMagickString(exception,strerror(error),sizeof(exception));
#endif
return(ConstantString(exception));
}
sterror_r has funny semantics.
man 3 sterror_r
The GNU-specific strerror_r() returns a pointer to a string containing the error message. This may be either a
pointer to a string that the function stores in buf, or a pointer to some (immutable) static string (in which case
buf is unused). If the function stores a string in buf, then at most buflen bytes are stored (the string may be
truncated if buflen is too small) and the string always includes a terminating null byte.
it seems we use thje _GNU_SOURCE version, where the passed in buffer might
be unused.
so it should use the return value of strerror_r() here.
Yep,
use of strerror_r, no use of strerror is culprit here. I could read man-pages more carefully :-). Thanks Marcus!
So following could be upstreamable? As far as I can see this is issue in trunk too (even if they added *exception = '\0' before strerror_r call, so garbage vanished from the error message).
--- magick/exception.c 2011-09-06 15:31:15.000000000 +0200
+++ magick/exception.c 2011-09-06 17:11:20.000000000 +0200
@@ -458,7 +458,11 @@ MagickExport char *GetExceptionMessage(c
exception[MaxTextExtent];
#if defined(MAGICKCORE_HAVE_STRERROR_R)
- (void) strerror_r(error,exception,sizeof(exception));
+ #if !defined(_GNU_SOURCE)
+ (void) strerror_r(error,exception,sizeof(exception));
+ #else
+ (void) CopyMagickString(exception,strerror_r(error, exception, sizeof(exception)),sizeof(exception));
+ #endif
#else
(void) CopyMagickString(exception,strerror(error),sizeof(exception));
#endif
Affected: 11.3, 11.4 and Factory perhaps to the return(ConstantString(....)); in all the ifs where possible. not sure if this saves the CopyMagickString() otherwise fine I think. Filled upstream bug http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=19436 Fixed for factory: sr#81191 Packages are prepared in home:pgajdos:branches:openSUSE:{11.3,11.4}:Update:Test. Should I submit them?
fine for me +1 This is an autogenerated message for OBS integration: This bug (673303) was mentioned in https://build.opensuse.org/request/show/81191 Factory / ImageMagick Done. This is an autogenerated message for OBS integration: This bug (673303) was mentioned in https://build.opensuse.org/request/show/81268 11.4 / ImageMagick https://build.opensuse.org/request/show/81269 11.3 / ImageMagick The SWAMPID for this issue is 43116. This issue was rated as low. Please submit fixed packages until 2011-10-06. Also create a patchinfo file using this link: https://swamp.suse.de/webswamp/wf/43116 Patchinfo created. Christopher, thanks for reporting. Closing as fixed. This is an autogenerated message for OBS integration: This bug (673303) was mentioned in https://build.opensuse.org/request/show/82369 Factory / ImageMagick Update released for: ImageMagick, ImageMagick-debuginfo, ImageMagick-debugsource, ImageMagick-devel, ImageMagick-doc, ImageMagick-extra, ImageMagick-extra-debuginfo, libMagick++-devel, libMagick++3, libMagick++3-debuginfo, libMagick++4, libMagick++4-debuginfo, libMagickCore3, libMagickCore3-debuginfo, libMagickCore4, libMagickCore4-debuginfo, libMagickWand3, libMagickWand3-debuginfo, libMagickWand4, libMagickWand4-debuginfo, perl-PerlMagick, perl-PerlMagick-debuginfo Products: openSUSE 11.3 (debug, i586, x86_64) openSUSE 11.4 (debug, i586, x86_64) |