Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #34373] [PATCH] Parrot 0.1.2 with MinGW32

97 views
Skip to first unread message

François PERRAD)

unread,
Mar 8, 2005, 3:23:01 AM3/8/05
to bugs-bi...@rt.perl.org
# New Ticket Created by François PERRAD
# Please include the string: [perl #34373]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34373 >


--- parrot-0.1.2\PLATFORMS 2005-02-04 10:24:44.000000000 +0100
+++ PLATFORMS 2005-03-08 09:03:24.000000000 +0100
@@ -32,7 +32,7 @@
win32-bcc
win32-cygwin_1.5.11_1 Y Y - Y*5 Y Y Y 20041006
win32-icl_8.0.48 - Y - - - Y Y/2
-win32-mingw
+win32-mingw-gcc3.2.3 Y Y Y - - Y Y/7 20050307
win32-ms-cl_13.10.3077 - Y - - - Y Y/9 20041008

- ... no

sys.err
nci.err

Michal Jurosz

unread,
Mar 10, 2005, 1:15:55 PM3/10/05
to perl6-i...@perl.org
I am sorry for mystification. Without my cheat 'imcc/t/syn/file.t' fail too.

# --- imcc/t/syn/file.t ---

imcc/t/syn/file.....# Failed test (imcc/t/syn/file.t at line 388)
# got: 'error:imcc:No such file or directory
# in file 'temp.imc' line 2
# '
# expected: 'error:imcc:No such file or directory
# in file 'temp.imc' line 2
# '
# Looks like you failed 1 tests of 12.

Seems like carriage return ("\r\n" vs. "\n") problem.

--- imcc/t/syn/file.t, line 363
{ local $/; $err_msg = <FOO>; }
+ $err_msg =~ s/\r//g;

$ perl -Ilib imcc/t/syn/file.t
...
ok 11 - including a non-existent file
...


Michal Jurosz
ICQ#:93348414

Matt Diephouse

unread,
Mar 10, 2005, 1:47:06 PM3/10/05
to Michal Jurosz, perl6-i...@perl.org
On Thu, 10 Mar 2005 18:33:00 +0100, Michal Jurosz <rootm...@seznam.cz> wrote:
> Failed Test Status Wstat Total Fail Failed List of Failed
> --------------------------------------------------------------------------------
> imcc/t/imcpasm/opt1.t 1 256 49 1 2.04% 48
> t/dynclass/pybuiltin.t 5 1280 6 5 83.33% 1-2, 4-6
> t/dynclass/pyclass.t 6 1536 6 6 100.00% 1-6
> t/dynclass/pycomplex.t 1 256 1 1 100.00% 1
> t/dynclass/pyfunc.t 4 1024 4 4 100.00% 1-4
> t/dynclass/pyint.t 25 6400 25 25 100.00% 1-25
> t/native_pbc/integer.t 1 256 1 1 100.00% 1
> t/native_pbc/number.t 1 256 1 1 100.00% 1
> t/op/spawnw.t 2 512 3 2 66.67% 2-3
> t/pmc/object-meths.t 27 1 3.70% 19
> t/pmc/objects.t 60 2 3.33% 53, 57
> t/pmc/sys.t 1 256 1 1 100.00% 1
> 5 tests and 66 subtests skipped.
> Failed 12/136 test scripts, 91.18% okay. 50/2210 subtests failed, 97.74%
> okay

Some of these same tests are failing on debian, fedora, and freebsd
(fresh checkouts). It looks like someone broke something.

Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/dynclass/gdbmhash.t 13 3328 13 13 100.00% 1-13
t/dynclass/pybuiltin.t 5 1280 6 5 83.33% 1-2 4-6
t/dynclass/pyclass.t 6 1536 6 6 100.00% 1-6
t/dynclass/pycomplex.t 1 256 1 1 100.00% 1
t/dynclass/pyfunc.t 4 1024 4 4 100.00% 1-4
t/dynclass/pyint.t 25 6400 25 25 100.00% 1-25
2 tests and 63 subtests skipped.
Failed 6/136 test scripts, 95.59% okay. 54/2235 subtests failed, 97.58% okay.

--
matt diephouse
http://matt.diephouse.com

Michal Jurosz

unread,
Mar 10, 2005, 12:33:00 PM3/10/05
to perl6-i...@perl.org
Failed Test Status Wstat Total Fail Failed List of Failed
--------------------------------------------------------------------------------
imcc/t/imcpasm/opt1.t 1 256 49 1 2.04% 48
t/dynclass/pybuiltin.t 5 1280 6 5 83.33% 1-2, 4-6
t/dynclass/pyclass.t 6 1536 6 6 100.00% 1-6
t/dynclass/pycomplex.t 1 256 1 1 100.00% 1
t/dynclass/pyfunc.t 4 1024 4 4 100.00% 1-4
t/dynclass/pyint.t 25 6400 25 25 100.00% 1-25
t/native_pbc/integer.t 1 256 1 1 100.00% 1
t/native_pbc/number.t 1 256 1 1 100.00% 1
t/op/spawnw.t 2 512 3 2 66.67% 2-3
t/pmc/object-meths.t 27 1 3.70% 19
t/pmc/objects.t 60 2 3.33% 53, 57
t/pmc/sys.t 1 256 1 1 100.00% 1
5 tests and 66 subtests skipped.
Failed 12/136 test scripts, 91.18% okay. 50/2210 subtests failed, 97.74%
okay


# --- imcc/t/imcpasm/opt1.t ---

imcc/t/imcpasm/opt1.# Failed test (imcc/t/imcpasm/opt1.t at line 626)
# got: '_main:
# set N0, 1.6e+022
# end
# '
# expected: '_main:
# set N0, 1.6e+22
# end
# '
# Looks like you failed 1 tests of 49.

--- imcc/t/syn/file.t, line 363
{ local $/; $err_msg = <FOO>; }
+ $err_msg =~ s/\r//g;

$ perl -Ilib imcc/t/syn/file.t
...
ok 11 - including a non-existent file
...

# --- t/dynclass/ ---

t/dynclass/pybuiltin.# Failed test (t/dynclass/pybuiltin.t at line 22)
# got: ''
# expected: '31
# '

$ parrot.exe -t "t/dynclass/pybuiltin_1.imc"
10 lines compiled.
Running...
0 new_pad 0
2 new P30, "PyInt" - P30=PMCNULL,

$ echo "Any ideas?"

# --- t/native_pbc/integer.t ---
# --- t/native_pbc/number.t ---

t/native_pbc/integer.# Failed test (t/native_pbc/integer.t at line 51)
# got: 'Parrot VM: Can't locate
c:/usr/parrot-t/t/native_pbc/integer_1.pbc, code 2.
# main: Packfile loading failed


$ pwd
/c/usr/parrot-src

$ parrot.exe t/native_pbc/integer_1.pbc
270544960

$ parrot.exe /c/usr/parrot-src/t/native_pbc/integer_1.pbc
Parrot VM: Can't locate c:/usr/parrot-src/t/native_pbc/integer_1.pbc,
code 2.
main: Packfile loading failed

$ ls c:/usr/parrot-src/t/native_pbc/integer_1.*
c:/usr/parrot-src/t/native_pbc/integer_1.pbc

# same for:
parrot.exe "c:/usr/parrot-src/t/native_pbc/integer_1.pbc"
ls /c/usr/parrot-src/t/native_pbc/integer_1.*

echo "Seems like mingw/msys isssue."

# --- t/op/spawnw.t ---

t/op/spawnw.........# Failed test (t/op/spawnw.t at line 57)
# got: 'return code: 0
# '
# expected: 'return code: 123
# '
# Failed test (t/op/spawnw.t at line 71)
# got: 'return code: 0
# '
# expected: 'return code: 3
# '
# Looks like you failed 2 tests of 3.

# --- t/pmc/object-meths.t ---

t/pmc/object-meths..FAILED test 19

not ok 19 - constructor - diamond parents # TODO wrong init order?
# Failed (TODO) test (t/pmc/object-meths.t at line 519)

...
# get E init expected E
# get D init expected A
# get B init expected D
# get A init expected B
# get C init expected C
# get F init expected F

$ echo "Move A after E. :-)"

# --- t/pmc/objects.t ---

t/pmc/objects.......FAILED tests 53, 57

not ok 53 - PMC as classes - derived 3 # TODO methods can't be
overridden in derived class only
# Failed (TODO) test (t/pmc/objects.t at line 1660)

not ok 57 - __init argcP # TODO new Px, Ix: argcP is wrong in __init method
# Failed (TODO) test (t/pmc/objects.t at line 1800)

# --- t/pmc/sys ---

t/pmc/sys...........# Failed test (t/pmc/sys.t at line 26)
# got: '. Not found ...

--- config_lib.pasm
- set P0["slash"], "/"
+ set P0["slash"], "\\"
$ parrot config_lib.pasm

$ parrot.exe t/pmc/sys_1.imc
Hello, World!
0

So seems like Parrot_run_slash != MinGW_build_slash. Because I still
need Configure::Data->set( slash => '/' ); inside
config\init\mswin32.pl to properly build.


# --- Some other ideas: ---

$ perl -e "print $^O"
msys

--- config\init\hints.pl
sub runstep {
+ my $O = lc($^O);
+ $O = 'mswin32' if $O =~ /^(msys|mingw)/;
- my $hints = "config/init/hints/" . lc($^O) . ".pl";
+ my $hints = "config/init/hints/" . $O . ".pl";


S pozdravem Michal Jurosz
http://xrl.us/fddn

psinn...@aol.com

unread,
Mar 10, 2005, 4:36:24 PM3/10/05
to ma...@diephouse.com, Michal Jurosz, perl6-i...@perl.org
> Some of these same tests are failing on debian, fedora, and freebsd
> (fresh checkouts). It looks like someone broke something.

Seems to have went all wrong between 20:35 and 21:35 on 9th(gmt).
With only the loosest understanding of stuff I think ( a little knowledge can be a dangerous thing) it may be related to

pmc.c

revision 1.95
date: 2005/03/09 14:52:01; author: leo; state: Exp; lines: +2 -2
Objects 1 - class, mro vtable slots

* renamed vtable->data to class as this is it's usage anyway
* new vtable->mro slot - empty for now

Chromatic

unread,
Mar 10, 2005, 4:52:51 PM3/10/05
to psinn...@aol.com, ma...@diephouse.com, Michal Jurosz, perl6-i...@perl.org
On Thu, 2005-03-10 at 16:36 -0500, psinn...@aol.com wrote:

> Seems to have went all wrong between 20:35 and 21:35 on 9th(gmt).
> With only the loosest understanding of stuff I think ( a little
> knowledge can be a dangerous thing) it may be related to
>
> pmc.c
>
> revision 1.95
> date: 2005/03/09 14:52:01; author: leo; state: Exp; lines: +2 -2
> Objects 1 - class, mro vtable slots
>
> * renamed vtable->data to class as this is it's usage anyway
> * new vtable->mro slot - empty for now

That's my guess too. It segfaults for me during make:

If the next line prints 0.1.2-devel, it did help.
./parrot parrot-config.imc VERSION DEVEL
make: *** [runtime/parrot/include/config.fpmc] Segmentation fault
make: *** Deleting file `runtime/parrot/include/config.fpmc'

The parrot trace is:

$ parrot -t parrot-config.imc VERSION DEVEL
0 set P15, P5 - P15=PMCNULL, P5=SArray=PMC(0x1054bf78)
3 set I14, P15 - I14=0, P15=SArray=PMC(0x1054bf78)
6 lt I14, 2, 97 - I14=3, ,
10 set P14, PMC_C[12] - P14=PMCNULL,
13 set I0, 1 - I0=0,
16 set I1, 0 - I1=0,
19 set I2, 0 - I2=0,
22 set I3, 0 - I3=1,
25 set I4, 0 - I4=0,
28 set P0, P14 - P0=PMCNULL, P14=Sub=PMC(0x1054bf90
Adr:0x105ed9cc)
31 invokecc
# Calling sub '_config'
# in file 'parrot-config.imc' near line 32
113 open P15, "runtime/parrot/inclu", "<" - P15=PMCNULL, ,
117 defined I30, P15 - I30=0, P15=ParrotIO=PMC(0x1054bf30)
120 if I30, 17 - I30=1,
137 read S30, P15, 60000 - , P15=ParrotIO=PMC(0x1054bf30),
141 close P15 - P15=ParrotIO=PMC(0x1054bf30)
143 thaw P30, S30 - P30=PMCNULL, S30="(null)"

The backtrace is:

#0 0x100aff70 in pobject_lives (interpreter=0x1038e678, obj=0x35)
at src/dod.c:196
#1 0x1026920c in Parrot_SArray_mark (interpreter=0x1038e678,
pmc=0x1054d748)
at classes/sarray.c:276
#2 0x100b05c4 in Parrot_dod_trace_children (interpreter=0x1038e678,
how_many=4294967295) at src/dod.c:460
#3 0x100b037c in trace_active_PMCs (interpreter=0x1038e678,
trace_stack=1)
at src/dod.c:378
#4 0x100b1188 in Parrot_dod_ms_run (interpreter=0x1038e678, flags=1)
at src/dod.c:1200
#5 0x100b12a8 in Parrot_do_dod_run (interpreter=0x1038e678, flags=1)
at src/dod.c:1239
#6 0x10142c0c in mem_allocate (interpreter=0x1038e678,
req_size=0x7ffff174,
pool=0x103aec80, align_1=15) at src/resources.c:142
#7 0x10143ab0 in Parrot_allocate_string (interpreter=0x1038e678,
str=0x105e4e98, size=1061) at src/resources.c:613
#8 0x10062e04 in string_make_direct (interpreter=0x1038e678,
buffer=0x105d2198, len=1061, encoding=0x103aee88,
charset=0x103aef28,
flags=131072) at src/string.c:668
...

I set a breakpoint near #1:

Breakpoint 1, Parrot_SArray_mark (interpreter=0x1038e678,
pmc=0x1054d748)
at classes/sarray.c:275
275 if (UVal_pmc(e->val))
(gdb) p e
$1 = (HashEntry *) 0x10555298
(gdb) p e->val
$2 = {_b = {_bufstart = 0x0, _buflen = 53}, _ptrs = {_struct_val = 0x0,
_pmc_val = 0x35}, _i = {_int_val = 0, _int_val2 = 53},
_num_val = 2.6185479229586067e-322, _string_val = 0x0}
(gdb) x interpreter
0x1038e678: 0x30893ae8
(gdb) p interpreter
$3 = (Interp *) 0x1038e678
(gdb) p e->val
$4 = {_b = {_bufstart = 0x0, _buflen = 53}, _ptrs = {_struct_val = 0x0,
_pmc_val = 0x35}, _i = {_int_val = 0, _int_val2 = 53},
_num_val = 2.6185479229586067e-322, _string_val = 0x0}
(gdb) p 0x35
$5 = 53
(gdb) p (PObj*) 0x35
$6 = (Buffer *) 0x35

-- c

psinn...@aol.com

unread,
Mar 10, 2005, 6:26:41 PM3/10/05
to chro...@wgz.org, perl6-i...@perl.org
Strangely all the tests ( well pyclass pycomplex and pyfunc so far )
pass on freebsd but do so
very very slowly and parrot is eating memory like there is no
tomorrow. Gets above 300meg during
each of the tests. Not sure if this is new as its a long time since I
tried parrot on freebsd.

Leopold Toetsch

unread,
Mar 10, 2005, 4:23:07 PM3/10/05
to ma...@diephouse.com, perl6-i...@perl.org
Matt Diephouse <mdd...@gmail.com> wrote:

> Some of these same tests are failing on debian, fedora, and freebsd
> (fresh checkouts). It looks like someone broke something.

Release or current CVS?

leo

Matt Diephouse

unread,
Mar 11, 2005, 2:23:21 AM3/11/05
to l...@toetsch.at, perl6-i...@perl.org

Current CVS.

Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------

t/dynclass/foo.t 1 256 1 1 100.00% 1


t/dynclass/gdbmhash.t 13 3328 13 13 100.00% 1-13
t/dynclass/pybuiltin.t 5 1280 6 5 83.33% 1-2 4-6
t/dynclass/pyclass.t 6 1536 6 6 100.00% 1-6
t/dynclass/pycomplex.t 1 256 1 1 100.00% 1
t/dynclass/pyfunc.t 4 1024 4 4 100.00% 1-4
t/dynclass/pyint.t 25 6400 25 25 100.00% 1-25

matt@mendelssohn:~/parrot$ ./parrot -t --gc-debug
"/home/matt/parrot/t/dynclass/pyint_10.imc" > trace.log
0 loadlib P1, "python_group" -
P1=RetContinuation=PMC(0x849e848 Adr:0x0),
Segmentation fault

Leopold Toetsch

unread,
Mar 11, 2005, 4:19:55 AM3/11/05
to ma...@diephouse.com, perl6-i...@perl.org
Matt Diephouse wrote:
> On Thu, 10 Mar 2005 22:23:07 +0100, Leopold Toetsch <l...@toetsch.at> wrote:
>
>>Matt Diephouse <mdd...@gmail.com> wrote:
>>
>>
>>>Some of these same tests are failing on debian, fedora, and freebsd
>>>(fresh checkouts). It looks like someone broke something.
>>
>>Release or current CVS?
>
>
> Current CVS.
>
> Failed Test Stat Wstat Total Fail Failed List of Failed
> -------------------------------------------------------------------------------
> t/dynclass/foo.t 1 256 1 1 100.00% 1

Is there any chance that parrot picked up an old installed version of
the shared libs?

If you have done "make install" once and Configured with the defaults
you continue running the installed version of the shared libs.

Work around: either delete the installed tree or

perl Configure.pl --prefix=$(pwd)

leo

Leopold Toetsch

unread,
Mar 11, 2005, 4:38:18 AM3/11/05
to Michal Jurosz, perl6-i...@perl.org
Michal Jurosz <rootm...@seznam.cz> wrote:
> Failed Test Status Wstat Total Fail Failed List of Failed

[ 50 failing ]

> imcc/t/imcpasm/opt1.# Failed test (imcc/t/imcpasm/opt1.t at line 626)
> # got: '_main:
> # set N0, 1.6e+022
> # end
> # '
> # expected: '_main:
> # set N0, 1.6e+22

The test could include C< 0? >.


> --- imcc/t/syn/file.t, line 363
> { local $/; $err_msg = <FOO>; }
> + $err_msg =~ s/\r//g;

Could you please provide one patch for items like above, thanks.

> t/dynclass/pybuiltin.# Failed test (t/dynclass/pybuiltin.t at line 22)

dynclasses/* are currently failing on windows due to missing exported
symbols.

> t/native_pbc/integer.# Failed test (t/native_pbc/integer.t at line 51)
> # got: 'Parrot VM: Can't locate
> c:/usr/parrot-t/t/native_pbc/integer_1.pbc, code 2.
> # main: Packfile loading failed

Strange. Can you run that through a debugger?

> t/op/spawnw.........# Failed test (t/op/spawnw.t at line 57)
> # got: 'return code: 0
> # '
> # expected: 'return code: 123

The win32:Parrot_Run_OS_Command could be the culprit (see
src/platform.c, which is constructed from various platform files
mentioned there as comments)

> not ok 19 - constructor - diamond parents # TODO wrong init order?
> # Failed (TODO) test (t/pmc/object-meths.t at line 519)

That's an TODO test, but already fixed in CVS.

> # Failed (TODO) test (t/pmc/objects.t at line 1660)

TODO's are supposed to fail.

> # --- t/pmc/sys ---

> t/pmc/sys...........# Failed test (t/pmc/sys.t at line 26)
> # got: '. Not found ...

> --- config_lib.pasm
> - set P0["slash"], "/"
> + set P0["slash"], "\\"
> $ parrot config_lib.pasm

No. This file is generated and should contain the current setting of
$Pconfig{slash} - see also lib/Parrot/Config.pm.

> $ parrot.exe t/pmc/sys_1.imc
> Hello, World!
> 0

> So seems like Parrot_run_slash != MinGW_build_slash. Because I still
> need Configure::Data->set( slash => '/' ); inside
> config\init\mswin32.pl to properly build.

What is the difference between these two slashes - looks strange.

> # --- Some other ideas: ---

> $ perl -e "print $^O"
> msys

> --- config\init\hints.pl
> sub runstep {
> + my $O = lc($^O);
> + $O = 'mswin32' if $O =~ /^(msys|mingw)/;
> - my $hints = "config/init/hints/" . lc($^O) . ".pl";
> + my $hints = "config/init/hints/" . $O . ".pl";

This would make MinGW in all aspects identical to a native window build,
wouldn't it? Seems dangerous.


> S pozdravem Michal Jurosz

Thanks for the detailed report,

It would be great if folks with windows installed could have a look at
these issues.

leo

Peter Sinnott

unread,
Mar 11, 2005, 6:02:10 AM3/11/05
to Leopold Toetsch, ma...@diephouse.com, perl6-i...@perl.org

I dont think I have ever done a make install of parrot. I tried the
above configure with a fresh checkout from cvs. The tests are still
failing but not I get :

I think this is the same behaviour I was getting with freebsd last night
and on the machine I have connected to my tinderbox. The machine at work
(which I did this compile on) has less memory than the freebsd or
home pc.

# '(cd . && ./parrot --gc-debug
# "/tmp/foo/parrot/t/dynclass/pyint_22.imc")' failed with exit code 131
t/dynclass/pyint...............NOK 22# Failed test
(t/dynclass/pyint.t at line 548)
# got: 'Parrot VM: PANIC: Out of mem!
# C file src/memory.c, line 45
# Parrot file (not available), line (not available)
#
# We highly suggest you notify the Parrot team if you have not been
# working on
# Parrot. Use parrotbug (located in parrot's root directory) or send an
# e-mail to perl6-i...@perl.org.
# Include the entire text of this error message and the text of the
# script that
# generated the error. If you've made any modifications to Parrot,
# please
# describe them as well.
#
# Version : 0.1.2-devel
# Configured : Fri Mar 11 10:31:33 2005
# Architecture: i386-linux
# JIT Capable : Yes
# Interp Flags: (no interpreter)
# Exceptions : (missing from core)
#
# Dumping Core...


--
Our goal is to continually integrate world-class opportunities to allow
us to synergistically network interdependent methods of empowerment to
meet our customer's needs

Leopold Toetsch

unread,
Mar 11, 2005, 5:26:09 AM3/11/05
to psinn...@aol.com, perl6-i...@perl.org
psinn...@aol.com wrote:
> Strangely all the tests ( well pyclass pycomplex and pyfunc so far )
> pass on freebsd but do so
> very very slowly and parrot is eating memory like there is no tomorrow.
> Gets above 300meg during
> each of the tests.

That's really strange. During make test top shows around 5 Meg for
parrot here on my linux box.

leo

Peter Sinnott

unread,
Mar 11, 2005, 9:42:58 AM3/11/05
to Leopold Toetsch, psinn...@aol.com, perl6-i...@perl.org

Probably should have tried this earlier but I have a little too
much faith in compilers. When I use gcc-2.95 it works(well all
tests pass) and memory is ok. With gcc-3.3 the tests fail
and memory usage is way up. The freebsd gcc is also 3.3.3 so the
problem doesn't seem to be debian/linux/bsd related but instead
a compiler issue.

Matt Diephouse

unread,
Mar 11, 2005, 10:00:16 AM3/11/05
to Leopold Toetsch, perl6-i...@perl.org
Leopold Toetsch <l...@toetsch.at> wrote:
> Is there any chance that parrot picked up an old installed version of
> the shared libs?
>
> If you have done "make install" once and Configured with the defaults
> you continue running the installed version of the shared libs.

I have never run "make install" and this was built in a fresh directory.



> Work around: either delete the installed tree or
>
> perl Configure.pl --prefix=$(pwd)

Configuring a prefix doesn't solve the problem.

Matt Diephouse

unread,
Mar 11, 2005, 10:05:21 AM3/11/05
to Peter Sinnott, Leopold Toetsch, perl6-i...@perl.org
Peter Sinnott <psinn...@aol.com> wrote:
>
> Probably should have tried this earlier but I have a little too
> much faith in compilers. When I use gcc-2.95 it works(well all
> tests pass) and memory is ok. With gcc-3.3 the tests fail
> and memory usage is way up. The freebsd gcc is also 3.3.3 so the
> problem doesn't seem to be debian/linux/bsd related but instead
> a compiler issue.

I'm using gcc 3.3.4.

Leopold Toetsch

unread,
Mar 11, 2005, 12:11:25 PM3/11/05
to Peter Sinnott, perl6-i...@perl.org
Peter Sinnott wrote:

[ ~300 Meg memory in t/dynclasses used ]

> Probably should have tried this earlier but I have a little too
> much faith in compilers. When I use gcc-2.95 it works(well all
> tests pass) and memory is ok. With gcc-3.3 the tests fail
> and memory usage is way up. The freebsd gcc is also 3.3.3 so the
> problem doesn't seem to be debian/linux/bsd related but instead
> a compiler issue.

Yeah. I've now compiled it on my old linux notebook, which has gcc 3.3.3
- same problem.

What I've so far is:

(gdb)
mmd_register (interpreter=0x82dfce8, function=51, left_type=74,
right_type=74,
funcptr=0x81405a0 <Parrot_default_bitwise_xors>) at src/mmd.c:585
585 offset = table->x * right_type + left_type;
1: *table = {mmd_funcs = 0x83d7bb0, x = 75, y = 75,
default_func = 0x80e5000 <mmd_fallback_stringxor_pmc>, funcs_in_table
= 0}
(gdb)
586 table->mmd_funcs[offset] = funcptr;
1: *table = {mmd_funcs = 0x83d7bb0, x = 75, y = 75,
default_func = 0x80e5000 <mmd_fallback_stringxor_pmc>, funcs_in_table
= 0}
(gdb)
587 }
1: *table = {mmd_funcs = 0x83d7bb0, x = 75, y = 75,
default_func = 0x80e5000 <mmd_fallback_stringxor_pmc>, funcs_in_table
= 0}
(gdb)
Parrot_mmd_register_parents (interpreter=0x82dfce8, type=74,
mmd_table=0xbffff430, n=53)
at src/pmc.c:502
502 for (i = 0; i < n; ++i) {
(gdb)
503 if (!mmd_table[i].right)
(gdb)
504 mmd_register(interpreter,
(gdb)

Breakpoint 3, mmd_register (interpreter=0x82dfce8, function=52,
left_type=74, right_type=74,
funcptr=0x81405c0 <Parrot_default_bitwise_xors_str>) at src/mmd.c:577
577 if ((INTVAL)table->x <= left_type) {
1: *table = {mmd_funcs = 0x83dda90, x = 74, y = 262218,
default_func = 0x80e5070 <mmd_fallback_stringxor_str>, funcs_in_table
= 0}

This is during registering the Foo classes* MMDs, please note the value
of table->y in the last line. The value did change just between leaving
the last mmd_register and entering the failing mmd_register.

Remarkable is that this is the last (highest) function number, and that
there is no other memory allocation in betweeen. And it seems to happen
with --gc-debug only. Seems to be a memory corruption somewhere else.

More strange is, that my patch didn't touch any memory related things,
it just increased the vtable structure by on item.

Can someone run this through valgrind or some other memory debugger please.

Above gdb snippet is from:

(gdb) bac
#0 mmd_register (interpreter=0x82dfce8, function=52, left_type=74,
right_type=74,
funcptr=0x81405c0 <Parrot_default_bitwise_xors_str>) at src/mmd.c:577
#1 0x080aa1dc in Parrot_mmd_register_parents (interpreter=0x82dfce8,
type=74,
mmd_table=0xbffff430, n=53) at src/pmc.c:504
#2 0x4001d726 in Parrot_Foo_class_init (interp=0x82dfce8, entry=74,
pass=1) at foo.c:328
#3 0x4001d7a5 in Parrot_lib_foo_load (interpreter=0x82dfce8) at foo.c:362
#4 0x080e274e in Parrot_init_lib (interpreter=0x82dfce8,
load_func=0x4001d740 <Parrot_lib_foo_load>, init_func=0) at
src/dynext.c:258
#5 0x080e28b4 in Parrot_load_lib (interpreter=0x82dfce8, lib=0x8309208,
initializer=0x0)
at src/dynext.c:322
#6 0x080f9066 in Parrot_loadlib_p_sc (cur_opcode=0x8517320,
interpreter=0x82dfce8)
at core.ops:1149

You reach it by first setting a breakpoint at Parrot_load_lib, then
stepping over the actual library loading, then "b mmd_register".

leo

Nicholas Clark

unread,
Mar 11, 2005, 12:45:59 PM3/11/05
to Leopold Toetsch, Peter Sinnott, perl6-i...@perl.org
On Fri, Mar 11, 2005 at 06:11:25PM +0100, Leopold Toetsch wrote:
> Peter Sinnott wrote:

> Can someone run this through valgrind or some other memory debugger please.

I'm not sure if this test is the one you want. The fun output is near the
end.

$ valgrind ./parrot --gc-debug "/home/nick/Parrot/parrot00/t/dynclass/foo_1.imc"
==30839== Memcheck, a memory error detector for x86-linux.
==30839== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==30839== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==30839== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==30839== For more details, rerun with: -v
==30839==
==30839== warning: Valgrind's pthread_attr_destroy does nothing
==30839== your program may misbehave as a result
==30839== warning: Valgrind's pthread_attr_destroy does nothing
==30839== your program may misbehave as a result
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DD60E: trace_mem_block (dod.c:994)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839== by 0x80DCF1A: Parrot_dod_trace_root (dod.c:362)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DD61C: trace_mem_block (dod.c:999)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839== by 0x80DCF1A: Parrot_dod_trace_root (dod.c:362)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DD654: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839== by 0x80DCF1A: Parrot_dod_trace_root (dod.c:362)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DD624: trace_mem_block (dod.c:999)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839== by 0x80DCF1A: Parrot_dod_trace_root (dod.c:362)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB958: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC6EC: is_pmc_ptr (headers.c:540)
==30839== by 0x80DD633: trace_mem_block (dod.c:999)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB969: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC6EC: is_pmc_ptr (headers.c:540)
==30839== by 0x80DD633: trace_mem_block (dod.c:999)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB986: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC6EC: is_pmc_ptr (headers.c:540)
==30839== by 0x80DD633: trace_mem_block (dod.c:999)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC49: pobject_lives (dod.c:196)
==30839== by 0x80DD648: trace_mem_block (dod.c:1004)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DD65C: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839== by 0x80DCF1A: Parrot_dod_trace_root (dod.c:362)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB958: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC642: is_buffer_ptr (headers.c:512)
==30839== by 0x80DD66B: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB969: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC642: is_buffer_ptr (headers.c:512)
==30839== by 0x80DD66B: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB958: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC69D: is_buffer_ptr (headers.c:517)
==30839== by 0x80DD66B: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB969: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC69D: is_buffer_ptr (headers.c:517)
==30839== by 0x80DD66B: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x80DB986: contained_in_pool (smallobject.c:55)
==30839== by 0x80DC642: is_buffer_ptr (headers.c:512)
==30839== by 0x80DD66B: trace_mem_block (dod.c:1006)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC49: pobject_lives (dod.c:196)
==30839== by 0x80DD680: trace_mem_block (dod.c:1010)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC5D: pobject_lives (dod.c:210)
==30839== by 0x80DD680: trace_mem_block (dod.c:1010)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC65: pobject_lives (dod.c:210)
==30839== by 0x80DD680: trace_mem_block (dod.c:1010)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC6B: pobject_lives (dod.c:215)
==30839== by 0x80DD680: trace_mem_block (dod.c:1010)
==30839== by 0x80DF933: trace_system_stack (cpu_dep.c:117)
==30839== by 0x80DF901: trace_system_areas (cpu_dep.c:98)
==30839==
==30839== Conditional jump or move depends on uninitialised value(s)
==30839== at 0x81E67EC: Parrot_SArray_mark (sarray.c:275)
==30839== by 0x80DD135: Parrot_dod_trace_children (dod.c:460)
==30839== by 0x80DCF90: trace_active_PMCs (dod.c:378)
==30839== by 0x80DD919: Parrot_dod_ms_run (dod.c:1200)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC49: pobject_lives (dod.c:196)
==30839== by 0x81E67FE: Parrot_SArray_mark (sarray.c:276)
==30839== by 0x80DD135: Parrot_dod_trace_children (dod.c:460)
==30839== by 0x80DCF90: trace_active_PMCs (dod.c:378)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC5D: pobject_lives (dod.c:210)
==30839== by 0x81E67FE: Parrot_SArray_mark (sarray.c:276)
==30839== by 0x80DD135: Parrot_dod_trace_children (dod.c:460)
==30839== by 0x80DCF90: trace_active_PMCs (dod.c:378)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC65: pobject_lives (dod.c:210)
==30839== by 0x81E67FE: Parrot_SArray_mark (sarray.c:276)
==30839== by 0x80DD135: Parrot_dod_trace_children (dod.c:460)
==30839== by 0x80DCF90: trace_active_PMCs (dod.c:378)
==30839==
==30839== Use of uninitialised value of size 4
==30839== at 0x80DCC6B: pobject_lives (dod.c:215)
==30839== by 0x81E67FE: Parrot_SArray_mark (sarray.c:276)
==30839== by 0x80DD135: Parrot_dod_trace_children (dod.c:460)
==30839== by 0x80DCF90: trace_active_PMCs (dod.c:378)
==30839==
==30839== Invalid read of size 1
==30839== at 0x1B904AE0: memcpy (mac_replace_strmem.c:285)
==30839== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30839== by 0x80E389C: mmd_register (mmd.c:578)
==30839== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30839== Address 0x1C4CE5E7 is 1 bytes before a block of size 21904 alloc'd
==30839== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30839== by 0x809E240: mem_sys_allocate (memory.c:43)
==30839== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30839== by 0x80E38BD: mmd_register (mmd.c:582)
==30839==
==30839== Invalid read of size 1
==30839== at 0x1B904AEA: memcpy (mac_replace_strmem.c:286)
==30839== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30839== by 0x80E389C: mmd_register (mmd.c:578)
==30839== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30839== Address 0x1C4CE5E6 is 2 bytes before a block of size 21904 alloc'd
==30839== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30839== by 0x809E240: mem_sys_allocate (memory.c:43)
==30839== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30839== by 0x80E38BD: mmd_register (mmd.c:582)
==30839==
==30839== Invalid read of size 1
==30839== at 0x1B904AF1: memcpy (mac_replace_strmem.c:287)
==30839== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30839== by 0x80E389C: mmd_register (mmd.c:578)
==30839== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30839== Address 0x1C4CE5E5 is 3 bytes before a block of size 21904 alloc'd
==30839== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30839== by 0x809E240: mem_sys_allocate (memory.c:43)
==30839== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30839== by 0x80E38BD: mmd_register (mmd.c:582)
==30839==
==30839== Invalid read of size 1
==30839== at 0x1B904AF8: memcpy (mac_replace_strmem.c:288)
==30839== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30839== by 0x80E389C: mmd_register (mmd.c:578)
==30839== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30839== Address 0x1C4CE5E4 is 4 bytes before a block of size 21904 alloc'd
==30839== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30839== by 0x809E240: mem_sys_allocate (memory.c:43)
==30839== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30839== by 0x80E38BD: mmd_register (mmd.c:582)
==30839==
==30839== Process terminating with default action of signal 11 (SIGSEGV)
==30839== Access not within mapped region at address 0x1C5C90BF
==30839== at 0x1B904AE0: memcpy (mac_replace_strmem.c:285)
==30839== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30839== by 0x80E389C: mmd_register (mmd.c:578)
==30839== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30839==
==30839== ERROR SUMMARY: 15977 errors from 27 contexts (suppressed: 31 from 1)
==30839== malloc/free: in use at exit: 81418001 bytes in 2142 blocks.
==30839== malloc/free: 2320 allocs, 178 frees, 83183573 bytes allocated.
==30839== For a detailed leak analysis, rerun with: --leak-check=yes
==30839== For counts of detected errors, rerun with: -v
Segmentation fault


The process runs, then there's a pause, then there's more output leading to
the SEGV. After the pause, the output (with lots more callers) is:


==30847==
==30847== Invalid read of size 1
==30847== at 0x1B904AE0: memcpy (mac_replace_strmem.c:285)
==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30847== by 0x80E389C: mmd_register (mmd.c:578)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x1C8D8725: Parrot_Foo_class_init (foo.c:328)
==30847== by 0x1C8D87A4: Parrot_lib_foo_load (foo.c:362)
==30847== by 0x80E21DD: Parrot_init_lib (dynext.c:258)
==30847== by 0x80E2343: Parrot_load_lib (dynext.c:322)
==30847== by 0x80F8AF5: Parrot_loadlib_p_sc (core.ops:1149)
==30847== by 0x816614B: runops_slow_core (runops_cores.c:147)
==30847== by 0x8164627: runops_int (interpreter.c:742)
==30847== by 0x8165474: runops (inter_run.c:81)
==30847== by 0x80D6B73: Parrot_runcode (embed.c:768)
==30847== by 0x80D69B1: Parrot_runcode (embed.c:700)
==30847== by 0x809D040: main (main.c:603)
==30847== Address 0x1C4CE5E7 is 1 bytes before a block of size 21904 alloc'd
==30847== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30847== by 0x809E240: mem_sys_allocate (memory.c:43)
==30847== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30847== by 0x80E38BD: mmd_register (mmd.c:582)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x81F67A7: Parrot_Undef_class_init (undef.c:433)
==30847== by 0x8168AD8: Parrot_initialize_core_pmcs (core_pmcs.c:92)
==30847== by 0x8163842: init_world (global_setup.c:71)
==30847== by 0x80D5D69: Parrot_init (embed.c:84)
==30847== by 0x809D250: make_interpreter (inter_create.c:156)
==30847== by 0x80D5D32: Parrot_new (embed.c:47)
==30847== by 0x809C880: main (main.c:416)
==30847==
==30847== Invalid read of size 1
==30847== at 0x1B904AEA: memcpy (mac_replace_strmem.c:286)
==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30847== by 0x80E389C: mmd_register (mmd.c:578)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x1C8D8725: Parrot_Foo_class_init (foo.c:328)
==30847== by 0x1C8D87A4: Parrot_lib_foo_load (foo.c:362)
==30847== by 0x80E21DD: Parrot_init_lib (dynext.c:258)
==30847== by 0x80E2343: Parrot_load_lib (dynext.c:322)
==30847== by 0x80F8AF5: Parrot_loadlib_p_sc (core.ops:1149)
==30847== by 0x816614B: runops_slow_core (runops_cores.c:147)
==30847== by 0x8164627: runops_int (interpreter.c:742)
==30847== by 0x8165474: runops (inter_run.c:81)
==30847== by 0x80D6B73: Parrot_runcode (embed.c:768)
==30847== by 0x80D69B1: Parrot_runcode (embed.c:700)
==30847== by 0x809D040: main (main.c:603)
==30847== Address 0x1C4CE5E6 is 2 bytes before a block of size 21904 alloc'd
==30847== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30847== by 0x809E240: mem_sys_allocate (memory.c:43)
==30847== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30847== by 0x80E38BD: mmd_register (mmd.c:582)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x81F67A7: Parrot_Undef_class_init (undef.c:433)
==30847== by 0x8168AD8: Parrot_initialize_core_pmcs (core_pmcs.c:92)
==30847== by 0x8163842: init_world (global_setup.c:71)
==30847== by 0x80D5D69: Parrot_init (embed.c:84)
==30847== by 0x809D250: make_interpreter (inter_create.c:156)
==30847== by 0x80D5D32: Parrot_new (embed.c:47)
==30847== by 0x809C880: main (main.c:416)
==30847==
==30847== Invalid read of size 1
==30847== at 0x1B904AF1: memcpy (mac_replace_strmem.c:287)
==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30847== by 0x80E389C: mmd_register (mmd.c:578)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x1C8D8725: Parrot_Foo_class_init (foo.c:328)
==30847== by 0x1C8D87A4: Parrot_lib_foo_load (foo.c:362)
==30847== by 0x80E21DD: Parrot_init_lib (dynext.c:258)
==30847== by 0x80E2343: Parrot_load_lib (dynext.c:322)
==30847== by 0x80F8AF5: Parrot_loadlib_p_sc (core.ops:1149)
==30847== by 0x816614B: runops_slow_core (runops_cores.c:147)
==30847== by 0x8164627: runops_int (interpreter.c:742)
==30847== by 0x8165474: runops (inter_run.c:81)
==30847== by 0x80D6B73: Parrot_runcode (embed.c:768)
==30847== by 0x80D69B1: Parrot_runcode (embed.c:700)
==30847== by 0x809D040: main (main.c:603)
==30847== Address 0x1C4CE5E5 is 3 bytes before a block of size 21904 alloc'd
==30847== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30847== by 0x809E240: mem_sys_allocate (memory.c:43)
==30847== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30847== by 0x80E38BD: mmd_register (mmd.c:582)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x81F67A7: Parrot_Undef_class_init (undef.c:433)
==30847== by 0x8168AD8: Parrot_initialize_core_pmcs (core_pmcs.c:92)
==30847== by 0x8163842: init_world (global_setup.c:71)
==30847== by 0x80D5D69: Parrot_init (embed.c:84)
==30847== by 0x809D250: make_interpreter (inter_create.c:156)
==30847== by 0x80D5D32: Parrot_new (embed.c:47)
==30847== by 0x809C880: main (main.c:416)
==30847==
==30847== Invalid read of size 1
==30847== at 0x1B904AF8: memcpy (mac_replace_strmem.c:288)
==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30847== by 0x80E389C: mmd_register (mmd.c:578)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x1C8D8725: Parrot_Foo_class_init (foo.c:328)
==30847== by 0x1C8D87A4: Parrot_lib_foo_load (foo.c:362)
==30847== by 0x80E21DD: Parrot_init_lib (dynext.c:258)
==30847== by 0x80E2343: Parrot_load_lib (dynext.c:322)
==30847== by 0x80F8AF5: Parrot_loadlib_p_sc (core.ops:1149)
==30847== by 0x816614B: runops_slow_core (runops_cores.c:147)
==30847== by 0x8164627: runops_int (interpreter.c:742)
==30847== by 0x8165474: runops (inter_run.c:81)
==30847== by 0x80D6B73: Parrot_runcode (embed.c:768)
==30847== by 0x80D69B1: Parrot_runcode (embed.c:700)
==30847== by 0x809D040: main (main.c:603)
==30847== Address 0x1C4CE5E4 is 4 bytes before a block of size 21904 alloc'd
==30847== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==30847== by 0x809E240: mem_sys_allocate (memory.c:43)
==30847== by 0x80E375C: mmd_expand_y (mmd.c:468)
==30847== by 0x80E38BD: mmd_register (mmd.c:582)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x81F67A7: Parrot_Undef_class_init (undef.c:433)
==30847== by 0x8168AD8: Parrot_initialize_core_pmcs (core_pmcs.c:92)
==30847== by 0x8163842: init_world (global_setup.c:71)
==30847== by 0x80D5D69: Parrot_init (embed.c:84)
==30847== by 0x809D250: make_interpreter (inter_create.c:156)
==30847== by 0x80D5D32: Parrot_new (embed.c:47)
==30847== by 0x809C880: main (main.c:416)
==30847==
==30847== Process terminating with default action of signal 11 (SIGSEGV)
==30847== Access not within mapped region at address 0x1C5C90BF
==30847== at 0x1B904AE0: memcpy (mac_replace_strmem.c:285)
==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)
==30847== by 0x80E389C: mmd_register (mmd.c:578)
==30847== by 0x80A9C5B: Parrot_mmd_register_parents (pmc.c:504)
==30847== by 0x1C8D8725: Parrot_Foo_class_init (foo.c:328)
==30847== by 0x1C8D87A4: Parrot_lib_foo_load (foo.c:362)
==30847== by 0x80E21DD: Parrot_init_lib (dynext.c:258)
==30847== by 0x80E2343: Parrot_load_lib (dynext.c:322)
==30847== by 0x80F8AF5: Parrot_loadlib_p_sc (core.ops:1149)
==30847== by 0x816614B: runops_slow_core (runops_cores.c:147)
==30847== by 0x8164627: runops_int (interpreter.c:742)
==30847== by 0x8165474: runops (inter_run.c:81)
==30847== by 0x80D6B73: Parrot_runcode (embed.c:768)
==30847== by 0x80D69B1: Parrot_runcode (embed.c:700)
==30847== by 0x809D040: main (main.c:603)
==30847==

I'm not sure what to do next.

Nicholas Clark

Leopold Toetsch

unread,
Mar 12, 2005, 11:38:59 AM3/12/05
to Nicholas Clark, perl6-i...@perl.org
Nicholas Clark <ni...@ccl4.org> wrote:
>==30847== Invalid read of size 1
>==30847== at 0x1B904AE0: memcpy (mac_replace_strmem.c:285)
>==30847== by 0x80E36D2: mmd_expand_x (mmd.c:430)

Yeah, that seems to be it. But I've no clue yet, why there's a
difference here with gcc 3.3.3 - I can't see a problem in the code
either.

Still investigating
leo

psinn...@aol.com

unread,
Mar 12, 2005, 2:39:19 PM3/12/05
to l...@toetsch.at, perl6-i...@perl.org
I have tried gcc 3.2 and gcc 3.4 and these both fail the same tests.

I then tried gcc 2.72 and this also fails make test.

./parrot parrot-config.imc VERSION DEVEL
make: *** [runtime/parrot/include/config.fpmc] Segmentation fault

(core dumped)


make: *** Deleting file `runtime/parrot/include/config.fpmc'

If I comment $(PARROT) parrot-config.imc VERSION DEVEL out of the
makefile
lots of tests can be seen to fail

[ lots more failed tests ]

t/src/hash.t 1 256 10 1 10.00% 6
t/src/sprintf.t 1 256 3 1 33.33% 3
3 tests and 63 subtests skipped.
Failed 70/137 test scripts, 48.91% okay. 537/2226 subtests failed,
75.88% okay.
make: *** [test] Error 255


I checked out parrot with cvs co -D "2005-03-07" parrot and 2.72 can
make test this with no
test failures.


Peter

-----Original Message-----
From: Leopold Toetsch <l...@toetsch.at>
To: Nicholas Clark <ni...@ccl4.org>
Cc: perl6-i...@perl.org
Sent: Sat, 12 Mar 2005 17:38:59 +0100
Subject: Re: Parrot 0.1.2 with MinGW32 (some experimets)

Michal Jurosz

unread,
Mar 14, 2005, 10:21:05 AM3/14/05
to perl6-i...@perl.org
Leopold Toetsch wrote:
> The test could include C< 0? >.
>> + $err_msg =~ s/\r//g;
> Could you please provide one patch for items like above, thanks.

TortoiseCVS patch file attached.

S pozdravem Michal Jurosz

test-win32.patch

Leopold Toetsch

unread,
Mar 15, 2005, 3:17:47 AM3/15/05
to perl6-i...@perl.org
François" PERRAD <parrotbug...@parrotcode.org> wrote:
> -win32-mingw
> +win32-mingw-gcc3.2.3 Y Y Y - - Y Y/7 20050307

Just 7 failing can't be quite right, when all tests are failing that
used dynamic loading.

leo

Leopold Toetsch

unread,
Mar 15, 2005, 3:51:17 AM3/15/05
to Michal Jurosz, perl6-i...@perl.org
Michal Jurosz <rootm...@seznam.cz> wrote:

> TortoiseCVS patch file attached.

> SKIP: {

[ ... ]

> -}

Please always test your patches.

Thanks, applied.
leo

François PERRAD

unread,
Mar 15, 2005, 6:06:55 AM3/15/05
to perl6-i...@perl.org

>
> > # --- Some other ideas: ---
>
> > $ perl -e "print $^O"
> > msys
>
> > --- config\init\hints.pl
> > sub runstep {
> > + my $O = lc($^O);
> > + $O = 'mswin32' if $O =~ /^(msys|mingw)/;
> > - my $hints = "config/init/hints/" . lc($^O) . ".pl";
> > + my $hints = "config/init/hints/" . $O . ".pl";
>
>This would make MinGW in all aspects identical to a native window build,
>wouldn't it? Seems dangerous.

When I follow the instructions what I've published in parrot/README.win32,
the builded perl program gives :


$ perl -e "print $^O"

MSWin32

For me, mingw is not a platform (MSWin32 and cygwin are a platform), just
the GCC compiler under MSWin32.
$mingw = ($^O eq 'MSWin32' and $Config{cc} eq 'gcc')

So, the case $is_mingw in config/init/hints/mswin32.pl is the good way to
handle this compiler.

Francois Perrad.

Michal Jurosz

unread,
Mar 15, 2005, 8:25:06 AM3/15/05
to perl6-i...@perl.org
François PERRAD wrote:
>
> When I follow the instructions what I've published in parrot/README.win32,
> the builded perl program gives :
> $ perl -e "print $^O"
> MSWin32
>
> For me, mingw is not a platform (MSWin32 and cygwin are a platform),
> just the GCC compiler under MSWin32.
> $mingw = ($^O eq 'MSWin32' and $Config{cc} eq 'gcc')
>
> So, the case $is_mingw in config/init/hints/mswin32.pl is the good way
> to handle this compiler.
>

README.win32: "As Configure.pl extracts configuration from the perl
program, first build/install perl with MinGW (no binary distribution
available)."

But more obtainable/common are:

# run: cmd.exe
C:\>perl -e "print $^O"
MSWin32
C:\>perl -v
This is perl, v5.8.4 built for MSWin32-x86-multi-thread
Binary build 810 provided by ActiveState Corp.
C:\>set PATH=%PATH%;C:\mingw\bin
C:\>gcc -v
gcc version 3.2.3 (mingw special 20030504-1)

# run: C:\msys\msys.bat


$ perl -e "print $^O"
msys

$ perl -v
This is perl, v5.6.1 built for msys
$ which gcc
/mingw/bin/gcc
$ gcc -v
gcc version 3.2.3 (mingw special 20030504-1)

# run C:\cygwin\cygwin.bat


$ perl -e "print $^O"

cygwin
$ perl -v
This is perl, v5.8.6 built for cygwin-thread-multi-64int
$ which gcc
/usr/bin/gcc
$ gcc -v
gcc version 3.3.3 (cygwin special)

See attached win32-env.txt for full listings.

I was thinking about merge cygwin.pl with mswin32.pl.
my $O = lc($^O);
$O = 'mswin32' if $O =~ /^(msys|cygwin)/;


my $hints = "config/init/hints/" . $O . ".pl";

See attached mswin32.pl

See also http://xrl.us/fddn (MJWiki:Build Parrot with MinGW)

S pozdravem Michal Jurosz

win32-env.txt
mswin32.pl

Leopold Toetsch

unread,
Mar 15, 2005, 8:53:04 AM3/15/05
to François PERRAD, perl6-i...@perl.org
François PERRAD <francoi...@gadz.org> wrote:

> For me, mingw is not a platform (MSWin32 and cygwin are a platform), just
> the GCC compiler under MSWin32.
> $mingw = ($^O eq 'MSWin32' and $Config{cc} eq 'gcc')

> So, the case $is_mingw in config/init/hints/mswin32.pl is the good way to
> handle this compiler.

Ok. What about the reported problem that the object file ending

o => '.o'

has to be changed in the hints file?

> Francois Perrad.

leo

0 new messages