Nick Mathewson | 4 Oct 2010 19:43

Re: 14k vprintf evbuffer on solaris

On Wed, Sep 29, 2010 at 5:34 PM, Michael Herf <herf <at> pobox.com> wrote:
 [...]
> Has anyone else seen a failure case like this? (I'm going to dig in and see
> what I can find.)

I haven't seen this before, no.

One way to try to debug this would be to check would be to figure out
where, along the chain between you adding the data and the data
getting sent out via writev(), the data is getting lost.  Possible
places are:
 1) The data isn't getting added to the evbuffer.
 2) The data is getting added, but the bufferevent isn't delivering it.
 3) Data is getting added and bufferevent *should* be delivering it,
but for some reason the evhttp code is screwing everything up.

Another possible way to try to chase this down would be to use git
bisect to try to figure out what change broke this on opensolaris.

If these don't work, have an opensolaris vm I could try to use to
help, but I would need an example of a _minimal_ test program that
worked okay on (say) Linux, but failed on OpenSolaris.

hth,
--

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

(Continue reading)

Daniel Janzon | 4 Oct 2010 23:01
Picon

What was EV_PRI for in 1.4.12?

Hello,

I have some old code linked against libevent 1.4.12, but I want to
upgrade to the latest version. However, it didn't compile unless I
removed the EV_PRI bit in event_set. It doesn't seem to exist in later
code, I grepped for it. I was doing

event_set(..., EV_PRI | EV_PERSIST, ...)

but had to change to

event_set(..., EV_PERSIST, ...).

For some reason this seems to break it; the event doesn't get set.
Anyhow, my question to the list is what did the EV_PRI flag do?

The reason I don't post more code, and believe this is the problem is

(1) The EV_PRI only seems to be relevant for epoll, and the code
doesn't work when I try to use other event mechanisms.
(2) The other events work fine with the new libraries, it's just
events on this file descriptor that doesn't work.

I tried both 1.4.14b-stable and 2.0.7-rc.

All the best,
Daniel
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.
(Continue reading)

Nick Mathewson | 4 Oct 2010 23:19

Re: What was EV_PRI for in 1.4.12?

On Mon, Oct 4, 2010 at 5:01 PM, Daniel Janzon <janzon <at> gmail.com> wrote:
> Hello,
>
> I have some old code linked against libevent 1.4.12, but I want to
> upgrade to the latest version. However, it didn't compile unless I
> removed the EV_PRI bit in event_set. It doesn't seem to exist in later
> code, I grepped for it. I was doing
>
> event_set(..., EV_PRI | EV_PERSIST, ...)
>
> but had to change to
>
> event_set(..., EV_PERSIST, ...).
>
> For some reason this seems to break it; the event doesn't get set.
> Anyhow, my question to the list is what did the EV_PRI flag do?

Nothing whatsoever as far as I can tell; Libevent never defined it or
looked for it as far as I can tell.  Grep for it in the source for
libevent 1.4.12-stable, and it shouldn't be there.

In fact, AFAICT, no version of Libevent in the source repository has
ever contained the string "EV_PRI" :

[279]% git log -p origin/master | grep EV_PRI
[280]% git log -p origin/patches-1.4 | grep EV_PRI
[281]% git log -p origin/patches-1.3 | grep EV_PRI
[282]% git log -p origin/patches-1.2 | grep EV_PRI
[283]% git log -p origin/patches-1.1 | grep EV_PRI
[284]%
(Continue reading)

Tristan Wilson | 5 Oct 2010 00:17

Re: What was EV_PRI for in 1.4.12?

On 5/10/2010 8:19 AM, Nick Mathewson wrote:
> On Mon, Oct 4, 2010 at 5:01 PM, Daniel Janzon<janzon <at> gmail.com>  wrote:
>> Hello,
>>
>> I have some old code linked against libevent 1.4.12, but I want to
>> upgrade to the latest version. However, it didn't compile unless I
>> removed the EV_PRI bit in event_set. It doesn't seem to exist in later
>> code, I grepped for it. I was doing
>>
>> event_set(..., EV_PRI | EV_PERSIST, ...)
>>
>> but had to change to
>>
>> event_set(..., EV_PERSIST, ...).
>>
>> For some reason this seems to break it; the event doesn't get set.
>> Anyhow, my question to the list is what did the EV_PRI flag do?
>
> Nothing whatsoever as far as I can tell; Libevent never defined it or
> looked for it as far as I can tell.  Grep for it in the source for
> libevent 1.4.12-stable, and it shouldn't be there.
>
> In fact, AFAICT, no version of Libevent in the source repository has
> ever contained the string "EV_PRI" :
>
> [279]% git log -p origin/master | grep EV_PRI
> [280]% git log -p origin/patches-1.4 | grep EV_PRI
> [281]% git log -p origin/patches-1.3 | grep EV_PRI
> [282]% git log -p origin/patches-1.2 | grep EV_PRI
> [283]% git log -p origin/patches-1.1 | grep EV_PRI
(Continue reading)

Daniel Janzon | 5 Oct 2010 00:49
Picon

Re: What was EV_PRI for in 1.4.12?

> This is probably a modified version of libevent, libevent doesn't support
> PRI events, eg EPOLLPRI for epoll. Some drivers I was using use this event,
> so I had to modify my copy of 1.4.13-stable to support it. Someone at your
> end Daniel has probably done the same and if you just upgrade to the new
> version you will lose their modifications and you will no longer be able to
> get these priority events. I suggest diffing your source against a fresh
> copy of 1.4.12-stable to see the changes.

That must be so, I will do the diff tomorrow. Thank you both Tristan and Nick
for your quick and helpful replies, you saved me lots of headache.

All the best,
Daniel (from Sweden)
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Nick Mathewson | 6 Oct 2010 19:12

Re: evhttp_encode_uri() fails to escape certain characters

On Fri, Sep 24, 2010 at 4:21 PM, Bas Verhoeven <libevent <at> bserved.nl> wrote:
> Hello,
>
> While using 'evhttp_encode_uri()' to encode GET & POST fields (I hope this
> is the right function to use) I noticed that a lot of characters are not
> being escaped in the way I would expect them to be escaped.

Hi, all!  I'm trying to get a start on fixing http stuff and merging
http fixes.  First, though, I need to get up to speed on the evhttp
stuff myself.  This is a nice easy bug report, so I'll start out here.
 I'm going to say lots of confident-sounding stuff below, but please
take what I'm saying with a grain of salt and correct me when I go
wrong.

The first thing to figure out is, "what is evhttp_encode_uri
*supposed* to do?"  Unfortunately, the documentation isn't too
helpful.  All it says is,
/**
  Helper function to encode a URI.

  The returned string must be freed by the caller.

   <at> param uri an unencoded URI
   <at> return a newly allocated URI-encoded string
 */

Well, that makes no sense.  "URI-encoding" is a pretty well-defined
operation for individual parts of a URL, but it's not an operation you
can apply to an entire "unencoded URI" [*].  Unfortunately, the
documentation here implies that it takes a URI, which is nonsensical.
(Continue reading)

Clint Webb | 7 Oct 2010 09:04
Picon

Re: evhttp_encode_uri() fails to escape certain characters

On Thu, Oct 7, 2010 at 1:12 AM, Nick Mathewson <nickm <at> freehaven.net> wrote:
> On Fri, Sep 24, 2010 at 4:21 PM, Bas Verhoeven <libevent <at> bserved.nl> wrote:

> But what if somebody is saying something iffy like
>    asprintf(&query1, "q1=%s", v1);
>    asprintf(&query2, "q2=%s", v2);
>    encoded1 = evhttp_encode_uri(query1);
>    encoded2 = evhttp_encode_uri(query2);
>    asprintf(&url, "http://example.com?%s&%s", encoded1, encoded2);
> ?
>
> If they were relying on the previous broken behavior of
> evhttp_encode_uri(), changing it to do the right thing will break
> them.  Of course, their code is already broken if they were relying on
> evhttp_encode_uri() actually encoding + characters reliably, so
> they're not in good shape either way.
>
> I've looked through the first few pages of google codesearch results
> for evhttp_encode_uri, and not found anything that suggests someone is
> doing this broken-but-almost-working thing.
>
> So, time to go ahead and make this change?  The affected characters
> are "!$'()*+,/:= <at> "
>

Almost.  But keep in mind, that the value (the key as well actually)
should be encoded seperately, not as a single unit.   In your above
example, the = should get encoded and not exactly as you thought.

So if the data you are encoding happens to be "a=b+c", what would you
(Continue reading)

Marko Kreen | 12 Oct 2010 09:54
Picon

1.4 evdns: can have duplicate transaction ids

It seems libevent 1.4 evdns can issue duplicate transaction ids,
if the double id is first one in the list.

See attached patch for quick fix.

--

-- 
marko
Attachment (evdns.fix.diff): text/x-patch, 409 bytes
Ralph Castain | 12 Oct 2010 16:55
Favicon
Gravatar

How to get debug output

Hi folks

I apologize for the ignorance - I'm sure this is something simple that I'm overlooking.

I built libevent 2.0.7rc with the default configuration, so I did -not- specify --disable-debug. It is my
understanding that the debug code is therefore built. I have confirmed that this is the case.

I then have my code call event_enable_debug_mode prior to calling event_init. However, I never get any
debug output sent to my screen, even though I confirmed that I am calling event_assign, event_add, and
other libevent functions.

Any suggestions on what I'm doing wrong?
Ralph

***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.

Nick Mathewson | 12 Oct 2010 16:59

Re: How to get debug output

On Tue, Oct 12, 2010 at 10:55 AM, Ralph Castain <rhc <at> open-mpi.org> wrote:
> Hi folks
>
> I apologize for the ignorance - I'm sure this is something simple that I'm overlooking.
>
> I built libevent 2.0.7rc with the default configuration, so I did -not- specify --disable-debug. It is my
understanding that the debug code is therefore built. I have confirmed that this is the case.
>
> I then have my code call event_enable_debug_mode prior to calling event_init. However, I never get any
debug output sent to my screen, even though I confirmed that I am calling event_assign, event_add, and
other libevent functions.
>
> Any suggestions on what I'm doing wrong?
> Ralph

There are two debugging features here: event debugging mode, and the
verbose debug logs you're talking about.  Debug mode is a feature for
debugging your program; it turns on checks for incorrect uses of
events.  To get debugging output sent to stdout, rebuild with
"-DUSE_DEBUG" in the CPPFLAGS.

yrs,
--

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo <at> freehaven.net with
unsubscribe libevent-users    in the body.


Gmane