[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problems with Checker-0.9.2 after adding stubs
- To: http://www.email.enst.fr/~gingold
- Subject: problems with Checker-0.9.2 after adding stubs
- From: http://dummy.us.eu.org/robert (robert)
- Date: Thu, 2 Jul 1998 11:46:12 -0400
- XX-from: http://dummy.us.eu.org/robert (robert)
Hi. Sorry to bother you. I could not find a mailing list associated with
Checker, so I must mail you directly.
I added a couple of stubs to get another program to link properly. After
doing that, I'm now getting a SEGV in a completely different part of the
code.
I'll include the actual stubs at the end of this message.
Let me first say that I added the following code to l-malloc/maccess.c:
/* Called by codecheck.S FIXME. */
void
adjust_bm_when_stack_reduce (void)
{
#if CHKR_STACKBITMAP
+ if (mapinfo[STACKBM] == NULL) {
+ init_mapinfos();
+ }
#ifdef STACK_GROWS_DOWNWARD
mapinfo[STACKBM]->real_base = known_stack_limit;
#else
mapinfo[STACKBM]->length = known_stack_limit - (PTR) STACK_BASE;
#endif
stack_bitmapped = known_stack_limit;
#endif
}
This is because mapinfo[3] (STACKBM==3) is null and was crashing in this
routine. This didn't fix the problem because then I get a crash later:
#0 init_mapinfos () at ./l-malloc/maccess.c:3030
#1 0x814508f in adjust_bm_when_stack_reduce () at ./l-malloc/maccess.c:614
#2 0x8144ead in SetBitMem (addr=0x818c85c, bitmem=0xbffff240)
at ./l-malloc/maccess.c:466
#3 0x8145972 in chkr_set_right (ptr=0x818c85c, len=268, right=0 '\000')
at ./l-malloc/maccess.c:1064
#4 0x814877e in __mmalloc_sbrk_init () at l-malloc/macc-mmap.h:437
#5 0x8142dc9 in malloc_1 (mdp=0x0, real_size=24) at ./l-malloc/malloc.c:78
#6 0x814308b in malloc (real_size=24) at ./l-malloc/malloc.c:251
#7 0x8162f33 in __register_frame (begin=0x8178328)
#8 0x8049fc9 in frame_ ()
#9 0x80497a5 in _init ()
(gdb) l
3025 mapinfo[NULLBM] = &Fmapinfo[i++];
3026
3027 Fmapinfo[i].type = SegFinish;
3028
3029 nbr_mapinfo = i + 1;
3030 text_beg = objects->org ? objects->org : null_pointer_zone;
3031
3032 /* NULL zone. */
3033 mapinfo[NULLBM]->name = M_NULL_ZONE;
3034 mapinfo[NULLBM]->base = (PTR) 0x0;
(gdb) bjects
$1 = (struct object *) 0x0
I don't think this problem is related to my added stubs.
If there is a mailing list to talk about these sorts of things or if you
know someone who I could talk to about this, please tell me. Thanks.
I enabled stubs-ncurses.c and got it to compile. I also enabled wait3().
In stubs-unistd.c:
#ifdef HAVE_basename
char * chkr_stub_basename (const char * arg0)
__asm__ (CHKR_PREFIX ("basename"));
char *
chkr_stub_basename (const char * arg0)
{
/* This function requires a stub */
stubs_chkr_check_addr (arg0, sizeof (char), CHKR_RO, "buf");
#if USE_BI_JUMP
__builtin_jump (basename);
#else
{
char * res;
res = basename (arg0);
return res;
}
#endif /* !USE_BI_JUMP */
}
#endif /* HAVE_basename */
I added stubs-rx.c:
#include "available-stubs.h"
#ifndef HAVE_RX_H
#include <rx.h>
#include "checker_api.h"
/* compiled from: . */
#ifdef HAVE_re_comp
char * chkr_stub_re_comp (const void *src)
__asm__ (CHKR_PREFIX ("re_comp"));
char *
chkr_stub_re_comp (const void *src)
{
stubs_chkr_check_addr (src, sizeof (char), CHKR_RO, "src");
return re_comp (src);
}
#endif /* HAVE_re_comp */
#ifdef HAVE_re_exec
int chkr_stub_re_exec (const void *src)
__asm__ (CHKR_PREFIX ("re_exec"));
int
chkr_stub_re_exec (const void *src)
{
stubs_chkr_check_addr (src, sizeof (char), CHKR_RO, "src");
return re_exec (src);
}
#endif /* HAVE_re_exec */
#endif /* HAVE_RX_H */