[MYSQL] Crash in parse_object after reading triggers for mobs

From: Artovil (artovil@arcanerealms.org)
Date: 11/10/01


Hello,

I run a CircleMUD 3.0 bpl 18 on a Unix machine with Linux 2.2.19.  I have
lately been converting all my loading and saving to MySQL and things are
working just fine.  I ran into a problem when I put in assignments of DG
Triggers on mobs.  It assigns these OK as far as I know, but then it
crashes when it loops over another query set, extra descriptions for objects.

This problem doesn't directly relate to Circle in that sense.  So, if
anybody familiar with DG Scripts, CircleMUD, and partly with MySQL, could
help me out I would be delighted to send along in-depth snippets of
affected code as well as a full backtrace.

In short, the query itself and the loop of the rows in the recordset works,
the mud crashes in the loading of object exdescs if I call
dg_read_trigger();  It doesn't crash on or in dg_read_trigger(), but
afterwards, so I presume it has something to do with CREATE() or perhaps
pointers?

----------------------void parse_mobile()---------------------------
...
   while ((trigger_row = mysql_fetch_row(assigns)))  {
     /*
      * Something goes wrong here when it assigns the trigger to the mob,
      * the mud SIGSEGV's on parse_object at db.c:1637
      * #0  parse_object (object_row=0x823d7b8, extradescs=0x8260c28,
affects=0x81c7cb8, vnum=106) at db.c:1637
      * #1  0x809a6c6 in object_boot_query (content=0x823d710,
extradescs=0x8260c28, affects=0x81c7cb8, triggers=0x81c3b78, znum=1)
      *    at db.c:1111
      * #2  0x809a5f4 in object_index_boot (index=0x823b688,
content=0x823d710) at db.c:1085
      * #3  0x8099dc3 in index_boot (mode=2) at db.c:865
      * #4  0x8098b09 in boot_world () at db.c:353
      * #5  0x8098dc0 in boot_db () at db.c:442
      * #6  0x8092a09 in init_game (port=9000) at comm.c:489
      * #7  0x809269f in main (argc=4, argv=0xbffff9a4) at comm.c:381
      */
     dg_read_trigger(trigger_row, &mob_proto[i], MOB_TRIGGER);
   }
...
----------------------void parse_mobile()---------------------------

I had a backtrace in my comments there...  If I just comment out the line
with dg_read_trigger, it works just fine.  It passes the row instead of a
file, and this works fine elsewhere, so I suppose it is something else,
since I have it set up like a lot of other functions that work.

I changed nothing in dg_read_trigger except for passing a MySQL row instead
of a file pointer, and not scanning a line, but just doing: vnum =
atoi(trigger_row[0]); other than that, it is just the same.

If you can help, please email me!  Thank you!

Kind regards,
/Torgny

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST