Re: [perl #23159] Parrot SIGSEGV in scratchpad_find
--- Jos Visser [EMAIL PROTECTED] wrote: # New Ticket Created by Jos Visser # Please include the string: [perl #23159] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23159 Description: The following PIR code causes parrot to dump core: .sub _main find_lex $P1,n print $P1 print \n end .end Failing routine: Under GDB it says: Program received signal SIGSEGV, Segmentation fault. 0x080a4323 in scratchpad_find (interp=0x817f2f8, pad=0x0, name=0x40408b5c, position=0xbfffd850) at sub.c:180 180 for (i = pad-cache.int_val - 1; i = 0; i--) { Reason: Variable pad is NULL! Additional comments: Trying to find a lexical when no pad is established is stupid. However, I don't guess dumping core is the appropriate thing to do, returning NULL from scratchpad_find probably is. Patch: I don't know if this is the appropriate patch, but still Index: sub.c === RCS file: /cvs/public/parrot/sub.c,v retrieving revision 1.28 diff -u -b -B -r1.28 sub.c --- sub.c 21 Jul 2003 18:00:24 - 1.28 +++ sub.c 29 Jul 2003 13:35:55 - @@ -177,6 +177,9 @@ INTVAL i, pos = 0; struct Parrot_Lexicals * lex = NULL; +if (!pad) +return NULL; + for (i = pad-cache.int_val - 1; i = 0; i--) { lex = (((struct Parrot_Lexicals *)PMC_data(pad))[i]); pos = lexicals_get_position(interp, lex, name); With this patch I get the error message Lexical 'n' not found.. I don't think it's worth adding extra overhead to lexical variables just to support broken pasm. There are many ways to crash parrot with bad code - but it's OK, since compilers of higher level languages simply won't generate them. :) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Re: dmake
--- Vladimir Lipskiy [EMAIL PROTECTED] wrote: BTW, what's about dmake? Has anybody tried to make Parrot with it? DMAKE.EXE: makefile: line 12: Warning -- Macro `O' redefined after use DMAKE.EXE: makefile: line 14: Warning -- Macro `A' redefined after use DMAKE.EXE: Error -- Incomplete rule recipe group detected __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Re: [perl #20298] Operators neg and abs in core.ops
--- Nicholas Clark [EMAIL PROTECTED] wrote: On Fri, Jan 17, 2003 at 12:21:33PM -0500, Dan Sugalski wrote: Sorry this one sat. I want to apply it, but the test patch looks to On Tue, Jan 14, 2003 at 04:53:25PM +, Bernhard Schmalhofer wrote: For the operator 'abs' I use the functions 'abs()' and 'fabs()' from the C math library. 'abs()' might be problematic, as it isn't in the C99 standard, http://std.dkuug.dk/JTC1/SC22/WG14/www/standards. fabs() is in C89 and C99. ??? Dan, problem, surely? Unless/until we work around things we want being absent. In this case it's more getting the Configure infrastructure in place to probe for the missing functions Secondly, these routines assume that INTVAL is an int (not a long, nor heresy), and that FLOATVAL is a double. I believe we can't make that assumption: inline op abs( inout INT) { $1 = abs( $1 ); goto NEXT(); } inline op abs(inout NUM) { $1 = fabs( $1 ); goto NEXT(); } inline op abs(out INT, in INT) { $1 = abs( $2 ); goto NEXT(); } inline op abs(out INT, in NUM) { $1 = (INTVAL)fabs($2); goto NEXT(); } inline op abs(out NUM, in INT) { $1 = (FLOATVAL)abs($2); goto NEXT(); } inline op abs(out NUM, in NUM) { $1 = fabs( $2 ); goto NEXT(); } We'd need more complex code to conditionally use fabs, fabsf, fabsl (or work around absence of fabsf and fabsl), and abs, labs, llabs (and work around the last one being missing) We could make the call that we're not going to work around missing long double functions - if you ain't got 'em, we refuse to Configure for that size. Given that if you don't have fabsl, you probably don't have more tricky functions such as sqrtl, modfl or atan2l Nicholas Clark We could always use the old standby: inline op abs(inout INT) if($1 0) $1 = -$1; goto NEXT(); } __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Problems making the recent cvs snapshot under cygwin.
--- Joseph F. Ryan [EMAIL PROTECTED] wrote: I'm having problems making off of the recent cvs snapshot. When running Configure, I get the errors/output below. Could anyone suggest a fix that I could try? I am running windows 2kpro, with gcc under cygwin as my compiler. Thanks, Joseph F. Ryan [EMAIL PROTECTED] Output of : Checking MANIFEST...done. Setting up Configure's data structures...done. Checking for --miniparrot...done. Loading platform and local hints files...done. Enabling debugging...(none requested) done. Determining what C compiler and linker to use...done. Determining what types Parrot should use...done. Determining what opcode files should be compiled in...done. Setting up experimental systems...done. Determining what pmc files should be compiled in...done. Tweaking ccflags...done. Determining your minimum pointer alignment... C compiler failed (see test.cco) at lib/Parrot/Configure/Step.pm line 145. Contents of test.cco: 'cl' is not recognized as an internal or external command, operable program or batch file. Line 145 (newline added): system($cc $ccflags -I./include -c test.c test.cco $redir_err) and die C compiler failed (see test.cco); The value of $cc $ccflags -I./include -c test.c test.cco $redir_err at the moment of failure: cl -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -I./include -c test.c test.cco 21 Your perl5 was compiled with VC++. Configure swipes the options from perl5 so if you want to fix this, you'll have to edit Config.pm. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
RE: Objects, finally (try 1)
--- Dan Sugalski [EMAIL PROTECTED] wrote: At 9:51 AM -0800 1/14/03, Jonathan Sillito wrote: Dan, Below are some questions about this ... And now some answers. :) -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED]] [snip] Objects, as far as I see it, have the following properties: 1) They have runtime-assignable properties Terminology question: what is the difference between a property and an attribute? Perhaps the answer could go in the glossary. A property is a runtime assignable name/value pair that you stick on a variable or value. An attribute is a named variable that all objects of a particular class have. Properties can come and go at runtime, but attributes are fixed. (I think you could also consider attributes instance variables, but I'm a bit OO fuzzy so I'm not sure that's entirely right) #3 Since each class has a PMC type, we just need to associate the PMC type with the data a class needs. Also pretty much no big deal, and something we already have facilities for. So, while there may be exceptions, generally all classes will be instances of the Class PMC, true? Generally, yes. The call/jmpmeth opcodes either make a returnable or non-returnable method call. They fetch the function pointer from the object PMC and either dispatch to it or save the current state and jsr to it. Note that you can't jmpmeth into a C-implemented method, so no tail calling into those without some wrapper opcodes. The registers still need to be set up appropriately, just like with a regular sub call. So the call opcode takes a method name or offset and calls a vtable method to find the method and then invokes it? Yep. The find_method vtable entry should die, and be replaced with a plain method entry. This should return either the address of the start of the method's bytecode, or NULL. The NULL return is for those cases where the method actually executed via native code, and thus doesn't have to go anywhere. If an address is returned it's expected that the engine will immediately dispatch to that spot, obeying parrot's calling conventions. Not sure what this means, does it mean that there is a method named find_method accessed something like call Px, Py, find_method which I can then call to find the method or am I off? You're off. It'll be something like: callmethod Px, method_name or jmpmethod Px, method_name The structures: *) Attr PMCs have an array off their data pointer. *) Classes are variants of Attr PMCs. They have the following guaranteed attributes in slots: 0) Hash with class name to attribute offset I am not sure what this means, Don't we already have the class and it's attributes if we are accessing these slots? Well... The problem is finding which slot to access, a problem that's compounded by multiple inheritance. Let's say, for example, that you have a class A, which inherits from B and C. Let's also say that each class has 10 attributes, and you have a fixed-width mail reading font. The inheritance diagram then looks like: C B \ / | A Since the attributes are an array, it looks like: CCBBAA 012345678901234567890123456789 We make a method call and it gets resolved to be one we inherited from B. Now, how does B know which slots in the object holds its attributes? In a single-inheritance case, it could assume that since it has no parents it can start at slot 0, but that doesn't work here--C is first. So what B needs to do is query the object to find out where the attributes for class B start in the attribute array, and to do that it looks in the hash stored in the object's class attributes that maps class names to starting offsets. From there B can figure out what slot to look in, since class attributes are contiguous, and thus there only needs to be a single lookup. Single inheritance makes all this resolvable at compile time, which would be so much nicer. Alas, no joy for us there. 1) Hash with attribute name to attribute offset (relative to the offset found from the hash in slot 0, generally known at compile time, but introspection is nice) 2) Integer number of attributes this class has 3) Notification array Do we store ptrs to parent classes in one of these slots? Also Can I access slots like: set Px, Py[1]# store the name to offset hash in Px No the parent's gotten to via the vtable, and yes you can. So to sum up we need the following pmc's: pmclass Ref { data is a pointer to an object } pmclass Attr { data is an array of attributes } pmclass Class extends Attr { } pmclass Object { this was not explained, but I guess it at least has a reference to a Class and
RE: Objects, finally (try 1)
--- Garrett Goebel [EMAIL PROTECTED] wrote: From: Dan Sugalski [mailto:[EMAIL PROTECTED]] At 9:51 AM -0800 1/14/03, Jonathan Sillito wrote: Below are some questions about this ... And now some answers. :) From: Dan Sugalski [mailto:[EMAIL PROTECTED]] [snip] Objects, as far as I see it, have the following properties: 1) They have runtime-assignable properties Terminology question: what is the difference between a property and an attribute? Perhaps the answer could go in the glossary. A property is a runtime assignable name/value pair that you stick on a variable or value. An attribute is a named variable that all objects of a particular class have. For a while perl6-language was using both terms for the runtime variable/value name/value tag. This stems from Perl 5.6's attributes and Attribute::Handlers modules. But in Perl6 s/attributes/properties/ because properties have nothing to do with OO, whereas 'attribute' has the object/class data-member meaning in OO. Properties can come and go at runtime, but attributes are fixed. (I think you could also consider attributes instance variables, but I'm a bit OO fuzzy so I'm not sure that's entirely right) Both classes and objects can have attributes. No runtime modification of class and/or object attributes... :( So a property is just an element in a hash attribute? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: The draft todo/worklist
--- Dan Sugalski [EMAIL PROTECTED] wrote: *) ICU building *) Unicode encoding Do we really need unicode in parrot? Seems to me like it dosen't really accomplish much but making string operations much slower. People would still be able to use it even if strings aren't encoded with it. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: benchmarking - it's now all(-1,0,1,5,6)% faster
--- Leopold Toetsch [EMAIL PROTECTED] wrote: Nicholas Clark wrote: So I'm confused. It looks like some bits of perl are incredibly sensitive to cache alignment, or something similar. This reminds me on my remarks on JITed mops.pasm which variied ~50% (or more) depending on the position of the loop in memory. s. near the end of jit/i386/jit_emit.h. And no, I still don't know what's goin on. (The story for perl5-porters + my comment: the loop is just 1 subtraction and a conditional jump. Inserting nops before this loop has drastic imapt on performance. below is the gdb output of the loop) /* my i386/athlon has a drastic speed penalty for what? * not for unaligned odd jump targets * * But: * mops.pbc 790 = 300-530 if code gets just 4 bytes bigger * (loop is at 200 instead of 196 ???) * * FAST: * 0x818100a jit_func+194:sub%edi,%ebx * 0x818100c jit_func+196:jne0x818100a jit_func+194) * * Same fast speed w/o 2nd register * 0x8181102 jit_func+186:sub0x8164c2c,%ebx * 0x8181108 jit_func+192:jne0x8181102 jit_func+186 * * SLOW (same slow with register or odd aligned) * 0x818118a jit_func+194:sub0x8164cac,%ebx * 0x8181190 jit_func+200:jne0x818118a jit_func+194 * */ Nicholas Clark leo The slow one has the loop crossing over a 16 byte boundary. Try moving it over a bit. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: [perl #18832] [PATCH] nci test lib
--- Steve Fink [EMAIL PROTECTED] wrote: blib/lib/libparrot$(SO) : blib/lib $(O_DIRS) $(O_FILES) - $(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $(LD_OUT)blib/lib/libparrot$(SO) $(O_FILES) $(C_LIBS) + $(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) $(LD_OUT)blib${slash}lib${slash}libparrot$(SO) $(O_FILES) $(C_LIBS) Putting a shared libparrot in blib/lib is unportable, Windows won't be able to find it. It needs to go in the same directory as parrot.exe. (This only applies to dlls loaded when the program is starting up, ones loaded with LoadLibrary can be whereever you want) __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Stringification of references and objects.
This is a bit of an oversimplification. $foo and @foo do not always behave the same, even if $foo and @foo refer to the same array object. In particular, $foo doesn't behave like @foo in a list context. Scalars must continue to behave like scalars in list context, even if they're internally composite. Am I the only one here who thinks Perl 6's rules for arrays/lists/refs are getting way too complicated? This is getting even worse than C's confusion of them. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Stringification of references and objects.
This is a bit of an oversimplification. $foo and @foo do not always behave the same, even if $foo and @foo refer to the same array object. In particular, $foo doesn't behave like @foo in a list context. Scalars must continue to behave like scalars in list context, even if they're internally composite. Am I the only one here who thinks Perl 6's rules for arrays/lists/refs are getting way too complicated? This is getting even worse than C's confusion of them. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Stringification of references and objects.
Sent to the wrong list. Ignore, please. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
DOS filename collisions
There are some files in parrot that have names common in the first 8 characters. This will cause problems if someone tries to compile Parrot on DOS. Is DOS an intended target, or should we not worry about this? /core_ops*.c /docs/packfile*.pod /examples/assembly/benchmarks/gc*.pasm /icu/source/data/mappings/ibm*.ucm /icu/source/data/translit/t_Inter*.txt /include/parrot/oplib/core_ops*.h /languages/perl6/t/parser/similar*.[exp|pl] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Tiny imcc example doesn't work
--- [EMAIL PROTECTED] wrote: I thought that something like what follows: goto _foo end _foo: print Howdy!\n end would be legal imcc input IMCC requires you to put everything in .subs. So it should be something like ..sub main goto _foo end _foo: print Howdy!\n end ..end There's nothing special about calling it main, the pasm entry point is the first sub. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Tiny imcc example doesn't work
--- Mr. Nobody [EMAIL PROTECTED] wrote: ..sub main ..end Except without those extra dots. Stupid mailer. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: [perl #18762] nci.t hates me
t/pmc/nci.t doesn't like me or, at least, it doesn't like the way I don't have a lrint in my math.h. My KR claims that everything in math.h ought to return a double (well, anything you can validly expect to find in every math.h), so using math.so is probably not the way to test the nci, instead a set of dummy functions ought to be provided by a little library of our own, and built as part of the build process. lrint() is new in C99, so older libraries may not have it. For testing nci with a long return, why don't we use something more univarsal, like labs()? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Networking and Parrot
--- Ramesh Ananthakrishnan [EMAIL PROTECTED] wrote: Is it possible to write networking code in Parrot? Not yet. Someday there will probably be a Sockets extension for parrot (not really used enough to justify being in the core) __ Yahoo! - We Remember 9-11: A tribute to the more than 3,000 lives lost http://dir.remember.yahoo.com/tribute
[PATCH] a couple fixes for mingw32
The first enclosed patch quashes invalid pragma warnings in platform.h, the second one makes another exception to imcc requiring sysexits.h (maybe imcc should come with a sysexits.h instead?) __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com --- config/gen/platform/win32.h.origTue Jul 23 00:25:36 2002 +++ config/gen/platform/win32.h Thu Sep 5 18:35:46 2002 -14,6 +14,7 #endif /* These disable certain Level 4 Warnings */ +#ifdef _MSC_VER #pragma warning( disable: 4100 ) /* disables 'unreferenced formal parameter' * warnings */ #pragma warning( disable: 4115 ) /* disables 'named type definition in -21,6 +22,7 * include files */ #pragma warning( disable: 4505 ) /* disables 'unreferenced local function has * been removed' warnings in header files */ +#endif /* ** Miscellaneous: */ --- languages/imcc/imc.h.orig Mon Aug 26 23:48:44 2002 +++ languages/imcc/imc.hThu Sep 5 18:57:56 2002 -3,14 +3,14 #include stdio.h #include stdlib.h -#ifndef _MSC_VER -# include sysexits.h -#else +#if defined(_MSC_VER) || defined(__MINGW32__) # define EX_DATAERR 1 # define EX_SOFTWARE 1 # define EX_NOINPUT 1 # define EX_IOERR 1 # define EX_UNAVAILABLE 1 +#else +# include sysexits.h #endif #include symreg.h
[PATCH] in makefile, move libparrot.a from test to all
libparrot.a is not really related to testing, it should belong in all. This patch does so, and as a side effect, t/src/basic will now work with make testj. __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com --- root.in.bak Thu Aug 29 16:00:04 2002 +++ root.in Fri Aug 30 14:53:54 2002 -160,7 +160,7 .c$(O) : $(CC) $(CFLAGS) ${cc_o_out}$ -c $ -all : $(TEST_PROG) docs +all : $(TEST_PROG) docs ${blib_lib_libparrot_a} mops : examples/assembly/mops${exe} examples/mops/mops${exe} -451,7 +451,7 # ### -test : $(TEST_PROG) ${blib_lib_libparrot_a} assemble.pl test_dummy +test : $(TEST_PROG) assemble.pl test_dummy test_dummy : $(PERL) t/harness $(TEST_PROG_ARGS)
[perl #15948] [PATCH] Configure broken on windows 9x
# New Ticket Created by Mr. Nobody # Please include the string: [perl #15948] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15948 I sent this patch before but it got the wordwraps messed up, its enclosed as an attachment this time so it will be unchanged. __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- attachment 1 -- url: http://rt.perl.org/rt2/attach/32707/26971/8b1cd1/diff --- lib/Parrot/Configure/Step.bak Thu Jul 18 16:59:04 2002 +++ lib/Parrot/Configure/Step.pmThu Aug 1 20:11:22 2002 -16,6 +16,7 gen = ['genfile'] ); +my $redir_err = ($ENV{COMSPEC} =~ /command\.com/i) ? : 21; #Configure::Data-get('key') #Configure::Data-set('key', 'value') -71,9 +72,9 my($cc, $ccflags, $ldout, $o, $ld, $ldflags, $cc_exe_out, $exe, $libs)= Configure::Data-get( qw(cc ccflags ld_out o ld ldflags cc_exe_out exe libs) ); - system($cc $ccflags -I./include -c test.c test.cco 21) and die C compiler failed (see test.cco); + system($cc $ccflags -I./include -c test.c test.cco $redir_err) and die C +compiler failed (see test.cco); - system($ld $ldflags test$o ${cc_exe_out}test$exe $libs test.ldo 21) and die Linker failed (see test.ldo); + system($ld $ldflags test$o ${cc_exe_out}test$exe $libs test.ldo $redir_err) +and die Linker failed (see test.ldo); } sub cc_run { -89,10 +90,10 sub cc_run_capture { my $exe=Configure::Data-get('exe'); if (defined($_[0]) length($_[0])) { - `./test$exe $_[0] 21`; + `./test$exe $_[0] $redir_err`; } else { - `./test$exe 21`; + `./test$exe $redir_err`; } }
[perl #15925] [PATCH] Configure broken on windows 9x, patch included
# New Ticket Created by Mr. Nobody # Please include the string: [perl #15925] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15925 The command.com shell in windows 9x dosen't recognize 21 so it messes up Configure when it starts checking pointer alignment, this patch fixes it on windows 9x but it dosen't take out the stderr redirection on shells that support it. --- lib/Parrot/Configure/Step.bak Thu Jul 18 16:59:04 2002 +++ lib/Parrot/Configure/Step.pmThu Aug 1 09:51:54 2002 -16,6 +16,7 gen = ['genfile'] ); +my $redir_err = ($ENV{COMSPEC} =~ /command\.com/i) ? : 21; #Configure::Data-get('key') #Configure::Data-set('key', 'value') -71,9 +72,9 my($cc, $ccflags, $ldout, $o, $ld, $ldflags, $cc_exe_out, $exe, $libs)= Configure::Data-get( qw(cc ccflags ld_out o ld ldflags cc_exe_out exe libs) ); - system($cc $ccflags -I./include -c test.c test.cco 21) and die C compiler failed (see test.cco); + system($cc $ccflags -I./include -c test.c test.cco $redir_err) and die C compiler failed (see test.cco); - system($ld $ldflags test$o ${cc_exe_out}test$exe $libs test.ldo 21) and die Linker failed (see test.ldo); + system($ld $ldflags test$o ${cc_exe_out}test$exe $libs test.ldo $redir_err) and die Linker failed (see test.ldo); } sub cc_run { -89,10 +90,10 sub cc_run_capture { my $exe=Configure::Data-get('exe'); if (defined($_[0]) length($_[0])) { - `./test$exe $_[0] 21`; + `./test$exe $_[0] $redir_err`; } else { - `./test$exe 21`; + `./test$exe $redir_err`; } } __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
[perl #15904] Configure broken on windows 9x
# New Ticket Created by Mr. Nobody # Please include the string: [perl #15904] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15904 lib/Parrot/Configure/Step.pm has these statements at lines 74 and 76: system($cc $ccflags -I./include -c test.c test.cco 21) and die C compiler failed (see test.cco); system($ld $ldflags test$o ${cc_exe_out}test$exe $libs test.ldo 21) and die Linker failed (see test.ldo); The windows 9x command.com shell dosen't recognize 21 so it ends up passing 2 as an argument to the compiler, which fails because there's no such file. __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com