Search the web
Sign In
New User? Sign Up
pokersource · Poker Source
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
seg fault issue   Message List  
Reply | Forward Message #97 of 355 |
Hey all I'm getting a segfault problem now. I tried to put in the
eval.c sample into my app with some changes and it processes find but
then the next call to the app it seg faults

Here is the relavant code

extern "C" {
#include "poker_defs.h"

#include "inlines/eval.h"
#include "inlines/eval_low.h"
#include "deck_std.h"
}



void serverInfo::endHand() {
int gNCards;
CardMask gCards;
int gLow=0;
int gHighLow=0;

HandVal handval;
LowHandVal low;


gNCards = 0;
CardMask_RESET(gCards);

cout << "i need to find a WINNER!" << endl;
for (int i=0; i<9; i++) {
ptrType2 Cur = sitDownList->returnNode(i);
if (Cur != NULL) {
if (Cur->status == 1) {


CardMask_SET(gCards, Cur->holdCards[0]);
++gNCards;
CardMask_SET(gCards, Cur->holdCards[1]);
++gNCards;
CardMask_SET(gCards, this->communityCards[0]);
++gNCards;
CardMask_SET(gCards, this->communityCards[1]);
++gNCards;
CardMask_SET(gCards, this->communityCards[2]);
++gNCards;
CardMask_SET(gCards, this->communityCards[3]);
++gNCards;
CardMask_SET(gCards, this->communityCards[4]);
++gNCards;

if (!gLow) {
handval = Hand_EVAL_N(gCards, gNCards);
//cout << handval << endl;
//printf("%s \n", handval);
//printf("%s: ", Deck_maskString(gCards));
//HandVal_print(handval);
char *str;
//QString *str;
//str->append("bla");
HandVal_toString(handval, str);
cout << str << endl;
//printf("\n");
}
}
}
}

cout << "i am done!" << endl;
}

its something with HandVal_toString that is causing it to error. For
example my server right now is a gui client and once the clients
finish their hand.. if i place my house over the server window it
crashes.. cause it wants to hand a x11Event.. so i tried to make it
text based and the next incoming client it seg faults.. so its
something to do with HandVal_toString.


If i just use HandVal_print() it works just fine.. I'm stumped here..

thanks for the help again
Mike




Tue Aug 31, 2004 2:56 pm

mzupan21
Offline Offline
Send Email Send Email

Forward
Message #97 of 355 |
Expand Messages Author Sort by Date

Hey all I'm getting a segfault problem now. I tried to put in the eval.c sample into my app with some changes and it processes find but then the next call to...
mzupan21
Offline Send Email
Aug 31, 2004
2:57 pm

... [...] ... HandVal_toString assumes that there is already space backing its second argument. If you 'str = malloc(REASONABLE_NUMBER);' or 'char...
Michael Hunter
muck_nutz
Offline Send Email
Aug 31, 2004
6:16 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help