Closed Bug 2248 Opened 26 years ago Closed 26 years ago

PR_ImportFile, etc. should initialize NSPR implicitly.

Categories

(NSPR :: NSPR, defect, P2)

defect

Tracking

(Not tracked)

CLOSED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

This bug is reported by John McMullen (mcmullen@netscape.com). PR_ImportFile, PR_ImportTCPSocket, and PR_ImportUDPSocket are not initializing NSPR implicitly. So if PR_ImportFile is the first NSPR function your program calls, your program will trigger this assertion failure (in a debug build): Assertion failure: NULL != _pr_fd_cache.stack, at prfdcach.c:77 Abort (core dumped) The fix is to add the following line to the beginning of PR_ImportFile, PR_ImportTCPSocket, and PR_ImportUDPSocket: if (!_pr_initialized) _PR_ImplicitInitialization(); A workaround is to add a dummy PR_GetCurrentThread() call before your PR_ImportFile call. The PR_GetCurrentThread() call forces NSPR to initialize.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed on the tip. /cvsroot/mozilla/nsprpub/pr/src/io/prfile.c, revision 3.9. /cvsroot/mozilla/nsprpub/pr/src/io/prsocket.c, revision 3.11. /cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c, revision 3.10. (Also fixed in the internal cvs repository: /m/src/ns/nspr20/pr/src/io/prfile.c, revision 2.12. /m/src/ns/nspr20/pr/src/io/prsocket.c, revision 2.22. /m/src/ns/nspr20/pr/src/pthreads/ptio.c, revision 2.42.)
Status: RESOLVED → CLOSED
Closed the bug.
NSPR now has its own Bugzilla product. Moving this bug to the NSPR product.
You need to log in before you can comment on or make changes to this bug.