Author Topic: Flffos 3.0 alpha8.0  (Read 4994 times)

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Flffos 3.0 alpha8.0
« on: April 14, 2015, 10:36:18 PM »
Long overdue release , download at

https://github.com/fluffos/fluffos/releases/tag/fluffos-3.0-alpha8.0

It's been a while! Way too many commits has been cumulating and the release was delayed by a big code base reorganization.

Here are a few highlights:

1) Huge code base reorganization. Driver code are now organized into 3 groups: base (include shared utils), VM (include LPC VM & compilers) , Packages. There are some driver centric (like networking code) left in the root tree. The VM part is also a bit of a mess, but future effort will continue to refactor them.

There has been a huge amount of header inclusion cleanups, view src/base/README and src/vm/README for details.

BUILD process is also improved, representing a much cleaner build executing structure.

2) Driver now implements a "gametick msec" config option, which defaults to 100ms, HEARTBEAT_INTERVAL compile options is removed, and a new runtime option "heartbeat interval msec" is added.

3) Driver now implements a concept of game-tick, On every game-tick, driver starts a new scheduling round, that includes executing pending call_out, heartbeat and various game related routines. At the end of this round, driver sleeps for "one gametick". Gametick is guaranteed not overlap. (also know as fixed interval scheduling, not fixed rate scheduling) .

With this concept, everything except of networking event in the driver is now executed wrt gametick time, call_out now schedules callback in game time, heartbeat now executes on the boundary of gametick time.

4) In older FluffOS, the driver would periodically attempt to "catch up" with realworld time by executing multiple round of callout/heartbeats in a for loop. This has been removed. call_out_walltime() has been added so LPC can still schedule a event occurring at realworld time. ( A typical usage of this is that you want a call executing every 3600 second in real world time, not the game time).

4) Both call_out and call_out_walltime now accept LPC_FLOAT instead of LPC_INT. the unit is still second, call_out's execution will be rounded to multiply of "gametick msec" , while call_out_walltime can schedule on msec resolution.

For example, if gametick msec is 100ms, callout(..., 0.5) means it will execute callback 5 gameticks later.

6) Continuing rewriting manually managed array to STL containers , reducing memory fragmentation.

Cheers.

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #1 on: April 16, 2015, 03:28:22 PM »
Hello!
First, thank you for your hard work with fluffos!

I want to test this version with my mud :D, but I can't compile it. :(

This it my output:
Code: [Select]
Preparing to build standard driver ...
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for bison... bison
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking whether C++ compiler accepts -D_GNU_SOURCE... yes
checking whether C++ compiler accepts -fno-omit-frame-pointer... yes
checking whether C++ compiler accepts -iquote.... yes
checking whether the linker accepts -flto... yes
checking whether C++ compiler accepts -flto... yes
checking whether the linker accepts -flto... (cached) yes
checking whether the linker accepts -pie... yes
checking whether C++ compiler accepts -fPIE... yes
checking whether the linker accepts -pie... (cached) yes
checking whether the linker accepts -rdynamic... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... yes
checking for arpa/nameser.h... yes
checking for netdb.h... yes
checking for resolv.h... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether sys/types.h defines makedev... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking arpa/telnet.h usability... yes
checking arpa/telnet.h presence... yes
checking for arpa/telnet.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking for inttypes.h... (cached) yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for netdb.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/crypt.h usability... no
checking sys/crypt.h presence... no
checking for sys/crypt.h... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/rusage.h usability... no
checking sys/rusage.h presence... no
checking for sys/rusage.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking values.h usability... yes
checking values.h presence... yes
checking for values.h... yes
checking whether byte ordering is bigendian... no
checking for int64_t... yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking for struct stat.st_rdev... yes
checking for uint32_t... yes
checking size of int... 4
checking size of char *... 8
checking for library containing sqrt... none required
checking for library containing crypt... -lcrypt
checking for library containing malloc... none required
checking for library containing backtrace... none required
checking for int64_t... (cached) yes
checking for pid_t... (cached) yes
checking for size_t... (cached) yes
checking for struct stat.st_rdev... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... yes
checking for sighandler_t... yes
checking for error_at_line... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for working strtod... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for libevent >= 2.0... yes
checking how to run the C preprocessor... gcc -E
checking if zlib is wanted... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing timer_create... -lrt
checking for library containing pthread_create... none required
configure: creating ./config.status
config.status: creating Makefile
config.status: creating configure.h
[CC] tools/make_func.autogen.o
[Linking] tools/make_func.autogen
[Generating cc.h]
[Generating Packages]
[Generating applies table...]
[Generating efun tables...]
[Generating grammar...]
[Generating options_def...]
***************** Configuration completed **************
Compiling FluffOS 3.0-alpha8.1 (fluffos-3.0-alpha7.4-191-ga8e6b4c) as driver for x86_64-unknown-linux-gnu.

INSTALL: '/usr/bin/install -c'
INSTALL DIR: '/home/xxxxx/develmud/driver/fluffos/bin'
BISON: 'bison'
COMPILE: 'g++ -march=native -Wall -Wextra -Wformat-security -Wno-char-subscripts -Wno-sign-compare -Wno-return-type -Wno-unused-parameter -Wno-missing-field-initializers -Wno-overloaded-virtual -Wno-non-virtual-dtor -fdiagnostics-show-option -fmessage-length=0 -funsigned-char -fwrapv -fPIE -O3 -DNDEBUG -g -std=c++11 -D_GNU_SOURCE -fno-omit-frame-pointer -iquote. -flto   -I/usr/include '
LINK: 'g++ -march=native -Wall -Wextra -Wformat-security -Wno-char-subscripts -Wno-sign-compare -Wno-return-type -Wno-unused-parameter -Wno-missing-field-initializers -Wno-overloaded-virtual -Wno-non-virtual-dtor -fdiagnostics-show-option -fmessage-length=0 -funsigned-char -fwrapv -fPIE -O3 -DNDEBUG -g -std=c++11 -D_GNU_SOURCE -fno-omit-frame-pointer -iquote. -flto  -flto -pie -rdynamic -L/usr/lib'

LIBEVENT: '-levent', '', ''

Make Version:
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
Este es software libre; consulte en el código fuente las condiciones de copia.
NO hay garantía; ni siquiera para MERCANTIBILIDAD o EL CUMPLIMIENTO DE
ALGN PROPSITO PARTICULAR.

 Este programa fue construido para x86_64-pc-linux-gnu
Compiler Version:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
Edit Makefile if this is not what you want

Otherwise, type 'make' to build FluffOS, then 'make install'.
$ make
[CC] base/internal/hash.o
[CC] vm/internal/applies_table.autogen.o
[CC] vm/internal/efuns.autogen.o
[CC] vm/internal/apply.o
[CC] vm/internal/eval.o
[CC] vm/internal/master.o
[CC] vm/internal/otable.o
[CC] vm/internal/posix_timers.o
[CC] vm/internal/simul_efun.o
[CC] vm/internal/simulate.o
vm/internal/simulate.cc: In function void shutdownMudOS(int):
vm/internal/simulate.cc:58:7: warning: unused variable i [-Wunused-variable]
vm/internal/simulate.cc: In function object_t* object_present2(const char*, object_t*):
vm/internal/simulate.cc:746:7: error: isdigit was not declared in this scope
vm/internal/simulate.cc: In function void destruct_object(object_t*):
vm/internal/simulate.cc:911:9: warning: unused variable i [-Wunused-variable]
vm/internal/simulate.cc: In function void error_handler(char*):
vm/internal/simulate.cc:1890:10: warning: unused variable default_error_message [-Wunused-variable]
make: *** [vm/internal/simulate.o] Error 1

Any external package should I install or configure some option?
I test with my own local_options and with a copy of options.h and same result.

Thank you very much!!!!!

PD: Sorry my english
« Last Edit: April 16, 2015, 03:38:44 PM by DarKWateR »

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #2 on: April 17, 2015, 12:29:15 AM »
vm/internal/simulate.cc:746:7: error: isdigit was not declared in this scope


it seems there is some missing includes. I'm pushing to the HEAD , please do a git pull to test again.

Thanks

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #3 on: April 17, 2015, 12:48:58 AM »
Hello, now is ok, but in make says:
./base/internal/rc.h:18:15: error: expected unqualified-id before numeric

I test from mobile, do you need more info?

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #4 on: April 17, 2015, 01:21:11 AM »
that error was for my local_options (NUM_EXTERNAL_CMDS), now is ok.
i will continue tests

Thank you!
« Last Edit: April 17, 2015, 01:23:21 AM by DarKWateR »

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #5 on: April 17, 2015, 01:22:50 AM »
Yes, I will submit something to warn about that.

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #6 on: April 17, 2015, 01:23:33 AM »
[CC] vm/internal/base/array.o
In file included from vm/internal/base/array.cc:11:0:
./vm/internal/base/old_qsort_inc.h:14:17: fatal error: std.h: No existe el fichero o el directorio

I modifed that line with base/std.h.


Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #7 on: April 17, 2015, 01:26:18 AM »
To the end of compile, doesn't move binaries to ../bin?

PD: Sorry for messages flood!

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #8 on: April 17, 2015, 05:29:12 AM »
Hello again, i found a strange bug in loading phase of driver.
The problem is in files loaded in preload appy in master.c.

I tested with testsuite:
  - I create /etc/preload file with a line: /preload_error.
  - The content of this file is:
Code: [Select]
void create(){
int *test = ({ 1, 2, 3 }), *test2;
test2 = test;
time_expression{
error(sprintf("Error in preload: %O\n", test));
};
}
  - I modify master.c for use debug_message instead of write in preload function when error != 0.
  - I executes 'make test' and output is:
Code: [Select]
Loading preload files ...
/preload_error...

Error *Error in preload: 46954146329472
 when loading /preload_error
Instead of array it prints a number.
  - If a remove time_expression o equal operation, the output is:
Code: [Select]
Loading preload files ...
/preload_error...

Error *Error in preload: ({ /* sizeof() == 3 */
  1,
  2,
  3
})
 when loading /preload_error

If i add this test in crashes test files, work ok (use the array correctly) in my first test, but I can't assure that thats going to happen
« Last Edit: April 17, 2015, 05:33:47 AM by DarKWateR »

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #9 on: April 18, 2015, 01:23:58 AM »
Thanks for the reporting, the old_qsort_incl.h bug is fixed.

so the issue was with time_expression?   It will make sprintf function incorrectly? can you add a test for it? (This release hasn't really touch that)

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #10 on: April 18, 2015, 05:02:51 AM »
sorry, if i add a test file for testsuite, it doesn't fail :(

I tested this code in three locations in master.c:
Code: [Select]
  string err;
  int *arr = ({ 1, 2 , 3 }), *arr2;
  string error;
  arr2=arr;
  time_expression{
    error = catch(arr[0] = 9);
    debug_message("Error: " + error);
    debug_message(sprintf("Value of arr: %O.", arr));
  };
  • epilog: It fails. Error in catch: *Cannot index value of type 'int'. Value of arr: 47979561128224.
  • preload: It fails. Error in catch: *Cannot index value of type 'int'. Value of arr: 47979561128224.
  • flag apply: OK. Value of arr: ({ 9, 2 , 3}) .
In this example, if I add debug_message(sprintf("%O", arr)) before time_expression line, the arr value is ok.
It changes in time_expression.

If i change code to this then works ok:
Code: [Select]
  string err;
  int *arr = ({ 1, 2 , 3 }), *arr2;
  string error;
  arr2=arr;

  // With this line, works ok.
  arr=arr;

  time_expression{
    error = catch(arr[0] = 9);
    debug_message("Error: " + error);
    debug_message(sprintf("Value of arr: %O.", arr));
  };

Another OK example:
Code: [Select]
  int *arr = ({ 1, 2 , 3 }), *arr2;
  string error;
  arr2=arr;
  debug_message(sprintf("%O", arr));
  time_expression{
    error = catch(arr[0] = 9);
    debug_message("Error: " + error);
    debug_message(sprintf("Value of arr: %O.", arr));
  };

  // With this line, works ok.
  arr[0]=10;


Is very very strange bug.
I don't know whick could be the problem.

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #11 on: April 18, 2015, 06:05:51 AM »
have you tested in the alpha7.4 that  it works fine?  Can you also run valgrind to make sure there aren't any memory issue?

From the look of it, it seems to be at least a bug in the compile process, where time_expression is not dealing correctly.. but that must have existsed in 7.4 as well.

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #12 on: April 18, 2015, 06:33:20 AM »
hello, i made same tests in previous version (alpha 8.0) and is ok.

I've tried compare previous and new version, but for now i don't found nothing.

i don't have at this moment 7.4, but in my mud we used 7.4 and 8.0alpha (previous version) and is ok.

i nerver used valgrind, could you help me ?
« Last Edit: April 18, 2015, 06:35:14 AM by DarKWateR »

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #13 on: April 18, 2015, 08:36:09 AM »
You need to let me know the exact revision  (which should print out  on driver start like this :

快意恩仇 (fluffos-3.0-alpha7.4-176-gd5b1679) starting up on Linux/x86-64 - Sat Apr 18 21:34:56 2015

I can then go and diff what has changed here.

As for valgrind runs, you can see 

https://fluffos.github.io/bug.html

Offline DarKWateR

  • BFF
  • ***
  • Posts: 104
    • View Profile
Re: Flffos 3.0 alpha8.0
« Reply #14 on: April 18, 2015, 10:22:48 AM »
this version:

Initializing internal stuff ....
----------------------------------------------------------------------------
Testsuite (fluffos-3.0-alpha7.4-196-g7052b58-dirty) starting up on Linux/x86-64 - Sat Apr 18 17:22:00 2015