This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PA HP-UX 11.23 64-bit configuration; HP-UX iconv bug


On Fri, 4 Mar 2005, John David Anglin wrote:

> > First, HP-UX iconv does not work with the linker -z option (fault on NULL 
> > pointer dereferences) which is the default on PA but not on IA64 (this 
> > inconsistency is a separate bug which I expect to address by making it the 
> > default on IA64 as well).
> 
> I'm a bit surprised that HP iconv is this badly broken.  Are you sure
> that the fault isn't caused by a usage issue?

The test is simple (the use of "iso81" is to work on more HP-UX versions 
than just 11.23, some may also need "utf8" in place of "UTF-8" depending 
on the supported character set names and aliases).

#include <stdio.h>
#include <stdlib.h>
#include <iconv.h>
int
main(void)
{
  iconv_t t = iconv_open("UTF-8", "iso81");
  if (t == (iconv_t)-1) return 1;
  iconv(t, 0, 0, 0, 0);
  return 0;
}

The NULL pointer arguments to iconv are valid - they mean that the 
conversion descriptor should be initialized - but HP-UX iconv, maybe not 
tested with ld -z by HP, seems to dereference one of them.  (It is 
considered by HP that this is a bug - that HP-UX system libraries ought to 
work with ld -z rather than relying on being able to dereference NULL.)

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]