[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Debugging bufferevent_openssl (filtered)



On Thu, May 24, 2012 at 8:18 PM, Diwaker Gupta <diwaker@xxxxxxxxxxxxxx> wrote:
> On Thu, Mar 29, 2012 at 11:45 AM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
>> On Thu, Mar 29, 2012 at 2:31 PM, Diwaker Gupta <diwaker@xxxxxxxxxxxxxx> wrote:
>>> I'm using a filtered bufferevent to do SSL over another bufferevent.
>>> Occasionally, my application crashes. Unfortunately, neither
>>> EVUTIL_SOCKET_ERROR nor bufferevent_get_openssl_error are useful.
>>>
>>> The former says "Undefined error: 0" (via evutil_socket_error_to_string)
>>>
>>> The latter gives "error:00000000:lib(0):func(0):reason(0)"
>>>
>>> The application crashes trying to do a bufferevent_write() on the
>>> filtered be, with a segmentation fault. The remote just sees a
>>> connection reset by peer. If I disable the filtered bufferevent,
>>> things work just fine. Is there some other debug information that I
>>> can extract from libevent?
>>
>> The most useful thing here would probably be a stack trace with as
>> much debugging information as possible.  Additionally, running under a
>> debugging tool like valgrind (or the local equivalent on your
>> platform) might give you useful information.
>
> Quick update/question. In my event callback, (what & BEV_EVENT_ERROR)
> is true. However, neither BEV_EVENT_READING nor BEV_EVENT_WRITING seem
> to be set. As I mentioned earlier, EVUTIL_SOCKET_ERROR is not helpful
> either. I'll send a sample track trace shortly, but in the meantime,
> if I see a BEV_EVENT_ERROR but none of the other flags are set, any
> suggestions on what might be happening?

Maybe you can check if other events besides BEV_EVENT_ERROR are set?
Like BEV_EVENT_EOF or BEV_EVENT_TIMEOUT? And are you sure the bufev
ptr passed to bufferevent_write() is valid? Thats the most likely
cause of generating segv's mostly.

Cheers,
Tommy
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.