rdstate() is dumping core on Linux 2.6.x kernel

Discussion in 'C Programming' started by lkpaturi, Oct 8, 2010.

  1. lkpaturi

    lkpaturi

    Joined:
    Oct 8, 2010
    Messages:
    1
    Likes Received:
    0
    Hi,

    I build my executable on a 2.4.x kernel and was running as expected on the same system. Where as when I tried to run it on 2.6.x kernel it was dumping core :-x :-x and the stack trace shows rdstate()

    My code check the stream status before calling socket read() function. I'm using

    ios *x;

    if((x->rdstate() & ios::badbit) != 0)
    {
    return 0;
    }
    else
    {
    ....
    ...
    sock->read(...)
    ..
    ..
    }


    When I observed there is diff in rdstate() output on 2.4.x & 2.6.x linux servers


    On 2.6.x kernel
    ios --> rdstate():0 badbit:4 failbit:2 eofbit:1 ==> for good conditon

    ios --> rdstate():192 badbit:4 failbit:2 eofbit:1 ==> for bad condition


    On 2.4.x kernel
    ios --> rdstate():172 badbit:4 failbit:2 eofbit:1 ==> for good condition

    ios --> rdstate():14 badbit:4 failbit:2 eofbit:1 ==> for bad condition





    I'd like to know whey rdstate() is returning diff values for diff kernels. Any help would be greatly appreciated
     
    lkpaturi, Oct 8, 2010
    #1
    1. Advertisements

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. Ganesh Gella
    Replies:
    5
    Views:
    1,673
    John Harrison
    Jul 14, 2003
  2. Gonçalo Rodrigues
    Replies:
    0
    Views:
    381
    Gonçalo Rodrigues
    Nov 18, 2004
  3. ken

    prevent dumping core file?

    ken, Jan 20, 2004, in forum: C Programming
    Replies:
    10
    Views:
    1,039
    Dan Pop
    Jan 22, 2004
  4. Leland Woodbury

    Python 2.2.x core dumping

    Leland Woodbury, Apr 15, 2004, in forum: Python
    Replies:
    1
    Views:
    344
    Jeff Epler
    Apr 15, 2004
  5. yogesh
    Replies:
    3
    Views:
    764
    Kenny McCormack
    Feb 12, 2006
  6. rkk

    trim function dumping core

    rkk, Dec 6, 2006, in forum: C Programming
    Replies:
    31
    Views:
    1,318
  7. Zach

    why is it dumping core?

    Zach, Jan 25, 2009, in forum: C Programming
    Replies:
    19
    Views:
    713
    nick_keighley_nospam@hotmail.com
    Jan 27, 2009
  8. Ala Qumsieh

    Perl core dumping - possible bug?

    Ala Qumsieh, Sep 12, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    155
    Anno Siegel
    Sep 14, 2005
Loading...