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


Groups > comp.lang.forth > #25946

Re: gForth and unix/pthread.fs

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: gForth and unix/pthread.fs
Date 2013-09-22 21:18 +0200
Organization 1&1 Internet AG
Message-ID <l1nfq1$prb$1@online.de> (permalink)
References (8 earlier) <-ZGdnbpfIelX86DPnZ2dnUVZ_gidnZ2d@supernews.com> <l1k8ge$q7h$1@online.de> <ut6dnep6TsW8V6DPnZ2dnUVZ_jednZ2d@supernews.com> <l1kpe9$fj6$1@online.de> <KfydnaLj9IjHXaPPnZ2dnUVZ_tudnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley wrote:

> Bernd Paysan <bernd.paysan@gmx.de> wrote:
>> Andrew Haley wrote:
>>> The trouble with memory [t]rashing bugs is that, in general, it's
>>> extremely hard to recover from them in any reasonable way.  So, in
>>> many cases terminating the programs makes very good sense.
>> 
>> This assumption is pretty wrong in Forth.
> 
> It's a statement about the C library, and more particularly malloc().
> It's true because memory trashing often corrupts malloc()'s own data
> structures.  It's also true of Forth if you damage the dictionary.  In
> some cases you might be able to recover, of course; but there's no
> general way to do so.

Usually you don't recover from errors in Forth, but you try to debug the 
situation.  That's the intention of the default debug handling code in 
glibc, but this default code only works for C programs - at least partially.  
The usual cause for this kind of error are buffer overflows, dumping the 
memory in the proximity of the problem also is helpful.

>>>> And first of all, I would expect that a non-thread-safe function for
>>>> otherwise thread-safe stuff (malloc is very explicitely stated to be
>>>> thread- safe) would have a big warning label in the manpage.
>>> 
>>> So would I.
>> 
>> I think that's the most annoying part.
> 
> Mmm.  Patches welcome.  :-)

To the manpage?  That's doable ;-).  To Uli's code?  :-/

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

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


Thread

gForth and unix/pthread.fs voidvolker@gmail.com - 2013-09-16 00:43 -0700
  Re: gForth and unix/pthread.fs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-16 09:05 +0000
    Re: gForth and unix/pthread.fs voidvolker@gmail.com - 2013-09-16 05:43 -0700
  Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-19 10:14 -0700
    Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 01:26 +0200
      Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-19 19:17 -0700
        Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 16:20 +0200
          Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-20 08:43 -0700
            Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 19:07 +0200
              Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 19:14 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-21 05:02 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 15:55 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-21 11:32 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 20:44 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-22 05:03 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-22 21:18 +0200
                Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-21 11:41 -0700
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 21:18 +0200
                Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-21 13:55 -0700
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 23:40 +0200
              Re: gForth and unix/pthread.fs albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-09-21 12:59 +0000

csiph-web