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 7767293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:38:27+00:00 2026-06-01T15:38:27+00:00

I get an exception while executing following piece of code bool FieldValueMessage::Get(const std::string &field,

  • 0

I get an exception while executing following piece of code

bool FieldValueMessage::Get(const std::string &field, double & value)
{
    string text;
    if(Get(field,text))
    {
        std::stringstream sstr(text);
        sstr >> value;
        if(sstr.fail())
            return false;
        else
            return true;
    } 
    else 
    {
        return false;
    }        
} 

Get function is as below

bool HashMapMessage::Get(const std::string &field, std::string & value)
{
    Field2Value::iterator i = f2v.find(field);
    if(i==f2v.end()){
        return false;
    } else {
        value = i->second;
        return true;
    }
}

caller of Get function. I don’t see any issue here.

for(i=quote_fields.begin(),j=0;i!=quote_fields.end();i++,j++){
    if (msg->Get((*i).c_str(),tmp)){
        if(tmp>0 && x->staging_data[j+1]!=tmp){
            x->staging_data[j+1] = tmp;
            has_update = true;
        }
    }
}

Call Stack is

ntdll.dll!_RtlpCoalesceFreeBlocks@16()  + 0x35 bytes    
ntdll.dll!_RtlFreeHeap@12()  + 0x91f bytes  
msvcr90.dll!_free()  + 0xcd bytes   
msvcp90.dll!std::locale::`scalar deleting destructor'()  + 0x19 bytes   
msvcp90.dll!std::ios_base::_Ios_base_dtor()  + 0x39 bytes   
msvcp90.dll!std::basic_stringstream<char,std::char_traits<char>,std::allocator<char> >::`vbase destructor'()  + 0x19 bytes  
asapGeneric.dll!asap::FieldValueMessage::Get(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & field="ASK", double & value=0.055000000000000000)  Line 33 + 0x17 bytes   C++
_hdf.pyd!asap::TradeAndQuoteNormalizer::ParseQuote(asap::FieldValueMessage * msg=0x027194c0, asap::TAQ * taq=0x02716908)  Line 84 + 0x36 bytes  C++

value of field is “ASK”.

This code has been running fine without any issues, but now i am getting exception on “return true” statement.

when i debug though the program… sstr.fail() returns false. The pointer comes on return true; statement. At this point when i do a single step, suddenly I get Unhandled exception: Access violation reading from location xxxxx. I have never seen an exception on a return statement. What is incorrect in this case? This c++ program is called from a python script.

  • 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-01T15:38:29+00:00Added an answer on June 1, 2026 at 3:38 pm

    Answer to above post is really an collections of comments on the question. more than one replies helped me find the solution. The problem in above case was that I did not initialize the staging data properly. It was expected to be an array of size same as quote_fields but it was initialized to length 1. So first element was updated correctly but during the second element in quote_fields array is bring read, i was getting above exception.
    Apparantly exception is not raised as soon as i try to access incorrect element. Exception is comin from stringstream destructor. As per Retired Ninja, the exception is not raised immediately but only until heap tries to merge 2 free blocks at a later point as shown in the call stack.

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

Sidebar

Related Questions

I have this following piece of code: public TimestampedRowStorage GetTimestampedRowStorage(string startTime, string endTime, long
While executing daoMethod() I am getting the following exception: java.sql.SQLException: Procedure or function 'Get_Books'
I get a java.lang.outOfMemoryError exception, while writing a big file to the servletOutputStream. Every
When I get an exception in code called by Silverlight whilst in debug mode
I have the following code but I get an error on this line userSpinner.setAdapter(adapter);
Very simple question: suppose I have the following js/jquery code doSomething(); $.get(url, callback); doSomethingElse();
I get the following error while accessing the Sitecore Training Website. Server Error in
I'm executing this code: //doc = Jsoup.connect(data[0].getURL()).get(); Document doc = Jsoup.connect(url).post(); and am getting
I want to get exception of page load, but still have not results on
I get this exception on my Windows 7 64bit in application running in VS

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.