apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@haxent.com.br>
Subject Re: apr_brigade_create() produces a corrupt brigade
Date Thu, 26 Oct 2006 22:02:35 GMT
Graham Leggett wrote:
> Hi all,
> 
> I have spent a few hours trying to get to the bottom of this, and and 
> truly stuck.
> 
> When creating a new brigade inside a filter, I do this:
> 
> r = f->r;
> dobj->tmpbb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
> 
> This runs fine - a brigade is created, containing a single bucket.

Where/how did you inserted the bucket ? This brigade is empty.

> The trouble is, the bucket inside the brigade is corrupt - it's name 
> consists of random bytes, and the pointers to its methods are either 
> NULL or corrupt bytes.

Are you sure the bucket is there ?

> Obviously any attempt to read the contents of this brigade causes a 
> segfault, although I can happily add other buckets to this brigade first.

Are you sure the brigade is not empty ?

> Is there are magic initialisation that needs to be done before a brigade 
> creation is possible?
> 

As long as the pool and the bucket alloc list are valid, the brigade is
valid.

--
Davi Arnaut

Mime
View raw message