28 - Direct mode crashes when using default exchange

Reported by Alex McGregorAlex McGregor (1224423281|%O ago)

To reproduce, client opens connection in direct mode and publishes first to any named exchange and second to the default exchange, passing NULL as the exchange name argument. This causes an abort.

Here is the backtrace from the core dump:

#0  0xb7e45d2a in strcmp () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7e45d2a in strcmp () from /lib/tls/i686/cmov/libc.so.6
#1  0x0804cb84 in amq_client_session_dp_lookup (self=0x836a688, name=0x0, type=1) at amq_client_session.c:5337
#2  0x0804e778 in amq_client_session_basic_publish (self=0x836a688, content=0x837a700, ticket=0, exchange=0x0, routing_key=0x0,
    mandatory=0, immediate=0) at amq_client_session.c:2901
#3  0x0804b63e in main (argc=779185505, argv=0x65726964) at testit.c:30
(gdb) select 1
(gdb) print name
$1 = 0x0
(gdb)

This WireAPI program reproduces the problem:

#include "asl.h"
#include "amq_client_connection.h"
#include "amq_client_session.h"

int
main (int argc, char *argv [])
{
    amq_client_connection_t
        *connection = NULL;             //  Current connection
    amq_client_session_t
        *session = NULL;                //  Current session
    amq_content_basic_t
        *content = NULL;                //  Message content
    icl_longstr_t
        *auth_data;                     //  Authorisation data

    icl_system_initialise (argc, argv);
    auth_data = amq_client_connection_auth_plain ("guest", "guest");
    connection = amq_client_connection_new ("localhost", "/", auth_data, "test", 0, 1000);
    icl_longstr_destroy (&auth_data);
    if (connection)
        session = amq_client_session_new (connection);
    if (session) {
        connection->direct = TRUE;
        content = amq_content_basic_new ();

        //  Publish to existing exchange
        amq_client_session_basic_publish (session, content, 0, "amq.direct", NULL, FALSE, FALSE);
        //  Now publish to default exchange - crashes
        amq_client_session_basic_publish (session, content, 0, NULL, NULL, FALSE, FALSE);
        amq_content_basic_unlink (&content);
    }
    amq_client_session_destroy (&session);
    amq_client_connection_destroy (&connection);
    icl_system_terminate ();
    return (0);
}

Attachments:

No files attached to this page.

Comments

Add a New Comment

Edit | Files | Tags | Print

rating: +1+x

Who's following this issue?

pieterhpieterh
martin_sustrikmartin_sustrik
CybariteCybarite
Watch: site | category | page

Submitted by Alex McGregorAlex McGregor

Use one of these tags to say what kind of issue it is:

  • issue - a fault in the software or the packaging or the documentation.
  • change - a change or feature request.

Use one of these tags to say what state the issue is in:

  • open - a new, open issue.
  • closed - issue has been closed.
  • rejected - the issue has been rejected.

Use one of these tags to say how urgent the issue is:

  • fatal - the issue is stopping all work.
  • urgent - it's urgent.

All open

89 - multi-threaded client connection failure (17 Nov 2012 16:28) [open]
87 - Zyre returns incomplete XML (26 Apr 2010 08:15) [open]
86 - SFL 'random(num)' macro is wrong in sfl.h (31 Mar 2010 09:23) [open]
85 - Zyre does not start on Solaris (23 Mar 2010 01:29) [open]
84 - OpenAMQ JMS - AMQTopic constructor use HEADER name and class instead of TOPIC (28 Jan 2010 17:04) [open]
83 - WireAPI: How to 'override' signal handlers? (14 Jan 2010 17:33) [open]
82 - Opf Classes Cannot Accept Default Values With Characte (06 Jan 2010 09:34) [open]
81 - AMQP Topic Exhange Routing (29 Dec 2009 00:21) [open]
80 - OpenAMQ reports malformed frame on 0-9-1 queue.unbind (20 Nov 2009 12:33) [open]
79 - AMQ Server crashing if subscribe topic is set as #.# (30 Oct 2009 06:11) [open]
78 - Error while publishing the messages faster (30 Oct 2009 05:57) [open]
77 - Tuning for latency (28 Oct 2009 16:47) [open]
76 - New user forum (28 Oct 2009 11:29) [change open]
74 - Simulaneous connect/disconnect from multiple threads crashes (03 Sep 2009 15:32) [open]
73 - Topic Exchange not sending a message to XXX.* (25 Aug 2009 21:10) [open]
72 - amq_content_basic_new() causes seg fault if not connected to broker (12 Aug 2009 23:50) [open]
71 - zyre bugs (06 Aug 2009 09:33) [open]
69 - OpenAMQ and Zyre (15 Jul 2009 11:27) [open]
68 - Change names of max and min source code macros (10 Jul 2009 16:52) [open]
67 - Server crash when multiple consumers ack on shared queue (26 Jun 2009 11:35) [open]

page 1 of 212next »

Most recent