Open stromnet opened 4 years ago
I'm unable to reproduce the crash with the test case you've provided. What version of Nchan are you using?
This was trigged with nchan 1.2.6 from 4a4e42967fd37c1cb57e2142632f6180dee49253, and nginx 1.17.6. I manage to repeat it every time.
The actual output from above was from MacOS, but I've originally discovered the issue on a Linux build (in docker container).
I slapped together a more minimal Dockerfile (the full one builds with openresty and other stuff), I can reproduce it there as well:
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS base_image
RUN microdnf update && \
microdnf install pcre zlib curl libgcc gcc \
make \
git \
pcre-devel \
zlib-devel tar patch perl && \
microdnf clean all
ARG NGINX_VERSION=1.17.6
ARG NCHAN_VERSION=1.2.6
ARG NGINX_URL='http://nginx.org/download'
ARG NGINX_PREFIX=/opt/nginx
ARG NCHAN_URL='https://github.com/slact/nchan/archive'
WORKDIR /src
RUN curl -o /src/nginx-$NGINX_VERSION.tar.gz $NGINX_URL/nginx-$NGINX_VERSION.tar.gz
RUN curl -Lfo /src/nchan-$NCHAN_VERSION.tar.gz $NCHAN_URL/v$NCHAN_VERSION.tar.gz
WORKDIR /build
RUN tar xzf /src/nginx-$NGINX_VERSION.tar.gz --strip-components=1 && \
mkdir -p nchan && tar xzf /src/nchan-$NCHAN_VERSION.tar.gz --strip-components=1 -C ./nchan
RUN ./configure \
--with-cc-opt=-Wno-error \
--prefix=$NGINX_PREFIX \
--add-module=./nchan/ \
&& make -j$(nproc) \
&& make install
RUN echo "\
worker_processes 3; \
daemon off; \
error_log /dev/stdout debug;\
events {\
worker_connections 100;\
}\
http {\
server {\
listen 80;\
server_name localhost;\
location =/sub {\
nchan_subscriber;\
nchan_channel_id \$arg_id;\
nchan_channel_id_split_delimiter ",";\
}\
\
location ~ /channel_events/(.+) {\
nchan_subscriber;\
nchan_channel_group meta;\
nchan_channel_id \$1;\
}\
}\
}\
" > /opt/nginx/conf/nginx.conf
WORKDIR /opt/nginx
CMD ./sbin/nginx -c conf/nginx.conf
EXPOSE 80
docker run --rm -it -p 80:80 nginx-nchan-test
curl localhost:80/sub -v
The first run it actually didn't reproduce, but on the second it did.
On latest release:
when sending
GET /sub
withoutid
in querystring and the following config options are present:This crashes the worker. Minimal reproduce config:
Full output: