pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg_install & macosx 10.4/ppc failure



Hello,

I don't know if anyone else is experiencing this but pkg_create fails for me with Bus Error
when creating packages on macosx 10.4/ppc always (not intermittently).

I've tracked it down to a strlen() being fed a NULL pointer. The code in question lives on
line 454 of pkgtools/pkg_install/files/lib/plist.c rev 1.17

                if (cmdp->c_argc == 0)
                        len += 1 + strlen(cmdp->c_s) + 1;
                else if (cmdp->c_subst && realprefix)
len += 1 + strlen(cmdp->c_s) + 1 + strlen(realprefix) + 1;
                                                                                   
     ^^^^^^^^^^^^^^ <--- specifically this strlen(realprefix)
                else
len += 1 + strlen(cmdp->c_s) + 1 + strlen(p- >name ? p->name : "") + 1;

Of course the keen eye has caught by now that this should not be reached given the
conditional block it lives in.

A few things to note.
- realprefix is definitely NULL; so says code inspection and so says gdb
  (gdb) print &realprefix
  Address requested for identifier "rprefix" which is in register $r25
  (gdb) info register r25
  r25            0x0      0
- cmdp is also totally bogus I cannot see any reason why this should be (the code seems to dtrt)
  also gdb says cmdv is sensible.
  (gdb) print &cmdp
  Address requested for identifier "cmdp" which is in register $r7
  (gdb) info register r7
  r7             0xffffffff       4294967295
- disabling all optimization makes the problem go away
  any level -O causes things to go wrong (for me)
  removing -O makes it all work.
- introducing printf()'s to print cmdp or realprefix makes the problem go away

[morbo:~/pkg_install_sucks] rtr% gcc -v
Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure -- disable-checking --prefix=/usr --mandir=/share/man --enable- languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*$/s/ $/-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ -- build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 -- target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)

Anyone else having this problem? Should -O just be turned off for this platform when building libinstall?
Does anyone see why it really goes wrong with -O?

Thanks


Home | Main Index | Thread Index | Old Index