FilePliugin???

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FilePliugin???

Stéphane Ducasse
Hi

when trying to build the dev image I systematically get a DNU

primGetPosition: id
        "Get this files current position."

        <primitive: 'primitiveFileGetPosition' module: 'FilePlugin'>
        self primitiveFailed

and I do not have the FilePlugin in the resources VM folder.

I checked the web site of john but could not find an explanation.

Stef

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: FilePliugin???

johnmci
Well the FilePlugin is built into the VM versus being an external VM  
and it supplies the basic file I/O operations.
So you won't find a plugin called that unless some-one decided to  
compile up one.

So either the plugin method call fails because it cannot be found, or  
it fails because it explicitly failed on bad data, or
other reason (an error?)

The failure cases are:

(1) the id object is not a byte array type of object.
Given
MultiByteFileStream(StandardFileStream)>>primGetPosition:
        Receiver: MultiByteFileStream: '/Data/Downloads/pharo1.0-10470-
BETAdev09.10.2/installScript.st'
        Arguments and temporary variables:
                id: #[153 12 133 142 168 105 19 160 0 0 0 0 18 18 0 0 0 0 0 0 0 0 0  
0]
        Receiver's instance variables:

Yes that looks like a byte array object.

(b) the size of id is wrong
        This is unlikely since the id bytearray hasn't changed size in decades.
        Let me assume the number of bytes is correct.

(c) the bytes 5-8 have to be non-zero, otherwise we fail
        Nope, it's 168 105 19 160

(d) bytes 1-3 have to be non-zero AND match some magic value in the VM
        Well 153 12 133 142 is non zero, but what's the magic value?

MMm I don't think you can get the magic value directly, but at the  
point of failure you could create a new file and examine the 'id'  
value for the StandardFileStream and see if the first 4 bytes match  
the first 4 bytes of this value (153 12 133 142)
Failure to match would cause a prim failure.

Oh wait I see you can invoke
self primSizeNoError: fileID
and if that returns NIL the handle is stale.

See ensureOpen

(e) the ftello() fails because the file doesn't exist, or an I/O error  
happened, or the path is bad. Or some icky file system error.
Alas we don't feed back or record what the error is, but I think you  
fail on (d)?


I'd bet on (d) the MultiByteFileStream instance is some cached value  
from a previous VM usage, try the primSizeNoError: and see what it  
returns when you're inspecting the MultiByteFileStream.


On 2009-10-12, at 9:42 PM, Stéphane Ducasse wrote:

> Hi
>
> when trying to build the dev image I systematically get a DNU
>
> primGetPosition: id
> "Get this files current position."
>
> <primitive: 'primitiveFileGetPosition' module: 'FilePlugin'>
> self primitiveFailed
>
> and I do not have the FilePlugin in the resources VM folder.
>
> I checked the web site of john but could not find an explanation.
>
> Stef
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>   Twitter:  
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================





_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: FilePliugin???

Stéphane Ducasse
Thanks john.
I will to investigate that. What is strange is that damien on linux  
did not get the problem.
So may be this is coming from the image.
I can systematically get an error usging the latest core 470 and the  
following script http://code.google.com/p/pharo/issues/list?cursor=1295

stef



On Oct 13, 2009, at 7:46 AM, John M McIntosh wrote:

> Well the FilePlugin is built into the VM versus being an external VM
> and it supplies the basic file I/O operations.
> So you won't find a plugin called that unless some-one decided to
> compile up one.
>
> So either the plugin method call fails because it cannot be found, or
> it fails because it explicitly failed on bad data, or
> other reason (an error?)
>
> The failure cases are:
>
> (1) the id object is not a byte array type of object.
> Given
> MultiByteFileStream(StandardFileStream)>>primGetPosition:
> Receiver: MultiByteFileStream: '/Data/Downloads/pharo1.0-10470-
> BETAdev09.10.2/installScript.st'
> Arguments and temporary variables:
> id: #[153 12 133 142 168 105 19 160 0 0 0 0 18 18 0 0 0 0 0 0 0 0 0
> 0]
> Receiver's instance variables:
>
> Yes that looks like a byte array object.
>
> (b) the size of id is wrong
> This is unlikely since the id bytearray hasn't changed size in  
> decades.
> Let me assume the number of bytes is correct.
>
> (c) the bytes 5-8 have to be non-zero, otherwise we fail
> Nope, it's 168 105 19 160
>
> (d) bytes 1-3 have to be non-zero AND match some magic value in the VM
> Well 153 12 133 142 is non zero, but what's the magic value?
>
> MMm I don't think you can get the magic value directly, but at the
> point of failure you could create a new file and examine the 'id'
> value for the StandardFileStream and see if the first 4 bytes match
> the first 4 bytes of this value (153 12 133 142)
> Failure to match would cause a prim failure.
>
> Oh wait I see you can invoke
> self primSizeNoError: fileID
> and if that returns NIL the handle is stale.
>
> See ensureOpen
>
> (e) the ftello() fails because the file doesn't exist, or an I/O error
> happened, or the path is bad. Or some icky file system error.
> Alas we don't feed back or record what the error is, but I think you
> fail on (d)?
>
>
> I'd bet on (d) the MultiByteFileStream instance is some cached value
> from a previous VM usage, try the primSizeNoError: and see what it
> returns when you're inspecting the MultiByteFileStream.
>
>
> On 2009-10-12, at 9:42 PM, Stéphane Ducasse wrote:
>
>> Hi
>>
>> when trying to build the dev image I systematically get a DNU
>>
>> primGetPosition: id
>> "Get this files current position."
>>
>> <primitive: 'primitiveFileGetPosition' module: 'FilePlugin'>
>> self primitiveFailed
>>
>> and I do not have the FilePlugin in the resources VM folder.
>>
>> I checked the web site of john but could not find an explanation.
>>
>> Stef
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> =
> =
> =
> =
> =
> ======================================================================
> John M. McIntosh <[hidden email]>   Twitter:
> squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://
> www.smalltalkconsulting.com
> =
> =
> =
> =
> =
> ======================================================================
>
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project