From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7 Description of problem: On IRIX, environ is a weak symbol. There is no extern declaration for it anywhere in /usr/include, so system.h does: #ifdef __APPLE__ #include <crt_externs.h> #define environ (*_NSGetEnviron()) #else extern char ** environ; #endif /* __APPLE__ */ However, lib/signature.c has: #if !defined(__GLIBC__) && !defined(__APPLE__) char ** environ = NULL; #endif So, the SGI C compiler creates an entry in lib/signature.o for environ. This causes problems in lib/psm.c: /* XXX Don't mtrace into children. */ unsetenv("MALLOC_CHECK_"); unsetenv() isn't available on IRIX so the substitute copy in misc/setenv.c is used instead: void unsetenv (name) const char *name; { const size_t len = strlen (name); char **ep; LOCK; ep = __environ; while (*ep != NULL) ... Unfortunately, at this opint, ep = NULL and *ep gives a SEGV, causing package installation to fail. What's odd is that rpm -Uv works because ep != NULL. When installing via YUM, using the Python RPM module, ep == NULL causing installation to fail. Version-Release number of selected component (if applicable): CVS HEAD How reproducible: Always Steps to Reproduce: 1. yum install [package] Additional info:
Created attachment 123339 [details] Patch
I don't have access to irix, hence am entirely unable to test. Can you supply a patch?
Ah yes, saw the patch right after I hit return. Can you supply a better patch that doesn't just rip out otherwise known working code?
__GLIBC__ is defined on Linux so the code is never executed. What's more, from system.h: #if !defined(__GLIBC__) && !defined(__LCLINT__) #ifdef __APPLE__ #include <crt_externs.h> #define environ (*_NSGetEnviron()) #else extern char ** environ; #endif /* __APPLE__ */ #endif #endif So, on systems where __GLIBC__ is not defined, you get: extern char ** environ; // system.h char ** environ = NULL; // lib/signature.c I doubt you can decide what the compiler will do in this case.
The patch needs to be conditionalized on some non-gcc irix compiler-peculier constants. Private inquiries indicate that an additional ... && (!defined(sgi) || (_COMPILER_VERSION < 0720)) conditioning might do the trick. Can you confirm or suggest a better test?
Well, RPM won't build on IRIX out-of-the box. The patch was to fix a problem we found with RPM 4.2.4 that we forward-ported to HEAD (many more patches are required to get RPM building on non-Linux boxes). #if !defined(__GLIBC__) && !defined(__APPLE__) char ** environ = NULL; #endif The pre-processor define __sgi is available to SGI cc and GCC. So, if you really want this code left in, you can: #if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(__sgi) char ** environ = NULL; #endif I cannot imagine any platform where the code above does any good though. We removed it and have RPM 4.2.4 working fine on Solaris, HP-UX, IRIX, Tru64 UNIX, AIX, and Redhat Linux.
Thanks, that's the confirmation I needed. I have a dim memory of HPUX? AIX? needing the conditionalizing, but have long since forgoytten the details. BTW, send a ptr to your other platform patches to <rpm-devel.duke.edu> and I will try to integrate into rpm main stream. What stops me is lack of access to the platforms, not anything else. Hmmm, I also don't remember ever releasing rpm-4.2.4, but perhaps I've forgotten ... checking ... yes, there is no rpm-4_2_4-relase tag in rpm cvs at cvs.rpm.org.
Oops, I meant 4.2.3. Though, when we made our changes, it was against the rpm-4_2 branch. IRIX was the only platform with the SEGV. However, we disabled the code on all platforms in the previous message. I submitted the IRIX patch to rpm-devel but didn't get any feedback so created this bug report.
rpm-devel still the place for non-RH patches. If you have other patcches, I'll try to get them merged into rpm sources. Fixed in CVS, will be in rpm-4.4.5-0.7 when built.