pthreads icon indicating copy to clipboard operation
pthreads copied to clipboard

Segmentation fault alpine linux

Open vGhost2000 opened this issue 6 years ago • 1 comments

Environment

  • PHP: 7.2.13
  • pthreads: 3.2.0
  • OS: linux, docker container

Summary

In alpine linux image:

  1. pthreads wokers pool + imagick in woker => Segmentation fault
  2. pthreads wokers pool <20 wokers + curl in woker => all fine
  3. pthreads wokers pool >30-40 wokers + curl => Segmentation fault

In debian linux image:

  1. pthreads wokers pool + imagick in woker => all fine
  2. pthreads wokers pool <20 wokers + curl in woker => all fine
  3. pthreads wokers pool >30-40 wokers + curl => all fine

(sorry im bad speack english)

Reproducing Code

In attachment file, completely environment, php code, example files.

test.tar.gz

Unpack, then run cmd:

  1. alpine
docker build -t alpine-pthreads .
docker run --rm alpine-pthreads

START single thread process      
Single thread time: 40.1971

START multi thread process       
                                
Segmentation fault (core dumped) 
  1. debian (all fine):
docker build -f ./Dockerfile.deb -t debian-pthreads .
docker run --rm debian-pthreads

START single thread process
Single thread time: 41.0055


START multi thread process
Multi thread time: 10.2270

Expected Output

No segmentation fault

Actual Output

Segmentation fault

vGhost2000 avatar Dec 30 '18 18:12 vGhost2000

If you install debug symbols and run it with gdb you might get a nice stack trace that could help. Note that curl comes with async support though imagick probably does not even if it might be just a proc wrapper.

joeyhub avatar Feb 14 '19 09:02 joeyhub