b-020916

ldmud-3.2.9/src/bugs/b-020916 · 13.5 KB

From the archive ldmud-329.tar.gz

Download the archive   « Back to the archive contents

Short: Segemntation fault in save_object()
From: Gnomi
Date: Mon, 16 Sep 2002 01:31:44 +0200
Type: Bug
State: New
Driver: 3.2.9-dev.454
See also: b-020826, b-020916-files/

Irreproducible for me so far.

----------------------------------------------------------------------------
Date: Mon, 16 Sep 2002 01:31:44 +0200
From: Gnomi <Gnomi@UNItopia.bera.rus.Uni-Stuttgart.DE>
To: Lars Duening <lars@bearnip.com>
Cc: UNItopia Administration <mudadm@UNItopia.bera.rus.Uni-Stuttgart.DE>
Subject: Segmentation fault

Hallo!

Der LDMud 3.2.9 dev545 hat ein Core produziert:

Core was generated by in/driver --define UNItopia --define
COLLAPSIBLE_ENCUMBRANCE --define DYNAMIC_'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /usr/lib/libcrypto.so.0.9.6...done.
Loaded symbols for /usr/lib/libcrypto.so.0.9.6
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0  build_block (ptr=0xc1d46a4, size=5908) at smalloc.c:1841
1841	    *(ptr+size-1) = size;        /* copy the size information */
(gdb) bt
#0  build_block (ptr=0xc1d46a4, size=5908) at smalloc.c:1841
#1  0x080c80a6 in large_free (ptr=0xc1d8a20 "ø\205\035\f<\212\035\f\f\004")
    at smalloc.c:2408
#2  0x080c7533 in xfree (ptr=0xc1d8a20) at smalloc.c:964
#3  0x080a5dad in mempool_delete (pPool=0xc059580) at mempools.c:603
#4  0x080b6ac7 in free_pointer_table (ptable=0xbeb17c4) at ptrtable.c:116
#5  0x080a746f in f_save_object (sp=0x810f528, numarg=1) at object.c:1845
#6  0x080744ba in eval_instruction (
    first_instruction=0x83e3353 "\005:S\n\a\030\004\020\001L\rY:&\026#2\204+\203\t\001", initial_sp=0x810f520) at interpret.c:6384
#7  0x080933ac in apply_low (fun=0x8c07664 "save", ob=0x99160ac, num_arg=0, 
    b_ign_prot=0) at interpret.c:20827
#8  0x080939e2 in sapply_int (fun=0x8c07664 "save", ob=0x99160ac, num_arg=0, 
    b_find_static=0) at interpret.c:21049
#9  0x08093a83 in apply (fun=0x8c07664 "save", ob=0x99160ac, num_arg=0)
    at interpret.c:21087
#10 0x080bc58f in execute_callback (cb=0x84f7cbc, nargs=0, keep=0, toplevel=1)
    at simulate.c:3639
#11 0x08053192 in call_out () at call_out.c:436
#12 0x080514bd in backend () at backend.c:657
#13 0x0809ebec in main (argc=58, argv=0xbffff684) at main.c:470
(gdb) 

Er gab 4 Sekunden folgende Meldung aus:
2002.09.16 00:22:33 Garbage collection (slow_shut to do: 0, time since last gc: 1032128553)

Hab leider das Debug-Log nicht mehr. Falls Du sonst irgendwelche Infos
brauchst, sag Bescheid.

Gruss
Gnomi


Date: Mon, 16 Sep 2002 11:16:56 +0200
From: Gnomi <Gnomi@UNItopia.bera.rus.Uni-Stuttgart.DE>
To: Lars Duening <lars@bearnip.com>
Subject: Re: Segmentation fault
Message-ID: <20020916091656.GA1656@laptop.motzkau>

Hi,

Lars Duening schrieb:
> Gnomi wrote:
> 
> >Hallo!
> >
> >Der LDMud 3.2.9 dev545 hat ein Core produziert:

Aeh, das war der dev454.

> Hmm, welche Driverversion hattet ihr vorher?

Wie meinst Du das? UNItopia laeuft noch mit dem dev446.
Freaky hat vorher noch den dev452 compiliert.
Aber der dev454 wurde wohl aus dem ldmnud-32dev453.tar.gz +
diff32dev453-454.gz gewonnen.

Gruss
Gnomi

Date: Mon, 16 Sep 2002 23:23:13 +0200
From: Gnomi <Gnomi@UNItopia.bera.rus.Uni-Stuttgart.DE>
To: Lars Duening <lars@bearnip.com>
Subject: Re: Segmentation fault

Lars Duening schrieb:
> Gnomi wrote:
> 
> >Hallo!
> >
> >Der LDMud 3.2.9 dev545 hat ein Core produziert:

> >> Hmm, welche Driverversion hattet ihr vorher?
> >
> >Wie meinst Du das? UNItopia laeuft noch mit dem dev446.
>
> Was daraufhin deutet, dass der Fehler zwischen diesen beiden Versionen
> eingebaut wurde.

Nicht unbedingt. Ich hab in Orbit eine Art Haertetest durchgefuehrt, alle
Objekte der Reihe nach geladen und zerstoert. Fast am Ende des Tests gab es
diesen Crash. Diesen Haertetest fuehre ich nicht in UNItopia selbst durch...

> Hmm, ich kann keine Aenderungen seit 446 finden, die dieses Verhalten
> erklaeren koennten. Andererseits gab es Meldungen, dass save_object() seit
> .450 ueber mappings stolpert - wiederum unerklaerbar.
> 
> Ist dieser Crash reproduzierbar?

Urgs. Also wenn ich nur den letzten Teil des Testes (wo er auch gecrasht
ist) durchfuehre, dann nicht. 

> 
> >#0  build_block (ptr=0xc1d46a4, size=5908) at smalloc.c:1841
> >1841       *(ptr+size-1) = size;        /* copy the size information */
> >(gdb) bt
> >#0  build_block (ptr=0xc1d46a4, size=5908) at smalloc.c:1841
> >#1  0x080c80a6 in large_free (ptr=0xc1d8a20
> "ø\205\035\f<\212\035\f\f\004")
> >    at smalloc.c:2408
> >#2  0x080c7533 in xfree (ptr=0xc1d8a20) at smalloc.c:964
> >#3  0x080a5dad in mempool_delete (pPool=0xc059580) at mempools.c:603
> >#4  0x080b6ac7 in free_pointer_table (ptable=0xbeb17c4) at ptrtable.c:116
> >#5  0x080a746f in f_save_object (sp=0x810f528, numarg=1) at object.c:1845
> 
> Was sind *sp und *current_object in diesem Frame?

(gdb) print sp
$1 = (svalue_t *) 0x810f528
(gdb) print current_object
$2 = (object_t *) 0x99160ac
(gdb) print *sp
$3 = {type = 3, x = {string_type = 2, exponent = 2, closure_type = 2, 
    quotes = 2, num_arg = 2, extern_args = 2, generic = 2}, u = {
    string = 0x8c07140 "/p/Registry/registry", number = 146829632, 
    ob = 0x8c07140, vec = 0x8c07140, map = 0x8c07140, lambda = 0x8c07140, 
    mantissa = 146829632, cb = 0x8c07140, lvalue = 0x8c07140, 
    protected_lvalue = 0x8c07140, protected_char_lvalue = 0x8c07140, 
    protected_range_lvalue = 0x8c07140, error_handler = 0x8c07140}}
(gdb) print *current_object
$4 = {flags = 1536, ref = 9, total_light = 0, time_reset = 1032128597, 
  time_of_ref = 1032128557, load_time = 1032126832, load_id = 427, 
  extra_ref = 0, prog = 0x83e3090, name = 0x983372c "p/Registry/registry", 
  load_name = 0x8c07140 "/p/Registry/registry", next_all = 0x9915dbc, 
  prev_all = 0x9982dd0, next_hash = 0x0, next_inv = 0x0, contains = 0x0, 
  super = 0x0, sent = 0x0, user = 0x9916da4, eff_user = 0x9916da4, 
  extra_num_variables = 59, variables = 0x83e468c, ticks = 547724, 
  gigaticks = 0}
(gdb) 

Das  /p/Registry/registry hat ein Mapping der Form
   ([
	String: Zahl; String; Zahl; ([String: Zahl, ...]),
        ...
   ])

ein Integer und ein Integer-Array als Variablen.

Gruss
Gnomi


Date: Mon, 16 Sep 2002 23:49:03 +0200
From: Gnomi <Gnomi@UNItopia.bera.rus.Uni-Stuttgart.DE>
To: Lars Duening <lars@bearnip.com>
Subject: Re: Segmentation fault

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; Charset=us-ascii
Content-Transfer-Encoding: 7bit

Lars Duening schrieb:
> >(gdb) print *current_object
> >$4 = {flags = 1536, ref = 9, total_light = 0, time_reset = 1032128597, 
> >  time_of_ref = 1032128557, load_time = 1032126832, load_id = 427, 
> >  extra_ref = 0, prog = 0x83e3090, name = 0x983372c "p/Registry/registry", 
> >  load_name = 0x8c07140 "/p/Registry/registry", next_all = 0x9915dbc, 
> >  prev_all = 0x9982dd0, next_hash = 0x0, next_inv = 0x0, contains = 0x0, 
> >  super = 0x0, sent = 0x0, user = 0x9916da4, eff_user = 0x9916da4, 
> >  extra_num_variables = 59, variables = 0x83e468c, ticks = 547724, 
> >  gigaticks = 0}
> >(gdb) 
> 
> Waere es moeglich, die fuer die Registry benoetigten LPC-Dateien und das
> letzte Savefile zu haben?

registry.c und das aktuelle Savefile von UNItopia liegen anbei.
Die Registry benoetigt ausser dem /p/Tool/sys/debugger.h, welches auch anbei
liegt, nur Dateien aus der Mudlib. Willst Du die auch zugeschickt haben?

Gruss
Gnomi

Files: see bugs/b-020916-files/

--qDbXVdCdHGoSgWSk--


Date: Sun, 22 Sep 2002 16:04:06 +0200
From: Freaky <Freaky@UNItopia.RUS.Uni-Stuttgart.DE>
To: Alexander Motzkau <gnomi@UNItopia.RUS.Uni-Stuttgart.DE>
Cc: Lars Duening <lars@bearnip.com>
Subject: Re: Segmentation fault
Message-ID: <20020922140406.GA3483@UNItopia.Uni-Stuttgart.DE>

Hi,

Alexander Motzkau:
> Lars Duening schrieb:
> > Say, when you had your mapping/save_object() problems - was the driver by
> > chance compiled with USE_PTHREADS?
> 
> Hmm, ein Grep ueber die Driversourcen ergab kein solches Define.
> Allerdings wurde inzwischen Patches zum 457 druebergejagt, daher die Frage
> an Freaky: Wurde der dev454 mit USE_PTHREADS kompiliert?

Nicht dass ich wuesste. Es sei denn, das war default-Einstellung.
Ich habe nur die normalen Patches applied.

Ciao
		Freaky

-- 
Frank 'Freaky' Kirschner
UNItopia Admin                          http://UNItopia.uni-stuttgart.de/
Freaky@UNItopia.Uni-Stuttgart.DE      telnet://UNItopia.uni-stuttgart.de/


From: Bill Andrulonis <bill.andrulonis@citrix.com>
To: 'Lars Duening' <lars@bearnip.com>
Subject: RE: Segmentation fault
Date: Sun, 22 Sep 2002 22:28:24 -0400

It's possible that it was (to alleviate the socket errors that we were
having).

-----Original Message-----
From: Lars Duening [mailto:lars@bearnip.com] 
Sent: Saturday, September 21, 2002 9:40 AM
To: Bill Andrulonis
Subject: Re: Segmentation fault

Say, when you had your mapping/save_object() problems - was the driver by
chance compiled with USE_PTHREADS?
-- 
Lars Duening; lars@bearnip.com
PGP Key: http://www.bearnip.com/lars/pgp-lars.asc


Date: Thu, 26 Sep 2002 21:31:33 +0200
From: Gnomi <Gnomi@UNItopia.bera.rus.Uni-Stuttgart.DE>
To: Lars Duening <lars@bearnip.com>
Subject: Re: Segmentation fault
Message-ID: <20020926193133.GA24904@laptop.motzkau>
References: <20020916212313.GA849@laptop.motzkau> <r01050300-1015-52A68F06D0AD11D6B7820003938094E8@[10.0.0.3]>

--BXVAT5kNtrzKuDFl
Content-Type: text/plain; Charset=us-ascii
Content-Transfer-Encoding: 7bit

Lars Duening schrieb:
> Gnomi wrote:
> 
> >Lars Duening schrieb:
> >> Gnomi wrote:
> >> 
> >> >Hallo!
> >> >
> >> >Der LDMud 3.2.9 dev545 hat ein Core produziert:
> >
> >> >> Hmm, welche Driverversion hattet ihr vorher?
> >> >
> >> >Wie meinst Du das? UNItopia laeuft noch mit dem dev446.
> >>
> >> Was daraufhin deutet, dass der Fehler zwischen diesen beiden Versionen
> >> eingebaut wurde.
> >
> >Nicht unbedingt. Ich hab in Orbit eine Art Haertetest durchgefuehrt, alle
> >Objekte der Reihe nach geladen und zerstoert. Fast am Ende des Tests gab
> es
> >diesen Crash. Diesen Haertetest fuehre ich nicht in UNItopia selbst
> durch...
> 
> Hast du den Code/wasuauchimmer fuer den Haertetest verfuegbar? Ich wuerde
> gern versuchen, ihn im kleinen hier nachzuvollziehen.

Liegt anbei. Man startet es mit check_path(Pfad), wobei in der Datei
Pfad+"/FILES" eine Liste aller zu ladenden Dateien im Format 
'Groesse<Tabulator>vollstaendiger Dateiname' enthaelt (wie es z.B. von 'du'
geschrieben wird).

Ich hab den Test auch im kleinen nochmal wiederholt (direkt in dem Bereich,
wo er vorher gecrasht ist, nur halt ohne die ganzen vorherigen Domains),
allerdings crashte der Treiber dann auch nicht. Ich tippe da wirklich auf
irgendeine Folge der Speicherknappheit wie z.B. die garbage collection,
die da irgendwas kaputt gemacht.

Gruss
Gnomi
--BXVAT5kNtrzKuDFl
Content-Type: text/x-csrc; Charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; Filename="files.c"

// IDEE: do_errors und touch-Fehler abfangen...
// Dieses benoetigt Hilfe vom Master
// In log_error muss folgender Aufruf rein:
// if(CONTROL->forbidden("compile_error",file,message,warn)) return;
// Danach darf erst das Fehlerlogging geschehen.

#include <error_db.h>
#include <touch.h>
#include <apps.h>
#define STEP 500
#define TLE 250000
#define FEFILE(s) ("/w/gnomi/save/FILES.error."+(s[1]=='p'?"p":explode(s,"/")[2]))

#define NO_LOAD_DIRS ({ "/sys/", "/INFO/", "/doc/", "/save/", "/Admin/",\
    "/var/", "/static/", "/priv/", "/log/", "/Old/", "/OLD", "/RUINEN/", \
    ".old.", ".old/", "/Alt/", "/alt/", "/old/", "/Alt/", })
//    "/z/Gilden/Hexenvolk/Home_Mud/"})

string loading;

varargs void check_path(string path, int *l, string *str)
{
    string s,t;
    object ob;
    if(!l) l=({0,0,0,0});
    while(get_eval_cost()>TLE)
    {
        while((!str) || !sizeof(str))
        {
            s=read_file(path+"/FILES",l[0],STEP);
            if(!s)
            {
                printf("%i Zeilen gelesen, %i Dateien getestet, %i davon fehlerhaft.\n",l[1],l[2],l[3]);
                return;
            }
            str=explode(s,"\n")-({""});
            l[0]+=STEP;
            l[1]+=sizeof(str);
        }
        if(sscanf(str[0],"%!d\t%s",s) && (s[<2..<1]==".c") &&
            !sizeof(filter(NO_LOAD_DIRS,(:strstr($2,$1)>=0:),s)))
        {
            s=s[0..<3];
            ob=find_object(s);
            if(!ob)
            {
                l[2]++;
                loading="";
                t=catch(ob=touch(s,NO_LOG|NO_WRITE));
                if(strlen(loading) || t)
                {
                    string hs;
                    hs="\n"+s+"\n";
                    if(t) hs+="  "+t[1..<1];
                    hs+=loading;
                    l[3]++;
                    write_file(FEFILE(s),hs);
                }
                l[2]++;
                loading=0;
            }
            if(ob && get_eval_cost()>140000)
            {
                catch(ob->remove());
                if(ob && get_eval_cost()>140000) catch(destruct(ob));
            }
        }
        str=str[1..<1];
    }
    call_out("check_path",(get_eval_cost()>TLE)?1:2,path,l,str);
}

int forbidden_compile_error(string file, string message, int warn)
{
    if(!loading)
        return 0;
    loading+="  "+message;
    return 1;
}

void create()
{
  seteuid(getuid());
  CONTROL->add_controller("forbidden_compile_error",this_object());
}
--BXVAT5kNtrzKuDFl--

Site Stats

Snippets: 1791
Codebases: 571