Maurilio,
The sample does something which is logically invalid, and can not be
blocked without removing such functionality. Different variations of
this sample will cause GPF traps, for different implementations of
the feature.
The language itself is NOT corrupting anything, some "usages" are.
F.e. any language that support recursion and does not set arbitrary
limits on the feature will "break" on something as simple as this.
FUNCTION x()
RETURN x()
Pointers in C could easily be "protected", as is proven by memory
management component of products such as CodeGuard. This raises the
question WHY do C compilers do NOT implement such "safe" memory
management tools, be default?
IMO, it's because the PHILOSOPHY of C compilers developers is that
performance is MORE important, than protecting invalid code, and that
OPTIONAL TOOLS can be used to allow developers to DISCOVER such
coding faults.
[Here again, someone will get an opportunity to accuse me of
disguising technical faults as "philosophy", instead of accepting
that software development is full of NON technical choices, call it
what ever you want.]
Ron
On Apr 2, 2008, at 6:00 AM, Maurilio Longo wrote:
Ron,
I've just tested your sample with current xharbour cvs, it does not
corrupt
memory (I did not test it with valgrind like tools, though) and while
in C you
have pointers, so you can do every kind of errors, xbase dialects should
protect you from this kind of errors (or at least try to).
I'm not saying that a language should make it impossibile for a
programmer to
make errors and/or spot runtime limits, I'm saying that a language
should try
to make it impossibile, for itself, to corrupt its own structures/memory
areas, because this kind of errors can be really difficult to track
and fix in
non trivial code where something goes wrong without any clue why it
happens.
Just as nNum + cStr rises an error and does not corrupt cStr and/or
nNum.
Anyway, this kind of discussions become easily "philosophical"
discussions
and, as such, easily loose focus and become a long thread about how
we see the
world and our life in general :)
So, I'll keep thinking that we could enhance this issue, but at the
same time,
I'll keep trusting xharbour as safe and solid tool.
Best regards.
Maurilio.
Ron Pinkas wrote:
> Maurlio,
>
> Based on such argument the C language could not exist. because there's
> absolute no way you could give programmers the power of such language
> and yet insist on blocking every possible stupidity.
>
> Even in higher level languages, there's no way to completely eliminate
> possiblity of GPF traps caused by USER code. I can provide many
> examples
> for Clipper, and [x]Harbour. If we concentrate on "fixing" such traps,
> IMO we lose the bigger picture.
>
> F.e., did you ever try such Clipper sample:
>
> PROCEDURE Main()
> LOCAL c
> Test( @c )
> ? "Please double...", "Idiotic", c
> RETURN
>
> PROCEDURE Test( ByRef )
> LOCAL c := "Stupid"
> ByRef := IIF( .T., @c, )
> RETURN
>
> I can assure you there will always exists such stupid traps, in any
> language worth working with.
>
> Ron
>
> On Apr 2, 2008, at 2:46 AM, Maurilio Longo wrote:
> Ron,
>
> while sometimes (more often than not :)) Przemyslaw's english sounds
> rude even
> to me (that I'm not a native english speaker), I think that a bug
> example is
> just a way to show what can happen (and make it happen) and not real
> code to
> study.
>
> The problem, here, in my opinion, is that we should 'fix' this (maybe
> raising
> an exception) but not let the runtime corrupt its own memory.
>
> If this 'fix' saves just a few programmers' mistakes it will pay for
> itself in
> the long run, and, more important, it will pay for itself that time
> when
> you
> or someone who you trust as a programmer just makes that error and
> then you
> spend a lot of time looking at every possibile cause _but_ this
> one! It
> happens to me, from time to time, to make so stupid mistakes that I
> simply
> cannot find them anymore!?!
>
> That said, I'm using destructors in a xharbour program of mine, to
> release
> hDIBs (in memory device indipendent images) in a win32 application
> which
> manages thousands of them every month and I've never had a problem;
> this is
> just to say that xHarbour implementation is not so 'buggy' as he said.
>
> Best regards.
>
> Maurilio.
>
> PS. It seems to me that we're spending a lot of time disputing whether
> harbour
> is better or xharbour is instead of simply trying to take the best of
> the two
> to make them both better.
> Harbour, lately, took a lot of xharbour code and xharbour is now
> importing
> harbour code here and there. This is so a waste of time/resources that
> every
> time I simple wonder why it seems to be impossibile to just have a
> common
> core, with just the bare minimum inside and move everything else on
> contrib /
> options whatever so that the core easily stabilizes, while
> everybody can
> keep
> adding extensions which are built upon that core.
>
> Ron Pinkas wrote:
>> I'm sorry, but I can not understand why should xHarbour (or any
>> platform) be accused for faults of such STUPID user code. Destructor
>> is a cleanup/finalization event. Any programmer that attempts to
>> STORE the very value being destroyed, should be looking for other
>> occupation. This sample is a HORRIBLE code sample, and naive users
>> may justifiably use it as reference for their code. We should never
>> allow such sample into xHarbour.
>>
>> Ron
>>
>> On Mar 31, 2008, at 12:54 PM, Luiz Rafael Culik Guimaraes wrote:
>>
>> ----- Original Message ----- From: "Przemyslaw Czerpak" <druzus-
>> [EMAIL PROTECTED]>
>> Newsgroups: gmane.comp.lang.harbour.devel
>> To: "Harbour Project Main Developer List." <harbour-pG8skwman
>> [EMAIL PROTECTED]>
>> Sent: Monday, March 31, 2008 3:37 PM
>> Subject: Re: Accessing big text files with very long lines
>>
>>
>>> On Mon, 31 Mar 2008, Guy Roussin wrote:
>>>>> You are wrong. Only Harbour have fully working destructors and
>>>>> xHarbour doesn't. The xHarbour implementation is too buggy for
>>>>> serious usage.
>>>>> Please read docs/destruct.txt and try test code in destruct.prg.
>>>> Fine thank you, i only need to add this to my code :
>>>> class FLaccess
>>>> ...
>>>> destructor close
>>>> ...
>>>> endclass
>>>> ...
>>>> method close() class FLaccess
>>>> fclose(::nHandle)
>>>> return NIL
>>> Such simple example are also safe in xHarbour.
>>> But be careful when you will want to operate on complex data in
>>> xHarbour destructors. The xHarbour's GC is not ready for destructor
>>> .prg code which may change the reference counters in released blocks
>>> or move some complex variables. In general you should try to not
>>> touch any objects or arrays inside destructors in xHarbour.
>>> The tests/destruct.prg code in Harbour SVN repository is also good
>>> example which shows some wrong things which may happen in xHarbour.
>>> Below I'm attaching log file from VALGRIND for destruct.prg compiled
>>> by xHarbour. As you can see internal xHarbour memory structures
>>> becomes
>>> corrupted by .prg destructors code. Please also note that xHarbour
>>> can catch it immediately and XHVM still works using pointers to
>>> freed
>>> memory blocks what may cause corruptions in other subsystem which
>>> may allocate the same memory region.
>>> Until it will not be fixed in xHarbour I suggest to to use xHarbour
>>> destructors in complex applications because it may cause
>>> unpredicitble
>>> errors. The destruct.prg code can be used for tests. If you do not
>>> have
>>> VALGRIND then you can make similar test with CodeGuard from BCC.
>>>
>>> best regards,
>>> Przemek
>>>
>>>
>>> ==3235== Memcheck, a memory error detector for x86-linux.
>>> ==3235== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward
>>> et al.
>>> ==3235== Using valgrind-2.2.0, a program supervision framework for
>>> x86-linux.
>>> ==3235== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward
>>> et al.
>>> ==3235== Valgrind library directory: /usr/lib/valgrind
>>> ==3235== Command line
>>> ==3235== ./destruct
>>> ==3235== Startup, with flags:
>>> ==3235== --tool=memcheck
>>> ==3235== --leak-check=yes
>>> ==3235== --num-callers=16
>>> ==3235== -v
>>> ==3235== Contents of /proc/version:
>>> ==3235== Linux version 2.6.15 (root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/
>>> [EMAIL PROTECTED]) (gcc version 3.4.2 20041017 (Red Hat
>>> 3.4.2-6.fc3)) #8 PREEMPT Fri Jun 16 01:11:03 CEST 2006
>>> ==3235== Reading syms from /home/druzus/CVS/harbour/harbour/tests/
>>> destruct (0x8048000)
>>> ==3235== object doesn't have a symbol table
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /lib/ld-2.3.3.so (0x1B8E4000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /usr/lib/valgrind/stage2 (0xB0000000)
>>> ==3235== Reading syms from /lib/ld-2.3.3.so (0xB1000000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /usr/lib/valgrind/vgskin_memcheck.so
>>> (0xB7B9B000)
>>> ==3235== Reading syms from /lib/tls/libc-2.3.3.so (0xB7DC4000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /lib/libdl-2.3.3.so (0xB7EEC000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading suppressions file: /usr/lib/valgrind/default.supp
>>> ==3235== REDIRECT soname:libc.so.6(__GI___errno_location) to
>>> soname:libpthread.so.0(__errno_location)
>>> ==3235== REDIRECT soname:libc.so.6(__errno_location) to
>>> soname:libpthread.so.0(__errno_location)
>>> ==3235== REDIRECT soname:libc.so.6(__GI___h_errno_location) to
>>> soname:libpthread.so.0(__h_errno_location)
>>> ==3235== REDIRECT soname:libc.so.6(__h_errno_location) to
>>> soname:libpthread.so.0(__h_errno_location)
>>> ==3235== REDIRECT soname:libc.so.6(__GI___res_state) to
>>> soname:libpthread.so.0(__res_state)
>>> ==3235== REDIRECT soname:libc.so.6(__res_state) to
>>> soname:libpthread.so.0(__res_state)
>>> ==3235== REDIRECT soname:libc.so.6(stpcpy) to
>>> *vgpreload_memcheck.so*(stpcpy)
>>> ==3235== REDIRECT soname:libc.so.6(strnlen) to
>>> *vgpreload_memcheck.so*(strnlen)
>>> ==3235== REDIRECT soname:ld-linux.so.2(stpcpy) to
>>> *vgpreload_memcheck.so*(stpcpy)
>>> ==3235== REDIRECT soname:ld-linux.so.2(strchr) to
>>> *vgpreload_memcheck.so*(strchr)
>>> ==3235==
>>> ==3235== Reading syms from /usr/lib/valgrind/vg_inject.so
>>> (0x1B8FC000)
>>> ==3235== Reading syms from /usr/lib/valgrind/vgpreload_memcheck.so
>>> (0x1B901000)
>>> ==3235== TRANSLATE: 0x1B8F5A50 redirected to 0x1B90420C
>>> ==3235== Reading syms from /home/druzus/CVS/xharbour/out/lib/
>>> libxharbour-1.1.0.so (0x1B923000)
>>> ==3235== Reading syms from /usr/X11R6/lib/libX11.so.6.2 (0x987000)
>>> ==3235== object doesn't have a symbol table
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /usr/lib/libncurses.so.5.4 (0x58D8000)
>>> ==3235== Reading syms from /usr/local/lib/libslang.so.2.0.5
>>> (0x1BC64000)
>>> ==3235== object doesn't have a symbol table
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /lib/tls/libm-2.3.3.so (0x95C000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /lib/libdl-2.3.3.so (0x981000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== Reading syms from /lib/tls/libc-2.3.3.so (0x833000)
>>> ==3235== object doesn't have any debug info
>>> ==3235== TRANSLATE: 0x896160 redirected to 0x1B904A04
>>> ==3235== TRANSLATE: 0x896610 redirected to 0x1B905432
>>> ==3235== TRANSLATE: 0x1B8E47A0 redirected to 0x52BFF040
>>> ==3235== TRANSLATE: 0x894430 redirected to 0x1B904F30
>>>
>>> First simple tests when object is not destroyed by GC
>>> =====================================================
>>>
>>> => o := myClass():new( 0 )
>>> Hi, I'm INIT method of class: MYCLASS
>>> => o:className() -> MYCLASS
>>> => o := NIL
>>> Hi, I'm desturctor of class: MYCLASS
>>> I do not store any references to self.
>>> It's a safe destructor.
>>>
>>> => o := myClass():new( 1 )
>>> Hi, I'm INIT method of class: MYCLASS
>>> => o:className() -> MYCLASS
>>> => o := NIL
>>> Hi, I'm desturctor of class: MYCLASS
>>> I'm storing reference to self in instance variable.
>>> Bad practice but safe in Harbour because it will be destroyed.
>>>
>>> => o := myClass():new( 2 )
>>> Hi, I'm INIT method of class: MYCLASS
>>> => o:className() -> MYCLASS
>>> => o := NIL
>>> Hi, I'm desturctor of class: MYCLASS
>>> I'm storing reference to self in class variable.
>>> It's programmer bug which should cause RT error.
>>>
>>> => o := myClass():new( 3 )
>>> Hi, I'm INIT method of class: MYCLASS
>>> => o:className() -> MYCLASS
>>> => o := NIL
>>> Hi, I'm desturctor of class: MYCLASS
>>> I'm storing reference to self in public variable.
>>> It's programmer bug which should cause RT error.
>>>
>>> Now object will be destroyed by GC
>>> ==================================
>>>
>>> => o := myClass():new( 0 )
>>> Hi, I'm INIT method of class: MYCLASS
>>> => o:className() -> MYCLASS
>>> => create corss reference: a := { o, nil }; a[2] := a; a := NIL
>>> => o := NIL
>>> => hb_gcAll()==3235== Invalid read of size 2
>>> ==3235== at 0x1BA95197: hb_gcItemRef (garbage.c:488)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADA is 18 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA95293: hb_gcItemRef (garbage.c:490)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73AE0 is 24 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== Invalid write of size 2
>>> ==3235== at 0x1BA95296: hb_gcItemRef (garbage.c:494)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADA is 18 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA9529F: hb_gcItemRef (garbage.c:497)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADC is 20 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA95144: hb_gcItemRef (garbage.c:476)
>>> ==3235== by 0x1BA952AF: hb_gcItemRef (garbage.c:503)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x0 is not stack'd, malloc'd or (recently) free'd
>>> ==3235==
>>> ==3235== Process terminating with default action of signal 11
>>> (SIGSEGV)
>>> ==3235== Access not within mapped region at address 0x0
>>> ==3235== at 0x1BA95144: hb_gcItemRef (garbage.c:476)
>>> ==3235== by 0x1BA952AF: hb_gcItemRef (garbage.c:503)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 20
>>> from 1)
>>> ==3235==
>>> ==3235== 1 errors in context 1 of 5:
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA95144: hb_gcItemRef (garbage.c:476)
>>> ==3235== by 0x1BA952AF: hb_gcItemRef (garbage.c:503)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x0 is not stack'd, malloc'd or (recently) free'd
>>> ==3235==
>>> ==3235== 1 errors in context 2 of 5:
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA9529F: hb_gcItemRef (garbage.c:497)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADC is 20 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== 1 errors in context 3 of 5:
>>> ==3235== Invalid write of size 2
>>> ==3235== at 0x1BA95296: hb_gcItemRef (garbage.c:494)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADA is 18 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== 1 errors in context 4 of 5:
>>> ==3235== Invalid read of size 4
>>> ==3235== at 0x1BA95293: hb_gcItemRef (garbage.c:490)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73AE0 is 24 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235==
>>> ==3235== 1 errors in context 5 of 5:
>>> ==3235== Invalid read of size 2
>>> ==3235== at 0x1BA95197: hb_gcItemRef (garbage.c:488)
>>> ==3235== by 0x1BA94BAF: hb_memvarsIsMemvarRef (memvars.c:2359)
>>> ==3235== by 0x1BA95355: hb_gcCollectAll (garbage.c:662)
>>> ==3235== by 0x1BA956D4: HB_FUN_HB_GCALL (garbage.c:940)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x80489AA: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> ==3235== Address 0x1BD73ADA is 18 bytes inside a block of size 52
>>> free'd
>>> ==3235== at 0x1B904FB1: free (vg_replace_malloc.c:153)
>>> ==3235== by 0x1BABDDA3: hb_arrayRelease (arrays.c:1487)
>>> ==3235== by 0x1BA9E8B4: hb_itemClear (fastitem.c:242)
>>> ==3235== by 0x1BA9E9E4: hb_itemForwardValue (fastitem.c:96)
>>> ==3235== by 0x1BAB0E15: hb_vmPopLocal (hvm.c:9475)
>>> ==3235== by 0x1BAA45BA: hb_vmExecute (hvm.c:3232)
>>> ==3235== by 0x804898C: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BAA372C: hb_vmExecute (hvm.c:1436)
>>> ==3235== by 0x804896E: (within /home/druzus/CVS/harbour/harbour/
>>> tests/destruct)
>>> ==3235== by 0x1BAB10A9: hb_vmDo (hvm.c:6988)
>>> ==3235== by 0x1BABB8BA: main (mainstd.c:82)
>>> --3235-- --3235-- supp: 20 Ugly strchr error in /lib/ld-2.3.3.so
>>> ==3235==
>>> ==3235== IN SUMMARY: 5 errors from 5 contexts (suppressed: 20
>>> from 1)
>>> ==3235==
>>> ==3235== malloc/free: in use at exit: 195422 bytes in 3579 blocks.
>>> ==3235== malloc/free: 6308 allocs, 2729 frees, 14100808 bytes
>>> allocated.
>>> ==3235==
>>> ==3235== searching for pointers to 3579 not-freed blocks.
>>> ==3235== checked 6959084 bytes.
>>> ==3235==
>>> ==3235== LEAK SUMMARY:
>>> ==3235== definitely lost: 0 bytes in 0 blocks.
>>> ==3235== possibly lost: 0 bytes in 0 blocks.
>>> ==3235== still reachable: 195422 bytes in 3579 blocks.
>>> ==3235== suppressed: 0 bytes in 0 blocks.
>>> ==3235== Reachable blocks (those to which a pointer was found) are
>>> not shown.
>>> ==3235== To see them, rerun with: --show-reachable=yes
>>> --3235-- TT/TC: 0 tc sectors discarded.
>>> --3235-- 6085 tt_fast misses.
>>> --3235-- translate: new 5888 (98191 -> 1365943; ratio 139:10)
>>> --3235-- discard 1 (23 -> 320; ratio 139:10).
>>> --3235-- chainings: 4218 chainings, 2 unchainings.
>>> --3235-- dispatch: 4352731 jumps (bb entries); of them 276952 (6%)
>>> unchained.
>>> --3235-- 358/12812 major/minor sched events.
>>> --3235-- reg-alloc: 955 t-req-spill, 252679+6836 orig+spill uis,
>>> --3235-- 29997 total-reg-rank
>>> --3235-- sanity: 264 cheap, 11 expensive checks.
>>> --3235-- ccalls: 28827 C calls, 59% saves+restores avoided
>>> (101518 bytes)
>>> --3235-- 38258 args, avg 0.87 setup instrs each (9476
>>> bytes)
>>> --3235-- 0% clear the stack (86337 bytes)
>>> --3235-- 9322 retvals, 29% of reg-reg movs avoided (5374
>>> bytes)
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> ----
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/
>> marketplace
>>
>> _______________________________________________
>> xHarbour-developers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/xharbour-developers
>>
>
--
__________
| | | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers