Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost-users Digest, Vol 3370, Issue 2
From: Brammert Ottens (Brammert.Ottens_at_[hidden])
Date: 2013-02-25 10:31:06


> Brammert Ottens
>
> Hi,
>
> I've had a closer look and I was too quick in dismissing your solution. however, the on_label_popped(cur_label) gets a const reference to the label. I've used a const_cast to remove the const (see code below), but now the code crashes when cleaning up the labels using deallocate. Any ideas on what could be wrong?
>
> template<class Label, class Graph>
> void QRCSPPVisitor::on_label_popped( const Label& label, const Graph& graph )
> {
> RCSPPVisitorData().IncrementLabelsPopped();
>
> if ( TimedOut() || GetMillis(StartTime()) > MaxMillis() )
> {
> this->SetTimedOut();
> const_cast<Label&>(label).b_is_dominated = true;
> }
> }

I think you can just change the parameter declaration to be a non-const
reference. Can you please check where the crash occurs and whatever
information you can get about the cause? Thanks.

-- Jeremiah Willcock

Hi,

The crash occurs in the final loop, where you are going over vec_vertex_labels. It crashes when calling l_alloc.deallocate( (*csi).get(), 1 );. We use the standard std::allocator. Unfortunately the code has been encapsulated into a much larger project, and the only information that I have is what windows gives me:

 Problem Event Name: APPCRASH
  Application Name: QServer_D64.exe
  Application Version: 2013.6.6145.0
  Application Timestamp: 512b792f
  Fault Module Name: KERNELBASE.dll
  Fault Module Version: 6.1.7601.18015
  Fault Module Timestamp: 50b8479b
  Exception Code: 40010006
  Exception Offset: 0000000000009e5d
  OS Version: 6.1.7601.2.1.0.256.1
  Locale ID: 1043
  Additional Information 1: 02d5
  Additional Information 2: 02d5a24c112729571ddd0daf5f60defb
  Additional Information 3: 563e
  Additional Information 4: 563e19c789cadcf1ddb48080eecb0875

Removing the const from Label doesn't help, the code still crashes. So if you can put a visitor that allows to jump out of the loop prematurely that would be immensely helpful! Thanks already for the quick help.

Brammert


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net