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

Setting idlers via penctl causing pen segmentation fault #51

Open
ifduyue opened this issue Mar 24, 2019 · 1 comment
Open

Setting idlers via penctl causing pen segmentation fault #51

ifduyue opened this issue Mar 24, 2019 · 1 comment

Comments

@ifduyue
Copy link
Contributor

ifduyue commented Mar 24, 2019

Running pen: -u nobody -frdd -C 20000 -b 10 8080 127.0.0.1:8000
In another terminal: penctl 127.0.0.1:20000 idlers 1
And then segmentation fault.

$ gdb ./pen
(gdb)  r -u nobody -frdd -C 20000 -b 10 8080 127.0.0.1:8000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
2019-03-24 20:29:59: read_cfg((null))
2019-03-24 20:29:59: open_listener(20000)
2019-03-24 20:29:59: pen_aton(0.0.0.0, 0x7fffffffd990)
2019-03-24 20:29:59: family = 2
socktype = 1
protocol = 6
addrlen = 16
sockaddr = 6414032
canonname = (null)
2019-03-24 20:29:59: socket returns 8, socket_errno=0
2019-03-24 20:29:59: local address=[0.0.0.0:20000]
2019-03-24 20:29:59: open_listener(8080)
2019-03-24 20:29:59: pen_aton(0.0.0.0, 0x7fffffffd990)
2019-03-24 20:29:59: family = 2
socktype = 1
protocol = 6
addrlen = 16
sockaddr = 6413296
canonname = (null)
2019-03-24 20:29:59: socket returns 9, socket_errno=0
2019-03-24 20:29:59: local address=[0.0.0.0:8080]
2019-03-24 20:29:59: init(2, 0x7fffffffdfd8); port = 8080
2019-03-24 20:29:59: Before: conns = (nil), connections_max = 0, clients = (nil), clients_max = 0
2019-03-24 20:29:59: expand_conntable(500)
2019-03-24 20:29:59: After: conns = 0x61e180, connections_max = 500, clients = 0x7ffff7f89010, clients_max = 2048
2019-03-24 20:29:59: server[0] = 127.0.0.1:8000
2019-03-24 20:29:59: n = 2, address = 127.0.0.1, pno = 8000, maxc1 = 0, hard = 0, weight = 0, prio = 0, proto = 1
2019-03-24 20:29:59: pen_aton(127.0.0.1, 0x61dd38)
2019-03-24 20:29:59: family = 2
socktype = 1
protocol = 6
addrlen = 16
sockaddr = 6413856
canonname = (null)
2019-03-24 20:29:59: pen 0.35.0 starting
2019-03-24 20:29:59: servers:
2019-03-24 20:29:59:  0 127.0.0.1:8000:0:0:0:0
2019-03-24 20:29:59: Run as user nobody
2019-03-24 20:29:59: epoll_create1 returns 10
2019-03-24 20:29:59: epoll_event_add(fd=9, events=65536)
2019-03-24 20:29:59: epoll_event_ctl(fd=9, events=65536, op=1)
2019-03-24 20:29:59: epoll_event_add(fd=8, events=65536)
2019-03-24 20:29:59: epoll_event_ctl(fd=8, events=65536, op=1)
2019-03-24 20:29:59: mainloop()
2019-03-24 20:29:59: epoll_event_arm(fd=9, events=65536)
2019-03-24 20:29:59: epoll_event_ctl(fd=9, events=65536, op=3)
2019-03-24 20:29:59: epoll_event_wait()
2019-03-24 20:30:02: epoll_wait returns 0
2019-03-24 20:30:02: After event_wait()
2019-03-24 20:30:02: epoll_event_fd(revents=0x7fffffffdd84)
2019-03-24 20:30:02: epoll_event_wait()
2019-03-24 20:30:03: epoll_wait returns 1
2019-03-24 20:30:03: After event_wait()
2019-03-24 20:30:03: epoll_event_fd(revents=0x7fffffffdd84)
2019-03-24 20:30:03: event_fd returns fd=8, events=65536
2019-03-24 20:30:03: check_control_socket()
2019-03-24 20:30:03: match_acl_ipv4(0, 16777343)
2019-03-24 20:30:03: do_cmd(idlers 1, 0x404320, 0x7fffffffcd1c)
2019-03-24 20:30:03: epoll_event_fd(revents=0x7fffffffdd84)
2019-03-24 20:30:03: incrementing connections_used to 1 for connection 0
2019-03-24 20:30:03: store_conn: conn = 0, downfd = -1, connections_used = 1
2019-03-24 20:30:03: Trying server 0 for connection 0 at time 1553430603
2019-03-24 20:30:03: socket returns 11, socket_errno=0
2019-03-24 20:30:03: Connecting to 127.0.0.1
2019-03-24 20:30:03: Family: AF_INET
2019-03-24 20:30:03: Port: 8000
2019-03-24 20:30:03: Address: 127.0.0.1
2019-03-24 20:30:03: connect (upfd = 11) returns -1, errno = 115, socket_errno = 115
2019-03-24 20:30:03: epoll_event_add(fd=11, events=131072)
2019-03-24 20:30:03: epoll_event_ctl(fd=11, events=131072, op=1)
2019-03-24 20:30:03: Pending connect to server 0
conns[0].client = -1
conns[0].server = -3
2019-03-24 20:30:03: Setting server 0 for client -1

Program received signal SIGSEGV, Segmentation fault.
0x000000000040e79f in try_server (index=0, conn=conn@entry=0) at server.c:424
424             clients[client].server = index;
Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.3.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-37.el7_6.x86_64 libcom_err-1.42.9-13.el7.x86_64 libselinux-2.5-14.1.el7.x86_64 openssl-libs-1.0.2k-16.el7.x86_64 pcre-8.32-17.el7.x86_64 sssd-client-1.16.2-13.el7_6.5.x86_64 zlib-1.2.7-18.el7.x86_64
(gdb) list
419                     close(upfd);
420                     return 0;
421             }
422             conns[conn].server = index;
423             DEBUG(2, "Setting server %d for client %d", index, client);
424             clients[client].server = index;
425             current = index;
426             conns[conn].upfd = upfd;
427             fd2conn_set(upfd, conn);
428             return 1;
(gdb) p client
$1 = -1
@ifduyue
Copy link
Contributor Author

ifduyue commented Mar 24, 2019

Another bug relating to idlers -- can't reduce idlers.
Reproduce:

export CONTROL_PORT=20000 
seq 1000 | xargs -I{} -P1 -- bash -c 'penctl 127.0.0.1:$CONTROL_PORT idlers ${RANDOM:0:2}'
seq 3 | xargs -I{} -P1 -- bash -c 'penctl 127.0.0.1:$CONTROL_PORT idlers;sleep 2'

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

1 participant