File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,11 @@ void jl_init_threading(void)
659659 jl_n_sweepthreads = jl_options .nsweepthreads ;
660660 if (jl_n_markthreads == -1 ) { // --gcthreads not specified
661661 if ((cp = getenv (NUM_GC_THREADS_NAME ))) { // ENV[NUM_GC_THREADS_NAME] specified
662- jl_n_markthreads = (uint64_t )strtol (cp , NULL , 10 ) - 1 ;
662+ errno = 0 ;
663+ jl_n_markthreads = (uint64_t )strtol (cp , & endptr , 10 ) - 1 ;
664+ if (errno != 0 || endptr == cp || nthreads <= 0 )
665+ jl_n_markthreads = 0 ;
666+ cp = endptr ;
663667 if (* cp == ',' ) {
664668 cp ++ ;
665669 errno = 0 ;
Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
372372 end
373373
374374 withenv (" JULIA_NUM_GC_THREADS" => " 2,1" ) do
375- @test_broken read (` $exename -e $code ` , String) == " 3"
375+ @test read (` $exename -e $code ` , String) == " 3"
376376 end
377377
378378 # --machine-file
You can’t perform that action at this time.
0 commit comments