1998-12-03 Jason Molenda (jsm@bugshack.cygnus.com)
* monitor.c (monitor_read_memory): Zero out pattern buffers before calling re_search. (parse_register_dump): Ditto. PR 18049. This bug had existed erratically since I upgraded to the new gnu-regex.c this last summer. The problem is mostly in parse_register_dump; the allocated structure has some random values in it and there is a flag set in the register_pattern structure by the gnu-regex library which indicates that the values in the re_registers should be trusted. If those arbitrary contents aren't zero, gnu-regex tries to run realloc on them and we get a core dump on some hosts for some targets when the moon is just right.
This commit is contained in:
parent
33ccdb1b97
commit
edc452d07d
|
@ -1,3 +1,8 @@
|
||||||
|
1998-12-03 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||||
|
|
||||||
|
* monitor.c (monitor_read_memory): Zero out pattern buffers
|
||||||
|
before calling re_search.
|
||||||
|
(parse_register_dump): Ditto.
|
||||||
|
|
||||||
Thu Dec 3 10:37:22 EST 1998 Zdenek Radouch (radouch@cygnus.com)
|
Thu Dec 3 10:37:22 EST 1998 Zdenek Radouch (radouch@cygnus.com)
|
||||||
|
|
||||||
|
@ -5,7 +10,6 @@ Thu Dec 3 10:37:22 EST 1998 Zdenek Radouch (radouch@cygnus.com)
|
||||||
* configure.tgt
|
* configure.tgt
|
||||||
* fr30-tdep.c
|
* fr30-tdep.c
|
||||||
* config/fr30/tm-fr30.h
|
* config/fr30/tm-fr30.h
|
||||||
|
|
||||||
|
|
||||||
Thu Dec 3 16:30:35 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
Thu Dec 3 16:30:35 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
|
|
|
@ -847,6 +847,8 @@ parse_register_dump (buf, len)
|
||||||
points to the start of the register value. */
|
points to the start of the register value. */
|
||||||
struct re_registers register_strings;
|
struct re_registers register_strings;
|
||||||
|
|
||||||
|
memset (®ister_strings, 0, sizeof (struct re_registers));
|
||||||
|
|
||||||
if (re_search (®ister_pattern, buf, len, 0, len,
|
if (re_search (®ister_pattern, buf, len, 0, len,
|
||||||
®ister_strings) == -1)
|
®ister_strings) == -1)
|
||||||
break;
|
break;
|
||||||
|
@ -1759,6 +1761,7 @@ monitor_read_memory (memaddr, myaddr, len)
|
||||||
struct re_registers resp_strings;
|
struct re_registers resp_strings;
|
||||||
RDEBUG(("MON getmem.resp_delim %s\n",current_monitor->getmem.resp_delim)) ;
|
RDEBUG(("MON getmem.resp_delim %s\n",current_monitor->getmem.resp_delim)) ;
|
||||||
|
|
||||||
|
memset (&resp_strings, 0, sizeof (struct re_registers));
|
||||||
tmp = strlen (p);
|
tmp = strlen (p);
|
||||||
retval = re_search (&getmem_resp_delim_pattern, p, tmp, 0, tmp,
|
retval = re_search (&getmem_resp_delim_pattern, p, tmp, 0, tmp,
|
||||||
&resp_strings);
|
&resp_strings);
|
||||||
|
|
Loading…
Reference in New Issue