diff --git a/README.md b/README.md index 7e61d6419..5a1fc5fca 100755 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-10-31, Fix [#509][bug #509], Always malloc stack on heap. 3.0.153 * v3.0, 2020-10-31, Remove some global elements for debugging. 3.0.152 * v3.0, 2020-10-31, Use global _srs_server for debugging. 3.0.151 * v3.0, 2020-10-31, Refine source cid, track previous one. 3.0.150 diff --git a/trunk/.gitignore b/trunk/.gitignore index c5ff54605..a67b91615 100644 --- a/trunk/.gitignore +++ b/trunk/.gitignore @@ -44,4 +44,4 @@ srs /configure.sh /janus *.dump - +bug diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 8e6ba482d..6429ee455 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -347,6 +347,8 @@ else echo "Build ST without UDP sendmmsg support." _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -UMD_HAVE_SENDMMSG -U_GNU_SOURCE" fi +# Always alloc on heap, @see https://github.com/ossrs/srs/issues/509#issuecomment-719931676 +_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMALLOC_STACK" # Pass the global extra flags. if [[ $SRS_EXTRA_FLAGS != '' ]]; then _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS" diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 767b78cf9..3aeef041b 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -803,18 +803,6 @@ srs_error_t SrsServer::initialize_st() { srs_error_t err = srs_success; - // @remark, st alloc segment use mmap, which only support 32757 threads, - // if need to support more, for instance, 100k threads, define the macro MALLOC_STACK. - // TODO: FIXME: maybe can use "sysctl vm.max_map_count" to refine. -#define __MMAP_MAX_CONNECTIONS 32756 - if (_srs_config->get_max_connections() > __MMAP_MAX_CONNECTIONS) { - srs_error("st mmap for stack allocation must <= %d threads, " - "@see Makefile of st for MALLOC_STACK, please build st manually by " - "\"make EXTRA_CFLAGS=-DMALLOC_STACK linux-debug\"", __MMAP_MAX_CONNECTIONS); - return srs_error_new(ERROR_ST_EXCEED_THREADS, "%d exceed max %d threads", - _srs_config->get_max_connections(), __MMAP_MAX_CONNECTIONS); - } - // check asprocess. bool asprocess = _srs_config->get_asprocess(); if (asprocess && ppid == 1) { diff --git a/trunk/src/core/srs_core_version3.hpp b/trunk/src/core/srs_core_version3.hpp index 4f7a26305..37451726f 100644 --- a/trunk/src/core/srs_core_version3.hpp +++ b/trunk/src/core/srs_core_version3.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION3_HPP #define SRS_CORE_VERSION3_HPP -#define SRS_VERSION3_REVISION 152 +#define SRS_VERSION3_REVISION 153 #endif