Closed Bug 102118 Opened 24 years ago Closed 24 years ago

solaris 2.7, gcc 3.0.1 cannot convert `int*' to `socklen_t*' calling getsockname

Categories

(SeaMonkey :: Installer, defect)

Sun
Solaris
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: internationils, Assigned: netscape)

References

Details

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:0.9.3) Gecko/20010821 BuildID: 0.9.4 make[2]: Entering directory `/sup/build/mozilla/mybuild/xpinstall/wizard/libxpnet' make[3]: Entering directory `/sup/build/mozilla/mybuild/xpinstall/wizard/libxpnet/src' nsSocket.cpp c++ -o nsSocket.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DOJI -I../../../../dist/include -I../../../../dist/include -I/sup/build/mozilla/mybuild/dist/include/nspr -I/usr/openwin/include -fPIC -I/usr/openwin/include -fno-rtti -fno-exceptions -pedantic -Wno-long-long -pipe -fshort-wchar -pthreads -O -DNDEBUG -DTRIMMED -I/usr/openwin/include -DMOZILLA_CLIENT -include ../../../../config-defs.h -Wp,-MD,.deps/nsSocket.pp ../../../../../xpinstall/wizard/libxpnet/src/nsSocket.cpp ../../../../../xpinstall/wizard/libxpnet/src/nsSocket.cpp: In member function `int nsSocket::SrvAccept()': ../../../../../xpinstall/wizard/libxpnet/src/nsSocket.cpp:247: cannot convert `int*' to `socklen_t*' for argument `3' to `int accept(int, sockaddr*, socklen_t*)' ../../../../../xpinstall/wizard/libxpnet/src/nsSocket.cpp: In member function `int nsSocket::GetHostPortString(char**)': ../../../../../xpinstall/wizard/libxpnet/src/nsSocket.cpp:456: cannot convert `int*' to `socklen_t*' for argument `3' to `int getsockname(int, sockaddr*, socklen_t*)' make[3]: *** [nsSocket.o] Error 1 make[3]: Leaving directory `/sup/build/mozilla/mybuild/xpinstall/wizard/libxpnet/src' make[2]: *** [install] Error 2 make[2]: Leaving directory `/sup/build/mozilla/mybuild/xpinstall/wizard/libxpnet' make[1]: *** [install] Error 2 make[1]: Leaving directory `/sup/build/mozilla/mybuild/xpinstall' make: *** [install] Error 2 4575.30u 410.88s 2:02:23.56 67.8% /sup/build/mozilla/mybuild > ... #mozilla irc.mozilla.org <Pike> WHAT? <Pike> #if defined(SOLARIS) || defined(_WINDOWS) <Pike> #define socklen_t int <Pike> #endif <Pike> that must be OLD cruft solaris <Pike> 'cause on 2.7, the function prototype is ok <Pike> int accept(int s, struct sockaddr *addr, socklen_t <Pike> *addrlen); <Pike> I don't seem to have SOLARIS defined here <Pike> CQ: I do see why this errors <Pike> I just wonder why it's ok for me <Pike> now I know <Pike> hey <Pike> how do I get gcc to tell it's standard defines once again? <Pike> CQ: you should file a bug, IMHO <Pike> CQ: CC axel@pike.org and cls@seawood.org <jag> CQ: maybe cc jdunn@netscape.com too <Pike> solaris headers are evil <CQ> pike- will do. How do I continue my build though? Just nuke those three lines? <Pike> typedef uint32_t socklen_t; <Pike> typedef void *Psocklen_t; <Pike> isn't this a crying game? <Pike> CQ: I honestly don't know. But if you can do something to make it compile for you, it should be ok <CQ> pike- OK if I include your IRC comments in teh bug report? <Pike> sure <Pike> though I do know now why I have SOLARIS defined <CQ> Pike- why? <CQ> ..and which componendt should I file this against? <Pike> CQ: it's in platform.h <Pike> CQ: and I have no clue on what component. It's xpinstall, but it's probably a netwerk issue, and should be resolved by some build config foo <Pike> CQ: file it on xpinstall for now Reproducible: Always Steps to Reproduce: 1. ./configure --disable-tests --disable-debug --enable-optimize --enable-crypto --disable-xprint --with-gnu-ld --with-gnu-nm --with-gnu-as --with-as=/sup/bin/as --with-ld=/sup/bin/ld --with-nm=/sup/bin/nm --prefix=/sup 2. make /sup/build/mozilla/mybuild > uname -a SunOS lou 5.7 Generic_106541-15 sun4u sparc SUNW,Ultra-5_10 /sup/build/mozilla/mybuild > gcc --version 3.0.1
fwiw _WINDOWS shouldn't survive whatever changes are made.
This isn't the XPInstall engine, it's the wizard socket library. I see a lot of folks CC'd -- anyone want to confirm the bug?
Component: Installer: XPInstall Engine → Installer
QA Contact: jimmylee → bugzilla
QA Contact: bugzilla → ktrina
*** Bug 104203 has been marked as a duplicate of this bug. ***
Status: UNCONFIRMED → NEW
Ever confirmed: true
From <sys/socket.h> on solaris 8 #ifndef _SOCKLEN_T #define _SOCKLEN_T #if defined(_XPG4_2) && !defined(_XPG5) && !defined(_LP64) typedef size_t socklen_t; #else typedef uint32_t socklen_t; #endif /* defined(_XPG4_2) && !defined(_XPG5) && !defined(_LP64) */ #if defined(_XPG4_2) typedef socklen_t *Psocklen_t; #else typedef void *Psocklen_t; #endif /* defined(_XPG4_2) */ #endif /* _SOCKLEN_T */ so which one to choose ? size_t* or uint_32_t* to cast in function call ? int accept(int, sockaddr*, socklen_t*) int getsockname(int, sockaddr*, socklen_t*) of nsSocket.cpp: In member function `int nsSocket::SrvAccept()'
I was getting this one back with gcc 3.0 (i.e. 3.0.1) [oh, yeah. Solaris 2.8 07/01]. Thinking it might be a bug in GCC (since it works for both Forte Developer 6.2 and for gcc 2.95.3), I filed it with GCC. They got back to me and told me it's a Mozilla bug. So that's where I was until today. Both size_t and uint_32_t seem to work. I haven't the foggiest what the _XPG4_2 and _XPG5 symbols are supposed to represent. Ah. There they are. http://ftp.planetmirror.com/pub/qt/mkspecs says they're Open Group 4v2 and 5 specs. Hrm. Is there any reason we're defining socklen_t to be an int? It compiles just fine without this, and I'd think the OS would know best what it understands as a socklen_t.
Erm, that should be uint32_t, not uint_32_t. Ewps.
Uros suggested that bug 103499 may be a dupe of this. If not is it at least tackling similar problems and might be of interest to people here.
*** Bug 103499 has been marked as a duplicate of this bug. ***
with 0.9.5 on Solaris 8, with (size_t*) as cast of the 5th element ll 163,168 of nsSocket.cpp, it compiles with gcc301 binutils2.11.2 glib 1.2.10 gtk1.2 and the required patches but *** Chrome Registration of package: Checking for contents.rdf at jar:resource:/chrome/comm.jar!/content/necko/ ###!!! ASSERTION: Cannot tell if this is a directory: 'NS_SUCCEEDED(rv)', file nsLocalFileUnix.cpp, line 1436 ###!!! Break: at file nsLocalFileUnix.cpp, line 1436 *** Chrome Registration of locale: Checking for contents.rdf at jar:resource:/chrome/US.jar!/locale/US/messenger-region/ ###!!! ASSERTION: never called: 'Error', file ../../../../dist/include/xpconnect/xpc_map_end.h, line 143 ###!!! Break: at file ../../../../dist/include/xpconnect/xpc_map_end.h, line 143 Segmentation Fault - core dumped
Any stack trace (hint: try "/usr/proc/bin/pstack <core-file>" ...) ?
Assertion in xpc_map_end.h, line 143 is caused by bug 71627. I have changed xptcinvoke_asm_sparc_solaris_GCC.s to xptcinvoke_asm_sparc_solaris_GCC3.s as suggested in bugreport, and I was able to run CVS mozilla on solaris 2.8, compiled with gcc 3.0.2.
*** Bug 110819 has been marked as a duplicate of this bug. ***
Target Milestone: --- → M1
Target Milestone: M1 → Future
* To Uros Bizjak : I cannot use cvs so I get source.tar.gz and TRY to compile... I hope last file version is put in the tarball ! * to jap3003 (and others ;-): I still needed to cast xpinstall/wizard/libxpnet/src/nsSocket.cpp as 163:getsockopt( mFd, SOL_SOCKET, SO_RCVBUF, (char*) &newTCPWin,(Psocklen_t)&len ); 168:getsockopt( mFd, SOL_SOCKET, SO_RCVBUF, (char*) &newTCPWin,(Psocklen_t)&len ); 247:mFd = accept(mListenFd, (struct sockaddr *) &cliaddr, (Psocklen_t)&clilen); 456:if ((getsockname(mListenFd, (struct sockaddr *) &servaddr, (Psocklen_t)&salen)) < 0) from mozilla-source.tar.gz 30th Nov it runs with basic (no) configure options (any optimization crashe)
Summary: Mozilla 0.9.4 failed build on solaris 2.7, gcc 3.0.1 → solaris 2.7, gcc 3.0.1 cannot convert `int*' to `socklen_t*' calling getsockname
*** Bug 126556 has been marked as a duplicate of this bug. ***
*** Bug 128250 has been marked as a duplicate of this bug. ***
Sparc/solaris 2.7, at least, provides a define if it provides socklen_t so we should probably use it.
Attachment #77408 - Flags: review+
nominating for mozilla1.0 -- not building on Solaris is pretty stupid. Handing off to seawoood since he's got a handle on the problem and is the master of the tbox machines. r=dveditz for the patch
Assignee: syd → seawood
Keywords: mozilla1.0
Target Milestone: Future → ---
Comment on attachment 77408 [details] [diff] [review] Check for SOLARIS && !_SOCKLEN_T sr=alecf
Attachment #77408 - Flags: superreview+
Comment on attachment 77408 [details] [diff] [review] Check for SOLARIS && !_SOCKLEN_T a=rjesup@wgate.com for drivers
Attachment #77408 - Flags: approval+
bbaetz checked this in yesterday.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified code fix
Status: RESOLVED → VERIFIED
*** Bug 136494 has been marked as a duplicate of this bug. ***
*** Bug 146547 has been marked as a duplicate of this bug. ***
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: