Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using stevebauman/purify with swoole and pre/code tags enabled crashes worker processes. #5083

Open
kolaente opened this issue Jun 28, 2023 · 4 comments

Comments

@kolaente
Copy link

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

I've been using the purify library to sanitize html content. Once I added pre and code tags to the list of allowed html elements, the swoole process crashed. I'll try to pin it to where the problem was caused but didn't have any luck so far.

  1. What did you expect to see?

Sanitized html output.

  1. What did you see instead?

Swoole worker process crash, error message in the logs:

[2023-06-28 16:46:55 #30.0]	WARNING	Server::check_worker_exit_status(): worker(pid=146, id=10) abnormal exit, status=0, signal=11
  1. What version of Swoole are you using (show your php --ri swoole)?
root@2114b38e8450:/var/www# php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 5.0.3
Built => Jun 26 2023 00:31:00
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
http2 => enabled
json => enabled
pcre => enabled
zlib => 1.2.11
brotli => E16777225/D16777225
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

I'm using swoole with Laravel Octane.

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
  • OS: Docker (uname says Linux 6.1.34 #1-NixOS SMP PREEMPT_DYNAMIC Wed Jun 14 09:15:34 UTC 2023 x86_64)
  • GCC_VERSION: 10.2.1 20210110
  • PHP_VERSION : 8.2.7
@NathanFreeman
Copy link
Member

I will test it later.

@NathanFreeman
Copy link
Member

@kolaente Hi.
I can not reproduce it.
Could you please use valgrind to track your program?
Have you used the xdebug extension?

@kolaente
Copy link
Author

kolaente commented Jul 4, 2023

Could you please use valgrind to track your program?

How do I do that?

Have you used the xdebug extension?

I didn't use it.

@NathanFreeman
Copy link
Member

NathanFreeman commented Jul 10, 2023

Sorry, I hase made a mistake, use gdb to track your program.

ps aux | grep swoole

图片

gdb attach 651337

And now executing your code until trigger the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants