25 Aug, 2009, Banner wrote in the 1st comment:
Votes: 0
I am thinking this occurred because the list was not initialized. How would one go about doing such?

Tue Aug 25 17:17:55 2009 :: Loading Accounts

Program received signal SIGSEGV, Segmentation fault.
0xb7e75c77 in std::_List_node_base::hook () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0xb7e75c77 in std::_List_node_base::hook () from /usr/lib/libstdc++.so.6
#1 0x08089e83 in std::list<acc_char_data*, std::allocator<acc_char_data*> >::_M_insert (this=0x8d31ff0, __position={_M_node = 0x8d31ff0}, __x=@0xbf85880c)
at /usr/include/c++/4.3/bits/stl_list.h:1342
#2 0x08089eba in std::list<acc_char_data*, std::allocator<acc_char_data*> >::push_back (this=0x8d31ff0, __x=@0xbf85880c) at /usr/include/c++/4.3/bits/stl_list.h:876
#3 0x08086cd4 in add_acc_char (acc=0x8d31ff0, name=0x837f1e8 "Banner", pending=false, newbie=false) at accounts.cpp:433
#4 0x08087056 in fread_account (fp=0x8d31e88) at accounts.cpp:161
#5 0x08087445 in load_accounts () at accounts.cpp:252
#6 0x08135b6c in boot_db (fCopyOver=false) at db.cpp:929
#7 0x08120cbf in main (argc=2, argv=0xbf8599a4) at comm.cpp:262
(gdb) frame 5
#5 0x08087445 in load_accounts () at accounts.cpp:252
252 fread_account( fp );
(gdb) frame 4
#4 0x08087056 in fread_account (fp=0x8d31e88) at accounts.cpp:161
161 add_acc_char( acc, string, FALSE, FALSE );
(gdb) frame 3
#3 0x08086cd4 in add_acc_char (acc=0x8d31ff0, name=0x837f1e8 "Banner", pending=false, newbie=false) at accounts.cpp:433
433 acc->playerList.push_back(ch);
(gdb)


std::list< ACC_CHAR_DATA *> playerList;
ACC_CHAR_DATA *pending;
char *host;
char *name;
25 Aug, 2009, David Haley wrote in the 2nd comment:
Votes: 0
How are you creating the "acc" structure? (Presumably, it's an ACCOUNT_DATA or something?)
25 Aug, 2009, Banner wrote in the 3rd comment:
Votes: 0
David Haley said:
How are you creating the "acc" structure? (Presumably, it's an ACCOUNT_DATA or something?)
Yes. It's not in a class or initalized with new or anything.
25 Aug, 2009, David Haley wrote in the 4th comment:
Votes: 0
Well, how are you creating it then? Are you creating the ACCOUNT_DATA using malloc? (which is what CREATE uses) If so, you need to create it using 'new', which means deleting it using 'delete'.
25 Aug, 2009, Banner wrote in the 5th comment:
Votes: 0
Yeah, using CREATE. What is the syntax then? std::list< ACC_CHAR_DATA *> playerList = new; or something?

EDIT: Or just create account with new?

/*
* Read one account from file, assign memory to it, append to global
* list of accounts.
*/
void fread_account( FILE *fp )
{
char buf[ MAX_STRING_LENGTH ];
char *word;
bool fMatch;
ACCOUNT_DATA *acc = NULL;

// CREATE( acc, ACCOUNT_DATA, 1 );

acc = new ACCOUNT_DATA;
for( ;; )
{


Seems to have done the trick. It booted and I logged into my accounts successfully.
25 Aug, 2009, David Haley wrote in the 6th comment:
Votes: 0
Any data structure that contains classes must be created and freed using new/delete. So you would be allocating the account itself with new, not the list.
0.0/6