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

[perl #33028] Parrot cores when asked to run a nonexistent bytecode file

4 views
Skip to first unread message

Dan Sugalski

unread,
Dec 13, 2004, 10:44:16 AM12/13/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Dan Sugalski
# Please include the string: [perl #33028]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33028 >


A plain

./parrot foo.pbc

when foo.pbc doesn't exist triggers a core dump on OS X.
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Chromatic

unread,
Dec 13, 2004, 1:35:09 PM12/13/04
to perl6-i...@perl.org, bugs-bi...@rt.perl.org
On Mon, 2004-12-13 at 07:44 -0800, Dan Sugalski wrote:

> A plain
>
> ./parrot foo.pbc
>
> when foo.pbc doesn't exist triggers a core dump on OS X.

The problem is in embed.c not checking the results of
Parrot_locate_runtime_file(). Here's a naive patch.

Is there a good place to put tests for this? I'm not sure how the test
harness could invoke this correctly.

-- c


missing_invoke.patch

Matthew Zimmerman

unread,
Dec 13, 2004, 11:21:56 AM12/13/04
to perl6-i...@perl.org
Dan Sugalski (via RT) wrote:
> # New Ticket Created by Dan Sugalski
> # Please include the string: [perl #33028]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33028 >
>
>
> A plain
>
> ./parrot foo.pbc
>
> when foo.pbc doesn't exist triggers a core dump on OS X.

strlen() is puking on the NULL return from Parrot_locate_runtime_file()
in Parrot_readbc. Attached patch fixes this behavior.

--
Matt

Matthew Zimmerman
Interdisciplinary Biophysics, University of Virginia
http://www.people.virginia.edu/~mdz4c/

parrot_readbc.patch

Matthew Zimmerman

unread,
Dec 13, 2004, 11:00:05 AM12/13/04
to perl6-i...@perl.org
Dan Sugalski (via RT) wrote:
> # New Ticket Created by Dan Sugalski
> # Please include the string: [perl #33028]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33028 >
>
>
> A plain
>
> ./parrot foo.pbc
>
> when foo.pbc doesn't exist triggers a core dump on OS X.

Linux too:

matt@tomis ~/personal/devel/parrot $ ./parrot this-doesnt-exist.pbc
Segmentation fault
matt@tomis ~/personal/devel/parrot $ ./parrot this-doesnt-exist.pasm
Error reading source file this-doesnt-exist.pasm.
matt@tomis ~/personal/devel/parrot $ ./parrot this-doesnt-exist.imc
Error reading source file this-doesnt-exist.imc.
matt@tomis ~/personal/devel/parrot $ ./parrot
this-doesnt-exist.arbitraryextension
Error reading source file this-doesnt-exist.arbitraryextension.
matt@tomis ~/personal/devel/parrot $ uname -a
Linux tomis.med.virginia.edu 2.6.8-1.521smp #1 SMP Mon Aug 16 09:25:06
EDT 2004 i686 i686 i386 GNU/Linux

Matthew Zimmerman

unread,
Dec 13, 2004, 1:46:49 PM12/13/04
to chromatic, perl6-i...@perl.org, bugs-bi...@rt.perl.org
chromatic wrote:
> On Mon, 2004-12-13 at 07:44 -0800, Dan Sugalski wrote:
>
>>A plain
>>
>> ./parrot foo.pbc
>>
>>when foo.pbc doesn't exist triggers a core dump on OS X.
>
>
> The problem is in embed.c not checking the results of
> Parrot_locate_runtime_file(). Here's a naive patch.

[snip chromatic's fine patch, very similar to mine]

I'm going to have to stop sending patches if it's going to take 5 hours
for my messages to get to the list. You guys are so damned fast, I can't
compete! :)

Leopold Toetsch

unread,
Dec 14, 2004, 4:48:40 AM12/14/04
to mzimm...@virginia.edu, perl6-i...@perl.org
Matthew Zimmerman <mzimm...@virginia.edu> wrote:

> strlen() is puking on the NULL return from Parrot_locate_runtime_file()
> in Parrot_readbc. Attached patch fixes this behavior.

Thanks, applied.
leo

Nicholas Clark

unread,
Dec 24, 2004, 5:28:35 AM12/24/04
to Matthew Zimmerman, chromatic, perl6-i...@perl.org, bugs-bi...@rt.perl.org
On Mon, Dec 13, 2004 at 01:46:49PM -0500, Matthew Zimmerman wrote:
> I'm going to have to stop sending patches if it's going to take 5 hours
> for my messages to get to the list. You guys are so damned fast, I can't
> compete! :)

I think that your messages hit the moderator, as your address wasn't known
to the list, whereas chromatic's address is, so his messages go direct.
I believe that the fact that your messages got to the list means that now
all your messages go direct, and should get here faster.

I'm inferring the moderator because your messages have all these headers:

Delivered-To: mailing list perl6-i...@perl.org
Delivered-To: moderator for perl6-i...@perl.org
Delivered-To: perl6-i...@perl.org


whereas chromatic's doesn't have the Delivered-To: moderator header.

Nicholas Clark

0 new messages