Compile error on Solaris 8 - toolkit/crashreporter/nsExceptionHandler.cpp uses unsetenv which is not available

RESOLVED WONTFIX

Status

()

Toolkit
Crash Reporting
RESOLVED WONTFIX
10 years ago
4 years ago

People

(Reporter: Steve Evans, Assigned: timeless)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.12) Gecko/20080211 Firefox/2.0.0.12
Build Identifier: ftp://ftp.mozilla.org/pub/firefox/releases/3.0b4/source/firefox-3.0b5-source.tar.bz2

I get this compile error:

c++ -o nsExceptionHandler.o -c  -DXP_SOLARIS -DUNICODE -D_UNICODE -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DZLIB_INTERNAL -DOSTYPE=\"SunOS5\" -DOSARCH=SunOS -I/icad/12/mozilla/build/mozilla/toolkit/crashreporter/google-breakpad/src -I/icad/12/mozilla/build/mozilla/toolkit/crashreporter -I. -I../../dist/include/xpcom -I../../dist/include/string -I../../dist/include   -I../../dist/include/crashreporter -I../../dist/include/nspr     -I../../dist/sdk/include -I/usr/openwin/include   -fPIC  -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -O2 -Wno-unknown-pragmas -mcpu=ultrasparc -I/gorbag/exta/cad/externals/SOLARIS/include  -I/usr/openwin/include -fno-rtti -fno-exceptions -Wno-long-long -pedantic -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -O2 -fomit-frame-pointer -fno-exceptions -Wno-unknown-pragmas -mcpu=ultrasparc -I/gorbag/exta/cad/externals/SOLARIS/include -fno-strict-aliasing -fshort-wchar -pthreads  -DNDEBUG -DTRIMMED -O  -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -O2 -Wno-unknown-pragmas -mcpu=ultrasparc -I/gorbag/exta/cad/externals/SOLARIS/include  -I/usr/openwin/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsExceptionHandler.pp /icad/12/mozilla/build/mozilla/toolkit/crashreporter/nsExceptionHandler.cpp
distcc[24737] (dcc_writex) ERROR: failed to write: Transport endpoint is not connected
distcc[24737] (dcc_writex) ERROR: failed to write: Transport endpoint is not connected
distcc[24737] Warning: failed to distribute /icad/12/mozilla/build/mozilla/toolkit/crashreporter/nsExceptionHandler.cpp to rooster/3, running locally instead
/icad/12/mozilla/build/mozilla/toolkit/crashreporter/nsExceptionHandler.cpp: In function `bool CrashReporter::MinidumpCallback(const CrashReporter::XP_CHAR*, const CrashReporter::XP_CHAR*, void*, bool)':
/icad/12/mozilla/build/mozilla/toolkit/crashreporter/nsExceptionHandler.cpp:304: error: `unsetenv' was not declared in this scope
distcc[24737] ERROR: compile /icad/12/mozilla/build/mozilla/toolkit/crashreporter/nsExceptionHandler.cpp on localhost failed


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

Comment 1

10 years ago
Created attachment 314062 [details] [diff] [review]
Patch to fix the problem using PR_SetEnv
Comment on attachment 314062 [details] [diff] [review]
Patch to fix the problem using PR_SetEnv

First, just as a rule of thumb we prefer unified diffs.

Second, you're not allowed to allocate memory in the exception handler. The program is in an unsafe state at that point, and you can't reliably do so.
Attachment #314062 - Flags: review-

Comment 3

10 years ago
The Firefox trunk code can't be built with Sun Studio on Solaris 8/9/10 since the landing of the patch for bug 177805. It only supports the TOOLKIT cairo-gtk2 now.

Comment 4

10 years ago
Steve, if you want to try the breakpad feature for Firefox 3.0 on Solaris 8 with gcc(?), the dump_syms tool need to be reworked. The stab format is different between the binary generated by Sun Studio and GCC I think. Otherwise, please add "--disable-crashreporter".
(Reporter)

Comment 5

10 years ago
OK, thanks.

I am currently working through other compile errors in crashreporter/google-breakpad and reporting them on http://code.google.com/p/google-breakpad/issues/list. Once that is complete I will build with --disable-crashreporter
(Assignee)

Comment 6

10 years ago
Created attachment 315356 [details] [diff] [review]
getenv returns a char* on solaris, changing its memory changes the env
Assignee: nobody → timeless
Attachment #314062 - Attachment is obsolete: true
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #315356 - Flags: review?(stevee)
(Reporter)

Comment 7

10 years ago
The patch fixes the compile problem, thanks.

However other platforms don't have setenv/unsetenv, e.g., hpux. Perhaps there should be a configure test for the availability of them and then guard the code based on the configure results?
The crashreporter code is highly platform-specific, so I don't think that makes a lot of sense. Indeed, as Alfred has pointed out, it's not going to work on Solaris 8 even if you get this to work. My suggestion would be to detect Solaris 8 in configure and just disable crash reporting in that case.
(Reporter)

Comment 9

6 years ago
Solaris 8 is no longer supported by FireFox - unfortunately as I stil have to use use it :-(
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 10

5 years ago
Comment on attachment 315356 [details] [diff] [review]
getenv returns a char* on solaris, changing its memory changes the env

This now redundant
(Reporter)

Updated

4 years ago
Attachment #315356 - Flags: review?(stevee) → review-
You need to log in before you can comment on or make changes to this bug.