You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andrew Stitcher (JIRA)" <qp...@incubator.apache.org> on 2010/04/29 02:19:50 UTC

[jira] Reopened: (QPID-2186) Windows - "vector iterator not dereferencable"

     [ https://issues.apache.org/jira/browse/QPID-2186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Stitcher reopened QPID-2186:
-----------------------------------

      Assignee: Andrew Stitcher  (was: Steve Huston)

I don't think half  this fix can do anything as the condition tasks.empty() is checked at the very top of the while loop and nothing else can be removing tasks from the tasks priority queue but this loop itself.

    Monitor::ScopedLock l(monitor);
    while (active) {
        if (tasks.empty()) {
            monitor.wait();
        } else {
            intrusive_ptr<TimerTask> t = tasks.top();
            tasks.pop();
            assert(!(t->nextFireTime < t->sortTime));
....
             if (t->cancelled) {
...
                continue;
            } else if(Duration(t->nextFireTime, start) >= 0) {

>>>> HERE tasks.empty() COULD BE TRUE

                continue;
            } else {
                // If the timer was adjusted into the future it might no longer
                // be the next event, so push and then get top to make sure
                // You can only push events into the future
                t->sortTime = t->nextFireTime;
                tasks.push(t);
            }
           if (!tasks.empty())
                monitor.wait(tasks.top()->sortTime);
        }
    }

so the second !tasks.empty() is a tautology as we already know it must be true - every path which ends with the task popped has a continue and the path that leads there pushes it just before.

However as noted above it could be empty at the first tasks.top() though - I'd like to take a short look at this.

> Windows - "vector iterator not dereferencable"
> ----------------------------------------------
>
>                 Key: QPID-2186
>                 URL: https://issues.apache.org/jira/browse/QPID-2186
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Client
>         Environment: XP-SP2, VS2008, Boost_1_35, Python 3.0.1, ruby 1.8.6 and working copy revision: 828034
>            Reporter: Larry Roloson
>            Assignee: Andrew Stitcher
>             Fix For: 0.7
>
>         Attachments: screenshot-1.jpg
>
>
> i have the direct listener built from the examples, and it throws the above exception when there is no broker running at the supplied address. It does connect and get messages when the broker is running. 
> The call stack when the exception occurs: 
> ---------------------------------------------- 
> >	msvcp90d.dll!std::_Debug_message(const wchar_t * message=0x00fa7e28, const wchar_t * file=0x00fa7798, unsigned int line=98)  Line 24	C++ 
>  	qpidcommond.dll!std::_Vector_const_iterator<boost::intrusive_ptr<qpid::sys::TimerTask>,std::allocator<boost::intrusive_ptr<qpid::sys::TimerTask> > >::operator*()  Line 98 + 0x14 bytes	C++ 
>  	qpidcommond.dll!std::_Vector_iterator<boost::intrusive_ptr<qpid::sys::TimerTask>,std::allocator<boost::intrusive_ptr<qpid::sys::TimerTask> > >::operator*()  Line 340	C++ 
>  	qpidcommond.dll!std::vector<boost::intrusive_ptr<qpid::sys::TimerTask>,std::allocator<boost::intrusive_ptr<qpid::sys::TimerTask> > >::front()  Line 790 + 0x24 bytes	C++ 
>  	qpidcommond.dll!std::priority_queue<boost::intrusive_ptr<qpid::sys::TimerTask>,std::vector<boost::intrusive_ptr<qpid::sys::TimerTask>,std::allocator<boost::intrusive_ptr<qpid::sys::TimerTask> > >,std::less<boost::intrusive_ptr<qpid::sys::TimerTask> > >::top()  Line 207	C++ 
>  	qpidcommond.dll!qpid::sys::Timer::run()  Line 114 + 0xf bytes	C++ 
>  	qpidcommond.dll!`anonymous namespace'::runRunnable(void * p=0x101e63d0)  Line 32 + 0xf bytes	C++ 
>  	msvcr90d.dll!_callthreadstartex()  Line 348 + 0xf bytes	C 
>  	msvcr90d.dll!_threadstartex(void * ptd=0x0116b6d8)  Line 331	C 
>  	kernel32.dll!7c80b729() 
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	boost_program_options-vc90-mt-gd-1_35.dll!003a0043() 
>  	msvcr90d.dll!_mbsnbcpy_l(unsigned char * dst=0x00730063, const unsigned char * src=0x00000073, unsigned int cnt=6619236, localeinfo_struct * plocinfo=0x00610066)  Line 57 + 0x3d bytes	C++ 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org