[DGD] Bug

Blain blain20 at gmail.com
Thu Feb 16 16:21:47 CET 2017


Feb 16 09:15:28 ** [Core] ** Log Manager started.
Feb 16 09:15:28 ** [Core] ** Error manager started.
Feb 16 09:15:28 ** [Core] ** Object manager starting...
Feb 16 09:15:28 ** [Core] Preload: /usr/System/dat/core/preload.txt
Feb 16 09:15:28 ** [Core] /usr/System/lib/xfun/charset
Feb 16 09:15:28 ** ({1|"/usr/System/def/auto.h", "inherit
"/usr/System/lib/auto";\n" })
Feb 16 09:15:28 ** */usr/System/pub/def/AUTO1 [1]: Syntax error
Fatal error: bad pointer in m_free
Aborted (core dumped)


public nomask
mixed include_file(string compiled, string from, string path)
{
  int len;
  string file, text;

  if(!KERNEL() && !SYSTEM())
    return null;
  if(sscanf(compiled, "/kernel/%*s") != 0)
    return path;
  debug(({"include",DEBUG_VERBOSE}), "Include: "+compiled+"; from:
"+from+"; path: "+path+"\n");
  if(sscanf(path, "/def/system/%s", file) == 1)
    path = "/usr/System/pub/def/"+file;
    /* fallthrough */
  else if(from == "/def/std.h" && path == "/def/AUTO")
    return "/usr/System/pub/def/auto.h";
  else if(from == "/usr/System/pub/def/auto.h"
   && path == "/usr/System/pub/def/AUTO1")
  {
    string *ret, domain, rest;

    if(sscanf(compiled, "/usr/%s/%s", domain, rest) == 2)
    {
      ret = ({});
      /* Add local auto.h */
      if(file_exists(file = "/usr/"+domain+"/def/auto.h"))
        ret += ({ file });
      if(domain != "System")
        ret += ({ "#include \"/usr/System/pub/def/system.h\"\n" });

      /* Add System pub/auto or local auto */
      if(rest == "lib/auto")
      {
        if(domain != "System")
          ret += ({ "inherit \"/usr/System/pub/lib/auto\";\n" });
      }
      else if(file_exists((file = "/usr/"+domain+"/lib/auto")+".c"))
        ret += ({ "inherit \""+file+"\";\n" });
      else
      {
        if(domain != "System")
          ret += ({ "inherit \"/usr/System/pub/lib/auto\";" });
      }
debug_message(sprint(ret)+"\n");
      return ret;
    }
    return path;
  }

  len = strlen(path);
  if(sscanf(path, "%*s.c/") != 0 || sscanf(path, "%*s.h/") != 0
    || len < 2 || (path[len - 2 ..] != ".h" && path[len - 2 ..] != ".c"))
    error("Invalid include file: "+path);

  return path;
}





On Thu, Feb 16, 2017 at 2:23 AM, Felix A. Croes <felix at dworkin.nl> wrote:

> bart at wotf.org wrote:
>
> > From my reading, it was the unintended recursive calls to create()
> running
> > without rlimits causing the crashes.
>
> I didn't quote that part in my email, but the crash is due to a bad
> pointer in m_free().  So this is not an infinite recursion issue.
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list