Issue 5276: replaced MCMethodDefinition's Definitions class variable with a class instance variable.

classic Classic list List threaded Threaded
4 messages Options
Stéphane Ducasse Stéphane Ducasse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Issue 5276: replaced MCMethodDefinition's Definitions class variable with a class instance variable.


levente did the following in squeak

- replaced MCMethodDefinition's Definitions class variable with a class instance variable. The cached definitions are no longer registered for finalization.
- a bit of cleanup around MCDefinition's Instances class variable


And I like the idea that we do not stress the finalization. Now we should check that I understand correctly


http://code.google.com/p/pharo/issues/detail?id=5276

Stef
FDominicus FDominicus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Maybe someone here can give me an idea on where to start

Well it's a somewhat longer story. I have some code to interface via the
serial lines. And I want to do that on Windows and Linux. So far so
good. Now my code for interfacing to the serial lines works fine on
Windows. But it fails on Linux here's the debug.log from Pharo:
THERE_BE_DRAGONS_HERE
PrimitiveFailed: primitive #primWritePortByName:from:startingAt:count: in SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity) failed
11 February 2012 10:56:40 am

VM: unix - i686 - linux-gnu - Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.78]
Image: Pharo1.3 [Latest update: #13320]

SerialPort(Object)>>primitiveFailed:
        Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
        Arguments and temporary variables:
                selector: #primWritePortByName:from:startingAt:count:
        Receiver's instance variables:
                port: '/dev/ttyUSB0'
                baudRate: 9600
                stopBitsType: 1
                parityType: 0
                dataBits: 8
                outputFlowControlType: 0
                inputFlowControlType: 0
                xOnByte: 19
                xOffByte: 24


SerialPort(Object)>>primitiveFailed
        Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
        Arguments and temporary variables:

        Receiver's instance variables:
                port: '/dev/ttyUSB0'
                baudRate: 9600
                stopBitsType: 1
                parityType: 0
                dataBits: 8
                outputFlowControlType: 0
                inputFlowControlType: 0
                xOnByte: 19
                xOffByte: 24

Where do I start or how do I start to solve this error?

Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

Eliot Miranda-2 Eliot Miranda-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Maybe someone here can give me an idea on where to start

Hi Friedrich,

On Sat, Feb 11, 2012 at 2:02 AM, Friedrich Dominicus <[hidden email]> wrote:
Well it's a somewhat longer story. I have some code to interface via the
serial lines. And I want to do that on Windows and Linux. So far so
good. Now my code for interfacing to the serial lines works fine on
Windows. But it fails on Linux here's the debug.log from Pharo:
THERE_BE_DRAGONS_HERE
PrimitiveFailed: primitive #primWritePortByName:from:startingAt:count: in SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity) failed
11 February 2012 10:56:40 am

VM: unix - i686 - linux-gnu - Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.78]
Image: Pharo1.3 [Latest update: #13320]

SerialPort(Object)>>primitiveFailed:
       Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
       Arguments and temporary variables:
               selector:       #primWritePortByName:from:startingAt:count:
       Receiver's instance variables:
               port:   '/dev/ttyUSB0'
               baudRate:       9600
               stopBitsType:   1
               parityType:     0
               dataBits:       8
               outputFlowControlType:  0
               inputFlowControlType:   0
               xOnByte:        19
               xOffByte:       24


SerialPort(Object)>>primitiveFailed
       Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
       Arguments and temporary variables:

       Receiver's instance variables:
               port:   '/dev/ttyUSB0'
               baudRate:       9600
               stopBitsType:   1
               parityType:     0
               dataBits:       8
               outputFlowControlType:  0
               inputFlowControlType:   0
               xOnByte:        19
               xOffByte:       24

Where do I start or how do I start to solve this error?

You'll need to use gdb to look at the internals of the plugin code.  You might also want to build a debug VM to make the debugging easier.  Here are two places to start:


There's also Mariano Peck's blog on the VM.


Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus




--
best,
Eliot

Schwab,Wilhelm K Schwab,Wilhelm K
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Maybe someone here can give me an idea on where to start

Friedrich,

I have been through some of this.  I have gotten serial I/O to work well on Windows (non-cog so far); I'm not so sure about Linux in general, or about cog in particular.  Most of the hardware I have running Linux is new enough to not have native ports (a regrettable form of "progress" given how many extant devices have serial ports, but that's another thread).

USB-serial converters universally suck in my experience, so linux testing has been slow so far.

That said, attached are some methods I created to help avoid silent failures; #openPortWKS: will raise an error if the port fails to open.  Cog seems to be failing primitives, which is progress in itself.  

Note that KernelLibrary is OS dependent, and exists because it is a common entry point in Dolphin, meaning I have a lot of code that uses it.  I have included it because I thought I saw it somewhere in the code - you might not need it.

No warranties, HTH.

You might (as Eliot suggests) indeed have to build your own vm with diagnostic information.  I had to do so with Ian's vm.  I suggest looking at the mapping of port names to numbers and vice versa.  Most of my problems were related to that, IIRC, and there was no feedback about what the vm was doing.  Sig's idea of bringing such mappig information into the images and hence error descriptions would be most helpful.  If nothing else, you should have concrete evidence that the vm is doing the correct things, allowing you to look elsewhere.  As it is, we have to hunt for the truth.  Again, failling primitives and the logging you have so far are a big step in the right direction.

Bill





From: [hidden email] [[hidden email]] on behalf of Eliot Miranda [[hidden email]]
Sent: Sunday, February 12, 2012 6:21 PM
To: [hidden email]
Subject: Re: [Pharo-project] Maybe someone here can give me an idea on where to start

Hi Friedrich,

On Sat, Feb 11, 2012 at 2:02 AM, Friedrich Dominicus <[hidden email]> wrote:
Well it's a somewhat longer story. I have some code to interface via the
serial lines. And I want to do that on Windows and Linux. So far so
good. Now my code for interfacing to the serial lines works fine on
Windows. But it fails on Linux here's the debug.log from Pharo:
THERE_BE_DRAGONS_HERE
PrimitiveFailed: primitive #primWritePortByName:from:startingAt:count: in SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity) failed
11 February 2012 10:56:40 am

VM: unix - i686 - linux-gnu - Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.78]
Image: Pharo1.3 [Latest update: #13320]

SerialPort(Object)>>primitiveFailed:
       Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
       Arguments and temporary variables:
               selector:       #primWritePortByName:from:startingAt:count:
       Receiver's instance variables:
               port:   '/dev/ttyUSB0'
               baudRate:       9600
               stopBitsType:   1
               parityType:     0
               dataBits:       8
               outputFlowControlType:  0
               inputFlowControlType:   0
               xOnByte:        19
               xOffByte:       24


SerialPort(Object)>>primitiveFailed
       Receiver: SerialPort(#'/dev/ttyUSB0', 9600 baud, 8 bits, 1 stopbits, no parity)
       Arguments and temporary variables:

       Receiver's instance variables:
               port:   '/dev/ttyUSB0'
               baudRate:       9600
               stopBitsType:   1
               parityType:     0
               dataBits:       8
               outputFlowControlType:  0
               inputFlowControlType:   0
               xOnByte:        19
               xOffByte:       24

Where do I start or how do I start to solve this error?

You'll need to use gdb to look at the internals of the plugin code.  You might also want to build a debug VM to make the debugging easier.  Here are two places to start:


There's also Mariano Peck's blog on the VM.


Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus




--
best,
Eliot


serial-etc.zip (2K) Download Attachment
Loading...