Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #14614

Re: Appending definition to another definition

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Appending definition to another definition
Date 2012-08-01 15:09 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2012Aug1.170907@mips.complang.tuwien.ac.at> (permalink)
References (3 earlier) <5086b9cd-8fc9-4f2a-89c3-051dc861a7aa@z19g2000vbe.googlegroups.com> <0e27a667-f796-4e6c-a796-0dac149163a5@h8g2000pbt.googlegroups.com> <b5713f59-9195-4925-983e-564be6507ad4@googlegroups.com> <NNqdnUV-QrKYhYXNnZ2dnUVZ8kOdnZ2d@supernews.com> <2aeb4f5b-2266-485a-8845-a77051849ca2@googlegroups.com>

Show all headers | View raw


George Hubert <georgeahubert@yahoo.co.uk> writes:
>On Tuesday, July 31, 2012 6:38:13 PM UTC+1, Andrew Haley wrote:
>> George Hubert <georgeahubert@yahoo.co.uk> wrote: > The Standard states th=
>at FREE either succeeds and returns zero or > fails returning non-zero: any=
>thing else is clearly a bug. Not exactly. The standard doesn't say anything=
> about what happens if you fail to honour your side of the contract, which =
>is "a-addr shall indicate a region of data space that was previously obtain=
>ed by ALLOCATE or RESIZE." Andrew.
>
>Surely:
>
>14.4.1.2 Ambiguous conditions
>no additional requirements.=20
>
>implies that there aren't any ambiguous conditions

Or not any additional ones.

>which undefined behavio=
>ur in the event of a-addr not coming from ALLOCATE implies. Anyway it doesn=
>'t state it will crash, as Hugh said.

But crash it does, on a number of systems (see below).  And I don't
see a reliable and efficient way to prevent this in all cases.

- anton
-----------------------------------------------------
 VFX Forth for Linux IA32
 © MicroProcessor Engineering Ltd, 1998-2009 

 Version: 4.40 [build 0404]
 Build date: 7 December 2009

 Free dictionary = 7922527 bytes [7736kb]


here free 
 CS=0023 DS=002B ES=002B SS=002B FS=0000 GS=0063
 EAX=0800:0000 EBX=F7FB:4FF4 ECX=0893:4EB1 EDX=0000:0000
 ESI=F7FB:6160 EDI=080B:9CA1 EBP=0893:4F94 ESP=0893:4F7C
 EIP=F7ED:631C EFLAGS=0001:0206
--- RS top ---
 $0000:0009
 $080B:61C9 ADD-HISTORY-LINE 
 $0800:0000
 $0000:0000
 $0894:4FC0
 $0893:4FA0
 $0894:4FB0
 $0804:AADD NXCALL 
Signal number SIGSEGV
at address F7ED:631C, probably in * outside dictionary *  

Press E to exit, R to restart, other to continue: 

----------------------------------------------------------
[c7:~:31707] sf
SwiftForth i386-Linux 3.2.1 28-Dec-2009 
here free *** glibc detected *** sf: free(): invalid pointer: 0x080801b1 ***
Aborted

----------------------------------------------------------
Gforth 0.6.2, Copyright (C) 1995-2003 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
0 free . 0  ok
here free . *** glibc detected *** gforth: free(): invalid pointer: 0x00007f85c1f28898 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f85c2767948]
/lib/libc.so.6(cfree+0x76)[0x7f85c2769a56]
gforth(engine+0x2584)[0x406674]
gforth(go_forth+0x174)[0x40f914]
gforth(main+0x153)[0x4106e3]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f85c27121a6]
gforth[0x404059]
======= Memory map: ========
...
Aborted.

The Gforth behaviour is wrong.  The Forth system should not terminate
(it normally does not terminate even if it executes an illegal
instruction).

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Appending definition to another definition programmingkidx@gmail.com - 2012-07-29 11:28 -0700
  Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 11:39 -0700
    Re: Appending definition to another definition teammember0x01@gmail.com - 2012-07-29 12:16 -0700
      Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 12:24 -0700
        Re: Appending definition to another definition programmingkidx@gmail.com - 2012-07-29 13:41 -0700
          Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 13:46 -0700
            Re: Appending definition to another definition programmingkidx@gmail.com - 2012-07-29 14:00 -0700
              Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 14:03 -0700
              Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-07-29 14:21 -0700
              Re: Appending definition to another definition "Elizabeth D. Rather" <erather@forth.com> - 2012-07-30 12:43 -0500
              Re: Appending definition to another definition rickman <gnuarm@gmail.com> - 2012-07-31 02:07 -0700
      Re: Appending definition to another definition Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-30 01:13 -0700
        Re: Appending definition to another definition Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-07-31 00:42 -0700
          Re: Appending definition to another definition Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-31 01:05 -0700
            Re: Appending definition to another definition Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-07-31 01:55 -0700
              Re: Appending definition to another definition George Hubert <georgeahubert@yahoo.co.uk> - 2012-07-31 09:55 -0700
                Re: Appending definition to another definition Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-31 12:38 -0500
                Re: Appending definition to another definition George Hubert <georgeahubert@yahoo.co.uk> - 2012-07-31 13:20 -0700
                Re: Appending definition to another definition Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-01 04:34 -0500
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-08-01 03:27 -0700
                Re: Appending definition to another definition Coos Haak <chforth@hccnet.nl> - 2012-08-01 15:45 +0200
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 07:01 -0700
                Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-08-01 08:02 -0700
                Re: Appending definition to another definition Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-01 08:07 -0700
                Re: Appending definition to another definition jim@rainbarrel.com - 2012-08-01 14:06 -0700
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-08-01 16:59 -0700
                Re: Appending definition to another definition anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-01 15:09 +0000
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 08:56 -0700
                Re: Appending definition to another definition anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-01 16:34 +0000
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 10:15 -0700
                Re: Appending definition to another definition George Hubert <georgeahubert@yahoo.co.uk> - 2012-08-01 11:04 -0700
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 12:02 -0700
                Re: Appending definition to another definition George Hubert <georgeahubert@yahoo.co.uk> - 2012-08-01 13:51 -0700
                Re: Appending definition to another definition Aleksej Saushev <asau@inbox.ru> - 2012-08-02 05:28 +0400
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 19:04 -0700
                Re: Appending definition to another definition Aleksej Saushev <asau@inbox.ru> - 2012-08-02 08:33 +0400
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 22:07 -0700
                Re: Appending definition to another definition "A. K." <akk@nospam.org> - 2012-08-02 08:03 +0200
                Re: Appending definition to another definition Paul Rubin <no.email@nospam.invalid> - 2012-08-01 23:11 -0700
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-08-02 00:05 -0700
                Re: Appending definition to another definition Aleksej Saushev <asau@inbox.ru> - 2012-08-06 01:44 +0400
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-08-01 16:48 -0700
                heap implementation (was: Appending definition to another definition) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-02 14:48 +0000
                Re: heap implementation Paul Rubin <no.email@nospam.invalid> - 2012-08-02 14:37 -0700
                Re: heap implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-03 13:58 +0000
                Re: heap implementation Alex McDonald <blog@rivadpm.com> - 2012-08-03 08:57 -0700
                Re: heap implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-03 16:12 +0000
                Re: heap implementation Alex McDonald <blog@rivadpm.com> - 2012-08-04 08:29 -0700
                Re: heap implementation Paul Rubin <no.email@nospam.invalid> - 2012-08-03 21:22 -0700
                Re: heap implementation Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-04 03:11 -0500
                Re: heap implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-04 11:40 +0000
                Re: heap implementation (was: Appending definition to another definition) Bernd Paysan <bernd.paysan@gmx.de> - 2012-08-03 00:04 +0200
                Re: Appending definition to another definition George Hubert <georgeahubert@yahoo.co.uk> - 2012-08-01 11:20 -0700
                Re: Appending definition to another definition Bernd Paysan <bernd.paysan@gmx.de> - 2012-08-02 01:55 +0200
                Re: Appending definition to another definition Bernd Paysan <bernd.paysan@gmx.de> - 2012-08-02 02:09 +0200
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-08-01 18:57 -0700
                Re: Appending definition to another definition anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-02 09:41 +0000
                Re: Appending definition to another definition hughaguilar96@yahoo.com - 2012-07-31 23:52 -0700
                Re: Appending definition to another definition Coos Haak <chforth@hccnet.nl> - 2012-08-01 15:46 +0200
            Re: Appending definition to another definition jim@rainbarrel.com - 2012-08-01 14:01 -0700
              Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-08-01 14:39 -0700
        Re: Appending definition to another definition programmingkidx@gmail.com - 2012-08-05 19:35 -0700
  Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 11:40 -0700
    Re: Appending definition to another definition programmingkidx@gmail.com - 2012-07-29 11:58 -0700
      Re: Appending definition to another definition Jason Damisch <jasondamisch@yahoo.com> - 2012-07-29 12:08 -0700
      Re: Appending definition to another definition Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-07-29 22:43 +0100
        Re: Appending definition to another definition Arnold Doray <invalid@invalid.com> - 2012-07-30 02:34 +0000
          Re: Appending definition to another definition Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-07-30 06:59 +0100
      Re: Appending definition to another definition Arnold Doray <invalid@invalid.com> - 2012-07-30 13:42 +0000
  Re: Appending definition to another definition "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-07-29 18:23 -0400

csiph-web