Author Topic: fluffos BUG  (Read 7872 times)

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
fluffos BUG
« on: June 16, 2008, 10:09:13 PM »
fluffos 2.11,binaries.c,Line 348
if (check_times(mtime, SIMUL_EFUN) <= 0) {
        if (comp_flag)
            debug_message("out of date (simul_efun newer).\n");
        fclose(f);
        FREE(buf);
        return OUT_OF_DATE;
    }
always return OUT_OF_DATE

and I found load_binary() was not working,the mudos can not load compiled .b files from hard disk.

Offline percussor

  • Acquaintance
  • *
  • Posts: 5
    • View Profile
Re: fluffos BUG
« Reply #1 on: June 17, 2008, 01:38:34 AM »

and I found load_binary() was not working,the mudos can not load compiled .b files from hard disk.


Permission issue maybe?

Perc

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #2 on: June 23, 2008, 11:42:15 AM »

and I found load_binary() was not working,the mudos can not load compiled .b files from hard disk.


Permission issue maybe?

Perc
I have enogh right to read and write file.

In options.h,#define BINARIES
If we can load binary code and run binary code correctly,the mud lib can run fast.
but fluffos can't load binary code correctly.

Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: fluffos BUG
« Reply #3 on: June 24, 2008, 07:32:17 AM »
Do you set the path to the driver binary correctly in your config files? IIRC it'll never load binary files if that path is incorrect

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #4 on: June 24, 2008, 09:26:34 AM »
Do you set the path to the driver binary correctly in your config files? IIRC it'll never load binary files if that path is incorrect
fluffos can save binary file correctly,and can load binary file,but can't run mud lib correctly.

Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: fluffos BUG
« Reply #5 on: June 24, 2008, 05:03:15 PM »
so ehm, what's the actual problem then?

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #6 on: July 11, 2008, 03:42:11 AM »
It's a bug.

Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: fluffos BUG
« Reply #7 on: July 11, 2008, 08:33:04 AM »
what is? sorry but
 
fluffos can save binary file correctly,and can load binary file,but can't run mud lib correctly.

doesn't tell me what your problem is at all!

how is your mud lib not running correctly, what's happening? what is the bug you are seeing?

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #8 on: July 11, 2008, 09:01:55 AM »
Fluffos can save compiled file to .b.
Example,master.c=>master.b
In binaries.c,there are two function save_binary and load_binary,the save_binary can save compiled file to .b,
and load_binary function can load .b from disk.
/* BINARIES: define this to enable the 'save_binary' pragma.
 *   This pragma, when set in a program, will cause it to save a
 *   binary image when loaded, so that subsequent loadings will
 *   be much faster.  The binaries are saved in the directory
 *   specified in the configuration file.  The binaries will not
 *   load if the LPC source or any of the inherited or included
 *   files are out of date, in which case the file is compiled
 *   normally (and may save a new binary).
 *
 *   In order to save the binary, valid_save_binary() is called
 *   in master.c, and is passed the name of the source file.  If
 *   this returns a non-zero value, the binary is allowed to be
 *   saved.  Allowing any file by any wizard to be saved as a
 *   binary is convenient, but may take up a lot of disk space.
 */

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: fluffos BUG
« Reply #9 on: July 11, 2008, 09:14:46 AM »
Alexamud, I think folks understand you think there is a bug.

It seems that you are not giving them enough information to help fix it, though.

Code: [Select]
but fluffos can't load binary code correctly.
Please explain how you know this is true, including error messages if any.

-Crat

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #10 on: July 11, 2008, 09:27:17 AM »
The driver can't load master object and simul function object.

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: fluffos BUG
« Reply #11 on: July 11, 2008, 09:32:22 AM »

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #12 on: July 11, 2008, 09:33:49 AM »
I traced and debug fluffos,in interpret.c,I traced to ffbn_recurse2,when drive call this function,the function return error value.

Offline alexamud

  • Acquaintance
  • *
  • Posts: 12
    • View Profile
Re: fluffos BUG
« Reply #13 on: July 11, 2008, 09:39:47 AM »
binaries.c(mudos v22pre11)
/* function names */
    for (i = 0; i < (int) p->num_functions_defined; i++) {
   fread((char *) &len, sizeof len, 1, f);
   ALLOC_BUF(len + 1);
   fread(buf, sizeof(char), len, f);
   buf[len] = '\0';
   p->function_table.name = make_shared_string(buf);
    }
    sort_function_table(p);

    /* line numbers */
    fread((char *) &len, sizeof len, 1, f);
    p->file_info = (unsigned short *) DXALLOC(len, TAG_LINENUMBERS, "load binary");
    fread((char *) p->file_info, len, 1, f);
    p->line_info = (unsigned char *)&p->file_info[p->file_info[1]];

but in fluffos  sort_function_table function have not been declared.so function table index is incorrect.

Offline hamlet

  • Acquaintance
  • *
  • Posts: 46
    • View Profile
Re: fluffos BUG
« Reply #14 on: July 11, 2008, 09:50:58 AM »
Have you tried turning off binaries (and recompiling, of course) and making sure your master.c and simul_efun.c load?

I don't normally use binaries, but I just turned them on and everything seems to be working just fine, even master.c and simul_efun.c

Is your valid_save_binary() in master.c existent and sensical?

Have you tried excluding master.c and simul_efun.c from being saved in the above function?  This shouldn't be necessary, but it could provide a clue as to what's wrong.