apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Phillips <ryan-...@trolocsis.com>
Subject C++ and APR_RING Problems
Date Fri, 15 Jul 2005 01:17:36 GMT
I have declared a couple structures that I would like be rings and
instantiate them as so:

Constructor():
APR_RING_INIT(&sock_ring, sock_queue_data_T, link);

Global Header():
struct sock_queue_data_T {
    APR_RING_ENTRY(sock_queue_data_T) link;

    APR::Socket *reply_sock;
    bool is_important;
    bool want_reply;
};

within the class:
APR_RING_HEAD(sock_ring_T, sock_queue_data_T);
        struct sock_ring_T sock_ring;


-----------

I'm using gcc 3.3.5 and 3.4.4 with the following warning:

src/socketmanager.cc:95: warning: invalid access to non-static data
member `sock_queue_data_T::link' of NULL object
src/socketmanager.cc:95: warning: (perhaps the `offsetof' macro was used
incorrectly)

The code works for a short period of time and then the application
aborts with: *** glibc detected *** double free or corruption (fasttop):
0x0808b1c8 ***

Does anyone have any advice?

Regards,
Ryan

Mime
View raw message