Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:24:37+00:00 2026-06-08T12:24:37+00:00

I’m doing c++ and the code is giving me these errors: new size of

  • 0

I’m doing c++ and the code is giving me these errors:

   new size of the done 64
   getting next item to do (0x90b9c0 0x90bab0 0x90be40 0)
   vector wait size = 0
   running size = 1
   done size = 64
   done this align #27# #26# Gorilla_gorilla_2
   setting the done tuple to 1 to get them next
   new size of the done 65
   getting next item to do (0xbff3897200000000 0xbfda1b75f84c0030 0x30 17)
   vector wait size = 18446744073709551615
   running size = 1
   done size = 65
   getting next item to do (0xbfdcc288867fc50b 0x31 0x1 1)
   /usr/local/netbeans-7.2rc1/ide/bin/nativeexecution/dorun.sh: line 33:  8234   
   Segmentation     
   fault      (core dumped) sh "${SHFILE}"

And I wonder how can I get more details of the seg fault, like the line that caused it, to fix it, thanks.

Edit:

  bool tuple_compare(boost::tuple< ppa::Node*, ppa::Node*, ppa::Node*, bool> tuple)
{



  if( boost::get< 3 >( tuple) == true)
 {
          return true;
 }
  else
  {
      return false;
  }
 }


void threaded_function(Model_factory &mf, ppa::Node *root)
 {
  try {


  while(true)
  {
      boost::mutex::scoped_lock lock(result_mutex);

      if(wait.empty())
      {

          lock.unlock();
          break;
      }
      else {
          lock.unlock();
          lock.lock();
          if(!running_jobs.empty())
          {
              cout << "vector wait size = " << wait.size() << endl;
              cout << "running size = " << running_jobs.size() << endl;
              cout << "done size = " << done.size() << endl;
              boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool> tuple = running_jobs.back();
              running_jobs.pop_back();
              lock.unlock();
              ppa::Node *father = boost::get<0>(tuple);
              ppa::Node *first_son = boost::get<1>(tuple);
              ppa::Node *second_son = boost::get<2>(tuple);
              bool flag = boost::get<3>(tuple);
              father->start_alignment_new(&mf);
              lock.lock();
              cout << "done this align " << father->get_name() << " " << first_son->get_name() << " " << second_son->get_name()
                      << endl;
              cout << "setting the done tuple to 1 to get them next" << endl;
              done.push_back(tuple);
              cout << "new size of the done " << done.size() << endl;
              lock.unlock();



          }
          else {
              lock.unlock();
              lock.lock();
              cout << "getting next item to do " << wait.back() << endl;
              boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool> run = wait.back();
              running_jobs.push_back(run);
              wait.pop_back();
              lock.unlock();
          }
      }
    }
  }
  catch (boost::lock_error& le)
  {
      cout << "error this " << le.what() << endl;
  }
  }

Main:

 int main(int argc, char *argv[])
 {
clock_t t_start=clock();
ppa::Node* parent;
ppa::Node* left;
ppa::Node* rigth;
ppa::Node* check_root;
/*

…

boost::tuple<ppa::Node*, ppa::Node*, ppa::Node*, bool>  tuple = dups.back();
    ppa::Node *n = boost::get<0>(tuple);
     //cout << "creating waiting thread" << endl;
   // g.create_thread( boost::bind(wait_function));
    cout << "creating other threads" << endl;
 for ( int i = 0; i < 5; ++i )
 {
   cout << "making  thread " << i << endl;
    g.create_thread( boost::bind( threaded_function, boost::ref(mf), boost::ref(n) ));
}



 cout << g.size() << endl ;
// wait for them
// sleep(15);
 g.join_all();     

I’m pretty sure it comes form this part that is the new I have added.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:24:40+00:00Added an answer on June 8, 2026 at 12:24 pm

    Bad code, too many locks and unlocks, mutex has a lock method no need to use shared lock.lock()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a reasonable size flat file database of text documents mostly saved in
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.