exception problem: basic_string::_S_construct NULL not valid

Discussion in 'C++' started by utab, Jun 7, 2006.

  1. utab

    utab Guest

    Dear all,

    I am using boost::lexical_cast to convert string values to real values.
    (Please read the rest).

    My question is not related to boost usage or asking a question related
    to that. When I use that template, an exception is thrown

    terminate called after throwing an instance of 'std::logic_error'
    what(): basic_string::_S_construct NULL not valid
    Aborted

    I could not figure out the reason for this exception. I guess there is
    something related to the construction of the strings that I am trying
    to read from a .dat file.

    Can you please give me information on this exception if possible.

    Regards,
     
    utab, Jun 7, 2006
    #1
    1. Advertising

  2. utab

    Ian Collins Guest

    utab wrote:
    > Dear all,
    >
    > I am using boost::lexical_cast to convert string values to real values.
    > (Please read the rest).
    >
    > My question is not related to boost usage or asking a question related
    > to that. When I use that template, an exception is thrown
    >
    > terminate called after throwing an instance of 'std::logic_error'
    > what(): basic_string::_S_construct NULL not valid
    > Aborted
    >
    > I could not figure out the reason for this exception. I guess there is
    > something related to the construction of the strings that I am trying
    > to read from a .dat file.
    >
    > Can you please give me information on this exception if possible.
    >

    Well it looks very much like an attempt to initialise a string with a
    null pointer.

    Try setting a breakpoint in your debugger on the std::logic_error
    constructor(s).

    --
    Ian Collins.
     
    Ian Collins, Jun 7, 2006
    #2
    1. Advertising

  3. utab

    utab Guest

    Re: exception problem: basic_string::_S_construct NULL not valid


    > Try setting a breakpoint in your debugger on the std::logic_error
    > constructor(s).
    >
    > --
    > Ian Collins.


    So I tried that before but could not figure out anyway but I will check
    that again.

    Regards,
     
    utab, Jun 7, 2006
    #3
  4. utab

    utab Guest

    Re: exception problem: basic_string::_S_construct NULL not valid


    > Try setting a breakpoint in your debugger on the std::logic_error
    > constructor(s).
    >
    > --
    > Ian Collins.


    But, putting breakpoints on the std::logic_error, this is specific but
    do you know how to do that in DDD.

    Regards
     
    utab, Jun 7, 2006
    #4
  5. utab

    mlimber Guest

    Re: exception problem: basic_string::_S_construct NULL not valid

    utab wrote:
    > Dear all,
    >
    > I am using boost::lexical_cast to convert string values to real values.
    > (Please read the rest).
    >
    > My question is not related to boost usage or asking a question related
    > to that. When I use that template, an exception is thrown
    >
    > terminate called after throwing an instance of 'std::logic_error'
    > what(): basic_string::_S_construct NULL not valid
    > Aborted
    >
    > I could not figure out the reason for this exception. I guess there is
    > something related to the construction of the strings that I am trying
    > to read from a .dat file.
    >
    > Can you please give me information on this exception if possible.


    Please post a minimal but complete sample that demonstrates the
    problem. Then we can help you better. (See this FAQ:
    http://parashift.com/c -faq-lite/how-to-post.html#faq-5.8.)

    Cheers! --M
     
    mlimber, Jun 7, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    27,520
    Mike Schilling
    Mar 29, 2006
  2. Paul Pedriana

    unit test for basic_string?

    Paul Pedriana, Oct 18, 2003, in forum: C++
    Replies:
    1
    Views:
    471
    Paul Pedriana
    Nov 1, 2003
  3. Jin
    Replies:
    0
    Views:
    404
  4. Dylan Nicholson
    Replies:
    14
    Views:
    3,225
    Brian McKeever
    Feb 17, 2004
  5. G Fernandes
    Replies:
    9
    Views:
    627
    DHOLLINGSWORTH2
    Feb 27, 2005
Loading...

Share This Page