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

Segmentation fault in server_queuereader (d=0x5555557b29f0) at server.c:875 #368

Closed
iain-buclaw-sociomantic opened this issue Jul 10, 2019 · 2 comments · Fixed by #370
Closed

Comments

@iain-buclaw-sociomantic
Copy link
Contributor

The notable part of the config is the ssl bit.

cluster graphite
    fnv1a_ch
        127.0.0.1:2103=test proto tcp
            transport plain ssl
    ;

statistics
    submit every 5 seconds
    reset counters after interval
    send to graphite
    ;

match *
    send to graphite
    ;

I think in fixing #351, there's a couple logic bug still present.

if ((self->transport & ~0xFFFF) == W_SSL) {
        int rv;
        z_strm *sstrm;

        if (self->transport == W_SSL) { /* just SSL, nothing else */
                sstrm = self->strm;
        } else {
                sstrm = self->strm->nextstrm;
        }

The config syntax transport ssl is no longer valid, ssl is always extending another protocol, in this case, self->transport == (W_PLAIN | W_SSL), so the second condition is always false, but we need it to be true for plain ssl.

@iain-buclaw-sociomantic
Copy link
Contributor Author

There is also a segfault when the relay is listening with plain ssl too, this might be related.

listen
    type linemode
            transport plain ssl cert.pem
        127.0.0.1:2103 proto tcp
    ;

Segfault happens inside the ssl library.

#0  0x00007ffff753c970 in SSL_get_rbio () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#1  0x00007ffff753c9b8 in SSL_set_bio () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#2  0x00007ffff753cb9f in SSL_set_fd () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#3  0x000055555555db3c in dispatch_addconnection (sock=sock@entry=11, lsnr=0x7ffff7f81068) at ../dispatcher.c:682
#4  0x000055555555e02e in dispatch_runner (arg=0x55555578f680) at ../dispatcher.c:1108
#5  0x00007ffff66096db in start_thread (arg=0x7ffff5c18700) at pthread_create.c:463
#6  0x00007ffff633288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@grobian
Copy link
Owner

grobian commented Jul 11, 2019

nice catch!

grobian added a commit that referenced this issue Jul 11, 2019
Add a dual-mode test setup where two relays talk to each other to verify
traffic flowing through.  The first test is SSL-based, but this needs
extending such that all modes are tested.  Question is if we can, since
Travis won't have SSL enabled everywhere.

Issue: #368
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

Successfully merging a pull request may close this issue.

2 participants