From cb9142c60fe7daa2d67c7dbc5e991703bd252480 Mon Sep 17 00:00:00 2001 From: Kai Engert Date: Tue, 7 Jan 2020 11:04:03 +0000 Subject: [PATCH] Bug 1600803 - NSPR_4_25_BETA1 for FF 74. r=jcj UPGRADE_NSPR_RELEASE Differential Revision: https://phabricator.services.mozilla.com/D55567 --HG-- extra : moz-landing-system : lando --- nsprpub/TAG-INFO | 2 +- nsprpub/config/prdepend.h | 1 - nsprpub/configure | 2 +- nsprpub/configure.in | 2 +- nsprpub/pr/include/prinit.h | 6 +- nsprpub/pr/src/md/windows/ntio.c | 10 ++- nsprpub/pr/tests/Makefile.in | 15 +---- nsprpub/pr/tests/acceptread.c | 13 +++- nsprpub/pr/tests/acceptreademu.c | 13 +++- nsprpub/pr/tests/append.c | 4 +- nsprpub/pr/tests/cltsrv.c | 34 ++++++++-- nsprpub/pr/tests/fdcach.c | 106 +------------------------------ nsprpub/pr/tests/foreign.c | 3 +- nsprpub/pr/tests/fsync.c | 2 +- nsprpub/pr/tests/gethost.c | 2 +- nsprpub/pr/tests/layer.c | 14 +++- nsprpub/pr/tests/lazyinit.c | 4 +- nsprpub/pr/tests/multiwait.c | 13 +++- nsprpub/pr/tests/nameshm1.c | 17 ++++- nsprpub/pr/tests/nblayer.c | 14 +++- nsprpub/pr/tests/ntioto.c | 14 +++- nsprpub/pr/tests/op_filnf.c | 2 +- nsprpub/pr/tests/provider.c | 13 +++- nsprpub/pr/tests/runtests.pl | 1 - nsprpub/pr/tests/runtests.sh | 81 ++++++++++++----------- nsprpub/pr/tests/sel_spd.c | 13 +++- nsprpub/pr/tests/sema.c | 15 ++++- nsprpub/pr/tests/semaerr.c | 15 ++++- nsprpub/pr/tests/semaerr1.c | 15 ++++- nsprpub/pr/tests/semaping.c | 17 ++++- nsprpub/pr/tests/semapong.c | 17 ++++- nsprpub/pr/tests/socket.c | 6 +- nsprpub/pr/tests/testfile.c | 2 +- nsprpub/pr/tests/thruput.c | 15 ++++- nsprpub/pr/tests/tmoacc.c | 13 +++- nsprpub/pr/tests/tmocon.c | 13 +++- nsprpub/pr/tests/vercheck.c | 6 +- nsprpub/pr/tests/writev.c | 13 +++- old-configure.in | 2 +- 39 files changed, 339 insertions(+), 211 deletions(-) diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index e2d82db2e440..636d97051dda 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_24_RTM \ No newline at end of file +NSPR_4_25_BETA1 \ No newline at end of file diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index 6c66b37ca0fc..e49e92677e3e 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,4 +10,3 @@ */ #error "Do not include this header file." - diff --git a/nsprpub/configure b/nsprpub/configure index 68dfd5f62bf4..2fe15c7c64c8 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -2486,7 +2486,7 @@ test -n "$target_alias" && program_prefix=${target_alias}- MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=24 +MOD_MINOR_VERSION=25 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= diff --git a/nsprpub/configure.in b/nsprpub/configure.in index 8d8da1ec2628..1c23fefa46e6 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -15,7 +15,7 @@ dnl ======================================================== dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=24 +MOD_MINOR_VERSION=25 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index eb3cfa059a88..5ddc9aa9537f 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.24" +#define PR_VERSION "4.25 Beta" #define PR_VMAJOR 4 -#define PR_VMINOR 24 +#define PR_VMINOR 25 #define PR_VPATCH 0 -#define PR_BETA PR_FALSE +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/src/md/windows/ntio.c b/nsprpub/pr/src/md/windows/ntio.c index 040bbd31069a..40f52007892f 100644 --- a/nsprpub/pr/src/md/windows/ntio.c +++ b/nsprpub/pr/src/md/windows/ntio.c @@ -2252,6 +2252,7 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len) int rv, err; LONG hiOffset = 0; LONG loOffset; + LARGE_INTEGER offset; /* use for a normalized add of len to offset */ if (!fd->secret->md.sync_file_io) { PRThread *me = _PR_MD_CURRENT_THREAD(); @@ -2368,7 +2369,14 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len) return -1; } - SetFilePointer((HANDLE)f, me->md.blocked_io_bytes, 0, FILE_CURRENT); + /* Apply the workaround from bug 70765 (see _PR_MD_WRITE) + * to the reading code, too. */ + + offset.LowPart = me->md.overlapped.overlapped.Offset; + offset.HighPart = me->md.overlapped.overlapped.OffsetHigh; + offset.QuadPart += me->md.blocked_io_bytes; + + SetFilePointer((HANDLE)f, offset.LowPart, &offset.HighPart, FILE_BEGIN); PR_ASSERT(me->io_pending == PR_FALSE); diff --git a/nsprpub/pr/tests/Makefile.in b/nsprpub/pr/tests/Makefile.in index 8a87ad094909..876a0954b977 100644 --- a/nsprpub/pr/tests/Makefile.in +++ b/nsprpub/pr/tests/Makefile.in @@ -442,17 +442,4 @@ endif ALWAYS: runtests:: $(PROGS) ALWAYS - @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n" - @$(ECHO) "BEGIN\t\t\t`date`" - @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n" - @$(ECHO) "Test\t\t\tResult\n" - @cd $(OBJDIR); for i in $(PROGRAMS); do \ - $(ECHO) "$$i\c"; \ - ./$$i >> $(LOGFILE) 2>&1 ; \ - if [ 0 = $$? ] ; then \ - $(ECHO) "\t\t\tPassed"; \ - else \ - $(ECHO) "\t\t\tFAILED"; \ - fi; \ - done - @$(ECHO) "\nEND\t\t`date`\n" + $(topsrcdir)/pr/tests/runtests.sh $(DIST) diff --git a/nsprpub/pr/tests/acceptread.c b/nsprpub/pr/tests/acceptread.c index d7fe079c4f8c..090b08455558 100644 --- a/nsprpub/pr/tests/acceptread.c +++ b/nsprpub/pr/tests/acceptread.c @@ -14,7 +14,18 @@ #include -#define DEFAULT_PORT 12273 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define DEFAULT_PORT 12273 PORT_INC_DO PORT_INC_3264 #define GET "GET / HTTP/1.0\n\n" static PRFileDesc *std_out, *err_out; static PRIntervalTime write_dally, accept_timeout; diff --git a/nsprpub/pr/tests/acceptreademu.c b/nsprpub/pr/tests/acceptreademu.c index 75140c02f6d7..485b9d502596 100644 --- a/nsprpub/pr/tests/acceptreademu.c +++ b/nsprpub/pr/tests/acceptreademu.c @@ -20,7 +20,18 @@ #include -#define DEFAULT_PORT 12273 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define DEFAULT_PORT 12273 PORT_INC_DO PORT_INC_3264 #define GET "GET / HTTP/1.0\n\n" static PRFileDesc *std_out, *err_out; static PRIntervalTime write_dally, accept_timeout; diff --git a/nsprpub/pr/tests/append.c b/nsprpub/pr/tests/append.c index 9d688a4f8401..64fe3ff2c13e 100644 --- a/nsprpub/pr/tests/append.c +++ b/nsprpub/pr/tests/append.c @@ -62,7 +62,7 @@ int main(int argc, char **argv) PL_DestroyOptState(opt); } /* end block "Get command line options" */ /* ---------------------------------------------------------------------- */ - fd = PR_Open( "/tmp/nsprAppend", (PR_APPEND | PR_CREATE_FILE | PR_TRUNCATE | PR_WRONLY), 0666 ); + fd = PR_Open( "./tmp-nsprAppend", (PR_APPEND | PR_CREATE_FILE | PR_TRUNCATE | PR_WRONLY), 0666 ); if ( NULL == fd ) { if (debug) { printf("PR_Open() failed for writing: %d\n", PR_GetError()); @@ -98,7 +98,7 @@ int main(int argc, char **argv) goto Finished; } /* ---------------------------------------------------------------------- */ - fd = PR_Open( "/tmp/nsprAppend", PR_RDONLY, 0 ); + fd = PR_Open( "./tmp-nsprAppend", PR_RDONLY, 0 ); if ( NULL == fd ) { if (debug) { printf("PR_Open() failed for reading: %d\n", PR_GetError()); diff --git a/nsprpub/pr/tests/cltsrv.c b/nsprpub/pr/tests/cltsrv.c index caf1ad4d6693..2dbe4c7ae941 100644 --- a/nsprpub/pr/tests/cltsrv.c +++ b/nsprpub/pr/tests/cltsrv.c @@ -64,7 +64,20 @@ #define DEFAULT_HIGH 0 #define BUFFER_SIZE 1024 #define DEFAULT_BACKLOG 5 -#define DEFAULT_PORT 12849 + +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define DEFAULT_PORT 12849 PORT_INC_DO PORT_INC_3264 + #define DEFAULT_CLIENTS 1 #define ALLOWED_IN_ACCEPT 1 #define DEFAULT_CLIPPING 1000 @@ -792,11 +805,16 @@ static void PR_CALLBACK Server(void *arg) memset(&serverAddress, 0, sizeof(serverAddress)); if (PR_AF_INET6 != domain) { + TEST_LOG(cltsrv_log_file, TEST_LOG_ALWAYS, + ("server binding to ip port %s\n", DEFAULT_PORT)); rv = PR_InitializeNetAddr(PR_IpAddrAny, DEFAULT_PORT, &serverAddress); } - else + else { + TEST_LOG(cltsrv_log_file, TEST_LOG_ALWAYS, + ("server binding to ipv6 port %s\n", DEFAULT_PORT)); rv = PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, DEFAULT_PORT, &serverAddress); + } rv = PR_Bind(server->listener, &serverAddress); TEST_ASSERT(PR_SUCCESS == rv); @@ -1131,16 +1149,24 @@ int main(int argc, char** argv) client[index].ml = PR_NewLock(); if (serverIsLocal) { - if (PR_AF_INET6 != domain) + if (PR_AF_INET6 != domain) { + TEST_LOG(cltsrv_log_file, TEST_LOG_ALWAYS, + ("loopback client ip port %s\n", DEFAULT_PORT)); (void)PR_InitializeNetAddr( PR_IpAddrLoopback, DEFAULT_PORT, &client[index].serverAddress); - else + } + else { + TEST_LOG(cltsrv_log_file, TEST_LOG_ALWAYS, + ("loopback client ipv6 port %s\n", DEFAULT_PORT)); rv = PR_SetNetAddr(PR_IpAddrLoopback, PR_AF_INET6, DEFAULT_PORT, &client[index].serverAddress); + } } else { + TEST_LOG(cltsrv_log_file, TEST_LOG_ALWAYS, + ("client enumerate port %s\n", DEFAULT_PORT)); (void)PR_EnumerateHostEnt( 0, &host, DEFAULT_PORT, &client[index].serverAddress); } diff --git a/nsprpub/pr/tests/fdcach.c b/nsprpub/pr/tests/fdcach.c index 2fb2e5b8107f..5fa51b706a8a 100644 --- a/nsprpub/pr/tests/fdcach.c +++ b/nsprpub/pr/tests/fdcach.c @@ -6,7 +6,7 @@ /* * File: fdcach.c * Description: - * This test verifies that the fd cache and stack are working + * This test verifies that the fd cache is working * correctly. */ @@ -18,7 +18,7 @@ /* * Define ORDER_PRESERVED if the implementation of PR_SetFDCacheSize * preserves the ordering of the fd's when moving them between the - * cache and the stack. + * cache. */ #define ORDER_PRESERVED 1 @@ -35,12 +35,6 @@ int main(int argc, char **argv) PRFileDesc *savefds[NUM_FDS]; int numfds = sizeof(fds)/sizeof(fds[0]); - /* - * Switch between cache and stack when they are empty. - * Then start with the fd cache. - */ - PR_SetFDCacheSize(0, FD_CACHE_SIZE); - PR_SetFDCacheSize(0, 0); PR_SetFDCacheSize(0, FD_CACHE_SIZE); /* Add some fd's to the fd cache. */ @@ -82,59 +76,6 @@ int main(int argc, char **argv) } } - /* Switch to the fd stack. */ - PR_SetFDCacheSize(0, 0); - - /* - * Create some fd's. These fd's should come from - * the fd stack. - */ - for (i = 0; i < numfds; i++) { - fds[i] = PR_NewTCPSocket(); - if (NULL == fds[i]) { - fprintf(stderr, "PR_NewTCPSocket failed\n"); - exit(1); - } -#ifdef ORDER_PRESERVED - if (fds[i] != savefds[numfds-1-i]) { - fprintf(stderr, "fd stack malfunctioned\n"); - exit(1); - } -#else - savefds[numfds-1-i] = fds[i]; -#endif - } - /* Put the fd's back to the fd stack. */ - for (i = 0; i < numfds; i++) { - if (PR_Close(savefds[i]) == PR_FAILURE) { - fprintf(stderr, "PR_Close failed\n"); - exit(1); - } - } - - /* - * Now create some fd's and verify the LIFO ordering of - * the fd stack. - */ - for (i = 0; i < numfds; i++) { - fds[i] = PR_NewTCPSocket(); - if (NULL == fds[i]) { - fprintf(stderr, "PR_NewTCPSocket failed\n"); - exit(1); - } - if (fds[i] != savefds[numfds-1-i]) { - fprintf(stderr, "fd stack malfunctioned\n"); - exit(1); - } - } - /* Put the fd's back to the fd stack. */ - for (i = 0; i < numfds; i++) { - if (PR_Close(savefds[i]) == PR_FAILURE) { - fprintf(stderr, "PR_Close failed\n"); - exit(1); - } - } - /* Switch to the fd cache. */ PR_SetFDCacheSize(0, FD_CACHE_SIZE); @@ -178,49 +119,6 @@ int main(int argc, char **argv) } } - /* Switch to the fd stack. */ - PR_SetFDCacheSize(0, 0); - - for (i = 0; i < numfds; i++) { - fds[i] = PR_NewTCPSocket(); - if (NULL == fds[i]) { - fprintf(stderr, "PR_NewTCPSocket failed\n"); - exit(1); - } -#ifdef ORDER_PRESERVED - if (fds[i] != savefds[numfds-1-i]) { - fprintf(stderr, "fd stack malfunctioned\n"); - exit(1); - } -#else - savefds[numfds-1-i]; -#endif - } - for (i = 0; i < numfds; i++) { - if (PR_Close(savefds[i]) == PR_FAILURE) { - fprintf(stderr, "PR_Close failed\n"); - exit(1); - } - } - - for (i = 0; i < numfds; i++) { - fds[i] = PR_NewTCPSocket(); - if (NULL == fds[i]) { - fprintf(stderr, "PR_NewTCPSocket failed\n"); - exit(1); - } - if (fds[i] != savefds[numfds-1-i]) { - fprintf(stderr, "fd stack malfunctioned\n"); - exit(1); - } - } - for (i = 0; i < numfds; i++) { - if (PR_Close(savefds[i]) == PR_FAILURE) { - fprintf(stderr, "PR_Close failed\n"); - exit(1); - } - } - PR_Cleanup(); printf("PASS\n"); return 0; diff --git a/nsprpub/pr/tests/foreign.c b/nsprpub/pr/tests/foreign.c index a711b7580b3b..a1f5b5cbccc8 100644 --- a/nsprpub/pr/tests/foreign.c +++ b/nsprpub/pr/tests/foreign.c @@ -223,7 +223,8 @@ static void OneShot(void *arg) break; case 6: -#define TEMP_DIR "/tmp/" +#define TEMP_DIR "./tmp" + PR_MkDir(TEMP_DIR, 0700); dir = PR_OpenDir(TEMP_DIR); DPRINTF((output,"Thread[0x%x] called PR_OpenDir\n", PR_GetCurrentThread())); diff --git a/nsprpub/pr/tests/fsync.c b/nsprpub/pr/tests/fsync.c index ee2eeff7d999..3e0fb175c19e 100644 --- a/nsprpub/pr/tests/fsync.c +++ b/nsprpub/pr/tests/fsync.c @@ -19,7 +19,7 @@ static void Help(void) PR_fprintf(err, "\t-c Nuber of iterations (default: 10)\n"); PR_fprintf(err, "\t-S Sync the file (default: FALSE)\n"); PR_fprintf(err, "\t-K Size of file (K bytes) (default: 10)\n"); - PR_fprintf(err, "\t Name of file to write (default: /usr/tmp/sync.dat)\n"); + PR_fprintf(err, "\t Name of file to write (default: ./tmp-sync.dat)\n"); PR_fprintf(err, "\t-h This message and nothing else\n"); } /* Help */ diff --git a/nsprpub/pr/tests/gethost.c b/nsprpub/pr/tests/gethost.c index 8a15cb61c2fe..71704a8454fd 100644 --- a/nsprpub/pr/tests/gethost.c +++ b/nsprpub/pr/tests/gethost.c @@ -18,7 +18,7 @@ #include #include -#define DEFAULT_HOST_NAME "mcom.com" +#define DEFAULT_HOST_NAME "mozilla.org" static void Help(void) { diff --git a/nsprpub/pr/tests/layer.c b/nsprpub/pr/tests/layer.c index 8579394dc317..8ad32eeaa874 100644 --- a/nsprpub/pr/tests/layer.c +++ b/nsprpub/pr/tests/layer.c @@ -40,7 +40,19 @@ typedef enum Verbosity {silent, quiet, chatty, noisy} Verbosity; static PRIntn minor_iterations = 5; static PRIntn major_iterations = 1; static Verbosity verbosity = quiet; -static PRUint16 default_port = 12273; + +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +static PRUint16 default_port = 12273 PORT_INC_DO PORT_INC_3264; static PRFileDesc *PushLayer(PRFileDesc *stack) { diff --git a/nsprpub/pr/tests/lazyinit.c b/nsprpub/pr/tests/lazyinit.c index 5ec1c9578e4b..2a910f2051cf 100644 --- a/nsprpub/pr/tests/lazyinit.c +++ b/nsprpub/pr/tests/lazyinit.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) PR_LOCAL_THREAD, PR_JOINABLE_THREAD, 0); break; - case 3: file = PR_Open("/usr/tmp/", PR_RDONLY, 0); + case 3: file = PR_Open("./tmp-", PR_RDONLY, 0); break; case 4: udp = PR_NewUDPSocket(); @@ -79,7 +79,7 @@ int main(int argc, char **argv) case 5: tcp = PR_NewTCPSocket(); break; - case 6: dir = PR_OpenDir("/usr/tmp/"); + case 6: dir = PR_OpenDir("./tmp-"); break; case 7: (void)PR_NewThreadPrivateIndex(&pdkey, NULL); diff --git a/nsprpub/pr/tests/multiwait.c b/nsprpub/pr/tests/multiwait.c index 243b315e89a9..62a07f042841 100644 --- a/nsprpub/pr/tests/multiwait.c +++ b/nsprpub/pr/tests/multiwait.c @@ -32,9 +32,20 @@ typedef struct Shared typedef enum Verbosity {silent, quiet, chatty, noisy} Verbosity; +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + static PRFileDesc *debug = NULL; static PRInt32 desc_allocated = 0; -static PRUint16 default_port = 12273; +static PRUint16 default_port = 12273 PORT_INC_DO PORT_INC_3264; static enum Verbosity verbosity = quiet; static PRInt32 ops_required = 1000, ops_done = 0; static PRThreadScope thread_scope = PR_LOCAL_THREAD; diff --git a/nsprpub/pr/tests/nameshm1.c b/nsprpub/pr/tests/nameshm1.c index 3f7137e23e17..ca24b4e813f4 100644 --- a/nsprpub/pr/tests/nameshm1.c +++ b/nsprpub/pr/tests/nameshm1.c @@ -72,9 +72,20 @@ #include #include -#define SEM_NAME1 "/tmp/nameshmSEM1" -#define SEM_NAME2 "/tmp/nameshmSEM2" -#define OPT_NAME "/tmp/xxxNSPRshm" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define SEM_NAME1 "/tmp/nameshmSEM1" SEM_D SEM_64 +#define SEM_NAME2 "/tmp/nameshmSEM2" SEM_D SEM_64 +#define OPT_NAME "/tmp/xxxNSPRshm" SEM_D SEM_64 #define EXE_NAME "nameshm1" #define SEM_MODE 0666 #define SHM_MODE 0666 diff --git a/nsprpub/pr/tests/nblayer.c b/nsprpub/pr/tests/nblayer.c index c9e6bf245a93..9459866972d1 100644 --- a/nsprpub/pr/tests/nblayer.c +++ b/nsprpub/pr/tests/nblayer.c @@ -53,7 +53,19 @@ typedef enum Verbosity {silent, quiet, chatty, noisy} Verbosity; static PRIntn minor_iterations = 5; static PRIntn major_iterations = 1; static Verbosity verbosity = quiet; -static PRUint16 default_port = 12273; + +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +static PRUint16 default_port = 12273 PORT_INC_DO PORT_INC_3264; static PRFileDesc *PushLayer(PRFileDesc *stack) { diff --git a/nsprpub/pr/tests/ntioto.c b/nsprpub/pr/tests/ntioto.c index 5fb01e7605ea..809e0ae5c698 100644 --- a/nsprpub/pr/tests/ntioto.c +++ b/nsprpub/pr/tests/ntioto.c @@ -57,7 +57,19 @@ PRUint32 failed_already = 0; /* JITTER_DEFAULT: the number of times AcceptThread() and JitterThread() ping-pong */ #define JITTER_DEFAULT 100000 -#define BASE_PORT 9867 + +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define BASE_PORT 9867 PORT_INC_DO PORT_INC_3264 PRIntervalTime timeout; PRNetAddr listenAddr; diff --git a/nsprpub/pr/tests/op_filnf.c b/nsprpub/pr/tests/op_filnf.c index 1f1e8eed8782..b4ab2fb15696 100644 --- a/nsprpub/pr/tests/op_filnf.c +++ b/nsprpub/pr/tests/op_filnf.c @@ -31,7 +31,7 @@ PRIntn error_code; int main(int argc, char **argv) { PR_STDIO_INIT(); - t1 = PR_Open("/usr/tmp/ttools/err03.tmp", PR_TRUNCATE | PR_RDWR, 0666); + t1 = PR_Open("./tmp-ttools/err03.tmp", PR_TRUNCATE | PR_RDWR, 0666); if (t1 == NULL) { if (PR_GetError() == PR_FILE_NOT_FOUND_ERROR) { printf ("error code is %d \n", PR_GetError()); diff --git a/nsprpub/pr/tests/provider.c b/nsprpub/pr/tests/provider.c index 1bd15fb6fc0f..3450b20aea82 100644 --- a/nsprpub/pr/tests/provider.c +++ b/nsprpub/pr/tests/provider.c @@ -58,11 +58,22 @@ ** This is the beginning of the test */ +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + #define RECV_FLAGS 0 #define SEND_FLAGS 0 #define BUFFER_SIZE 1024 #define DEFAULT_BACKLOG 5 -#define DEFAULT_PORT 13000 +#define DEFAULT_PORT 13000 PORT_INC_DO PORT_INC_3264 #define DEFAULT_CLIENTS 1 #define ALLOWED_IN_ACCEPT 1 #define DEFAULT_CLIPPING 1000 diff --git a/nsprpub/pr/tests/runtests.pl b/nsprpub/pr/tests/runtests.pl index f1ab7647e4e8..326c08f8626d 100755 --- a/nsprpub/pr/tests/runtests.pl +++ b/nsprpub/pr/tests/runtests.pl @@ -289,7 +289,6 @@ $prog = shift; # Program to test "logfile", "logger", "many_cv", -"multiwait", "nameshm1", "nblayer", "nonblock", diff --git a/nsprpub/pr/tests/runtests.sh b/nsprpub/pr/tests/runtests.sh index c570bf86743c..8d3144019d5a 100755 --- a/nsprpub/pr/tests/runtests.sh +++ b/nsprpub/pr/tests/runtests.sh @@ -4,6 +4,20 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +if test -z $1 +then + echo "usage: $0 " + exit 1 +fi + +cd $1/lib +ABS_LIB=$PWD +cd - + +export DYLD_LIBRARY_PATH=${ABS_LIB}:${DYLD_LIBRARY_PATH} +export LD_LIBRARY_PATH=${ABS_LIB}:${LD_LIBRARY_PATH} +export PATH=${ABS_LIB}:${PATH} + # # runtests.sh # Bourne shell script for nspr tests @@ -57,12 +71,35 @@ fi # #forktest (failed on IRIX) +#multiwait - fails on Linux 64bit since NSPR v 4.4 from 2004. #nbconn - fails on some platforms #poll_er - fails on some platforms? limited use? #prpoll - the bad-FD test needs to be moved to a different test #sleep - specific to OS/2 +# +# all of the following were disabled in 2019 when reenabling CI tests, +# because they failed on at least one of the platforms: +# +# cltsrv +# cvar +# gethost +# getproto +# layer +# logfile +# nameshm1 +# nblayer +# nonblock +# ntioto +# op_2long +# parent +# provider +# ranfile +# socket +# sockopt +# vercheck -LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE} +#LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE} +LOGFILE=nspr-test.log # # Tests run on all platforms @@ -80,9 +117,7 @@ atomic attach bigfile cleanup -cltsrv concur -cvar cvar2 dlltest dtoa @@ -93,8 +128,6 @@ fileio foreign formattm fsync -gethost -getproto i2l initclk inrval @@ -108,27 +141,18 @@ joinkk joinku joinuk joinuu -layer lazyinit libfilename lltest lock lockfile -logfile logger many_cv -multiwait -nameshm1 -nblayer -nonblock -ntioto ntoh -op_2long op_excl op_filnf op_filok op_nofil -parent parsetm peek perf @@ -141,10 +165,8 @@ pollable prftest prfz primblok -provider prpollml pushtop -ranfile randseed reinit rwlocktest @@ -164,8 +186,6 @@ servr_ku servr_uu short_thread sigpipe -socket -sockopt sockping sprintf stack @@ -181,7 +201,6 @@ timemac timetest tpd udpsrv -vercheck version writev xnotify @@ -211,7 +230,7 @@ printf "Test\t\t\tResult\n\n" if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then for prog in $TESTS do - printf "$prog" + printf "$prog (`date +%T`)" printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1 ./$prog >> ${LOGFILE} 2>&1 if [ 0 = $? ] ; then @@ -225,7 +244,7 @@ if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_P else for prog in $TESTS do - printf "$prog" + printf "$prog (`date +%T`)" printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1 export test_rval ./$prog >> ${LOGFILE} 2>&1 & @@ -249,22 +268,10 @@ else done fi; +if [ $rval -ne 0 ]; then + cat ${LOGFILE} +fi + printf "END\t\t\t`date`\n" exit $rval - - - - - - - - - - - - - - - - diff --git a/nsprpub/pr/tests/sel_spd.c b/nsprpub/pr/tests/sel_spd.c index 6c17042341ca..bb9082448477 100644 --- a/nsprpub/pr/tests/sel_spd.c +++ b/nsprpub/pr/tests/sel_spd.c @@ -16,7 +16,18 @@ #include #include -#define PORT_BASE 19000 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define PORT_BASE 19000 PORT_INC_DO PORT_INC_3264 typedef struct timer_slot_t { unsigned long d_connect; diff --git a/nsprpub/pr/tests/sema.c b/nsprpub/pr/tests/sema.c index 76198eb047fe..81ccd01b7a37 100644 --- a/nsprpub/pr/tests/sema.c +++ b/nsprpub/pr/tests/sema.c @@ -8,8 +8,19 @@ #include -#define SEM_NAME1 "/tmp/foo.sem" -#define SEM_NAME2 "/tmp/bar.sem" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define SEM_NAME1 "/tmp/foo.sem" SEM_D SEM_64 +#define SEM_NAME2 "/tmp/bar.sem" SEM_D SEM_64 #define SEM_MODE 0666 #define ITERATIONS 1000 diff --git a/nsprpub/pr/tests/semaerr.c b/nsprpub/pr/tests/semaerr.c index 4e6a8ff27a2e..f3c253b4f4e9 100644 --- a/nsprpub/pr/tests/semaerr.c +++ b/nsprpub/pr/tests/semaerr.c @@ -8,8 +8,19 @@ #include -#define NO_SUCH_SEM_NAME "/tmp/nosuchsem.sem" -#define SEM_NAME1 "/tmp/foo.sem" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define NO_SUCH_SEM_NAME "/tmp/nosuchsem.sem" SEM_D SEM_64 +#define SEM_NAME1 "/tmp/foo.sem" SEM_D SEM_64 #define EXE_NAME "semaerr1" #define SEM_MODE 0666 diff --git a/nsprpub/pr/tests/semaerr1.c b/nsprpub/pr/tests/semaerr1.c index b2e4987230f2..9271663d69c7 100644 --- a/nsprpub/pr/tests/semaerr1.c +++ b/nsprpub/pr/tests/semaerr1.c @@ -8,8 +8,19 @@ #include -#define SEM_NAME1 "/tmp/foo.sem" -#define SEM_NAME2 "/tmp/bar.sem" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define SEM_NAME1 "/tmp/foo.sem" SEM_D SEM_64 +#define SEM_NAME2 "/tmp/bar.sem" SEM_D SEM_64 #define SEM_MODE 0666 static PRBool debug_mode = PR_FALSE; diff --git a/nsprpub/pr/tests/semaping.c b/nsprpub/pr/tests/semaping.c index 2f31bd0bc7a1..3b653d524e0d 100644 --- a/nsprpub/pr/tests/semaping.c +++ b/nsprpub/pr/tests/semaping.c @@ -8,9 +8,20 @@ #include -#define SHM_NAME "/tmp/counter" -#define SEM_NAME1 "/tmp/foo.sem" -#define SEM_NAME2 "/tmp/bar.sem" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define SHM_NAME "/tmp/counter" SEM_D SEM_64 +#define SEM_NAME1 "/tmp/foo.sem" SEM_D SEM_64 +#define SEM_NAME2 "/tmp/bar.sem" SEM_D SEM_64 #define EXE_NAME "semapong" #define SEM_MODE 0666 #define SHM_MODE 0666 diff --git a/nsprpub/pr/tests/semapong.c b/nsprpub/pr/tests/semapong.c index 954f90f1d964..fd24824e31ce 100644 --- a/nsprpub/pr/tests/semapong.c +++ b/nsprpub/pr/tests/semapong.c @@ -8,9 +8,20 @@ #include -#define SHM_NAME "/tmp/counter" -#define SEM_NAME1 "/tmp/foo.sem" -#define SEM_NAME2 "/tmp/bar.sem" +#ifdef DEBUG +#define SEM_D "D" +#else +#define SEM_D +#endif +#ifdef IS_64 +#define SEM_64 "64" +#else +#define SEM_64 +#endif + +#define SHM_NAME "/tmp/counter" SEM_D SEM_64 +#define SEM_NAME1 "/tmp/foo.sem" SEM_D SEM_64 +#define SEM_NAME2 "/tmp/bar.sem" SEM_D SEM_64 #define ITERATIONS 1000 static PRBool debug_mode = PR_FALSE; diff --git a/nsprpub/pr/tests/socket.c b/nsprpub/pr/tests/socket.c index a4925350c4f8..232898f69e7a 100644 --- a/nsprpub/pr/tests/socket.c +++ b/nsprpub/pr/tests/socket.c @@ -45,9 +45,9 @@ char *TEST_DIR = "prdir"; char *SMALL_FILE_NAME = "prsmallf"; char *LARGE_FILE_NAME = "prlargef"; #else -char *TEST_DIR = "/tmp/prsocket_test_dir"; -char *SMALL_FILE_NAME = "/tmp/prsocket_test_dir/small_file"; -char *LARGE_FILE_NAME = "/tmp/prsocket_test_dir/large_file"; +char *TEST_DIR = "./tmp-prsocket_test_dir"; +char *SMALL_FILE_NAME = "./tmp-prsocket_test_dir/small_file"; +char *LARGE_FILE_NAME = "./tmp-prsocket_test_dir/large_file"; #endif #define SMALL_FILE_SIZE (3 * 1024) /* 3 KB */ #define SMALL_FILE_OFFSET_1 (512) diff --git a/nsprpub/pr/tests/testfile.c b/nsprpub/pr/tests/testfile.c index 99cf94ddd50c..88d4afbfdc79 100644 --- a/nsprpub/pr/tests/testfile.c +++ b/nsprpub/pr/tests/testfile.c @@ -71,7 +71,7 @@ char *TEST_DIR = "C:\\temp\\prdir"; char *FILE_NAME = "pr_testfile"; char *HIDDEN_FILE_NAME = "hidden_pr_testfile"; #else -char *TEST_DIR = "/tmp/testfile_dir"; +char *TEST_DIR = "./tmp-testfile_dir"; char *FILE_NAME = "pr_testfile"; char *HIDDEN_FILE_NAME = ".hidden_pr_testfile"; #endif diff --git a/nsprpub/pr/tests/thruput.c b/nsprpub/pr/tests/thruput.c index a772deaab1c9..156bbde9a3ed 100644 --- a/nsprpub/pr/tests/thruput.c +++ b/nsprpub/pr/tests/thruput.c @@ -27,7 +27,20 @@ #include "plgetopt.h" #define ADDR_BUFFER 100 -#define PORT_NUMBER 51877 + +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define PORT_NUMBER 51877 PORT_INC_DO PORT_INC_3264 + #define SAMPLING_INTERVAL 10 #define BUFFER_SIZE (32 * 1024) diff --git a/nsprpub/pr/tests/tmoacc.c b/nsprpub/pr/tests/tmoacc.c index a4d14daaa8f5..d7e64cbea68d 100644 --- a/nsprpub/pr/tests/tmoacc.c +++ b/nsprpub/pr/tests/tmoacc.c @@ -11,7 +11,18 @@ #include "plerror.h" #include "plgetopt.h" -#define BASE_PORT 9867 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define BASE_PORT 9867 PORT_INC_DO PORT_INC_3264 #define DEFAULT_THREADS 1 #define DEFAULT_BACKLOG 10 #define DEFAULT_TIMEOUT 10 diff --git a/nsprpub/pr/tests/tmocon.c b/nsprpub/pr/tests/tmocon.c index 9d214bc5d270..3d992c344306 100644 --- a/nsprpub/pr/tests/tmocon.c +++ b/nsprpub/pr/tests/tmocon.c @@ -50,7 +50,18 @@ char *getcwd(char *buf, size_t size) } #endif -#define BASE_PORT 9867 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define BASE_PORT 9867 PORT_INC_DO PORT_INC_3264 #define DEFAULT_DALLY 1 #define DEFAULT_THREADS 1 diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 6217e97d2108..2fc0fabeeff3 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -41,7 +41,7 @@ static char *compatible_version[] = { "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9", "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15", "4.16", "4.17", "4.18", "4.19", "4.20", "4.21", "4.22", - "4.23", + "4.23", "4.24", PR_VERSION }; @@ -57,8 +57,8 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.24.1", - "4.25", "4.25.1", + "4.25.1", + "4.26", "4.26.1", "10.0", "11.1", "12.14.20" }; diff --git a/nsprpub/pr/tests/writev.c b/nsprpub/pr/tests/writev.c index 7b761648f85c..f72f00fb44a1 100644 --- a/nsprpub/pr/tests/writev.c +++ b/nsprpub/pr/tests/writev.c @@ -15,7 +15,18 @@ #define IOV_MAX 16 #endif -#define BASE_PORT 9867 +#ifdef DEBUG +#define PORT_INC_DO +100 +#else +#define PORT_INC_DO +#endif +#ifdef IS_64 +#define PORT_INC_3264 +200 +#else +#define PORT_INC_3264 +#endif + +#define BASE_PORT 9867 PORT_INC_DO PORT_INC_3264 int PR_CALLBACK Writev(int argc, char **argv) { diff --git a/old-configure.in b/old-configure.in index 2ac7fd92dfaa..59659092fa69 100644 --- a/old-configure.in +++ b/old-configure.in @@ -47,7 +47,7 @@ dnl Set the version number of the libs included with mozilla dnl ======================================================== MOZPNG=10635 NSPR_VERSION=4 -NSPR_MINVER=4.24 +NSPR_MINVER=4.25 NSS_VERSION=3 dnl Set the minimum version of toolkit libs used by mozilla