Closed qiantaossx closed 2 years ago
Update it:
The dependency of srs is the st-thread coroutine library.
The following 2 lines of code in the skt.c file: mprotect(ts->vaddr, REDZONE, PROT_NONE); mprotect(ts->stk_top + extra, REDZONE, PROT_NONE);
This will cause the sched.c file to... memset(ptds, 0, ST_KEYS_MAX sizeof(void )); crash
The alpine code segment may have compatibility issues. Commenting out this memory protection function will allow it to run normally.
Also, may I ask what is the purpose of these two lines of code? Thank you.
TRANS_BY_GPT3
Regarding the jmpbuf of ST, it is only related to the system+CPU architecture. This part of the code has already been modified in version 5.0, resolving this issue. Please avoid duplicating the work.
If you want to use Alpine, you can also compile the binary using Ubuntu or CentOS and then directly copy it to Alpine, instead of installing various tools and compiling SRS on Alpine. This can be achieved using Docker's multi-stage capability.
You can refer to SRS's docker file, which also uses multi-stage compilation.
TRANS_BY_GPT3
Description
The crash occurs in the st_thread_create function. memset(ptds, 0, ST_KEYS_MAX sizeof(void ));
Below is the structure in setjmp.h that SRS depends on. Some adaptations were made during the compilation process.
Below is the structure in setjmp.h in Alpine.
v4.0.198
The above are the issues encountered during the process of using the Alpine image. If possible, I would like to submit a PR with the compilation script and modifications in the ST thread. Could you please take a look? Thank you very much.
Additionally, since the Ubuntu image is quite large, if there is a need to reduce the Docker image size, I would like to ask for suggestions on what other solutions can be used?
TRANS_BY_GPT3