#76 Psyco crashes on PPC: check processor type

open
nobody
5
2008-01-21
2008-01-21
No

Hi, I'm bundling Psyco with a Mac OS X universal binary application. However, running psyco.full() on a PowerPC crashes the app.

I've included a simple patch that checks for an i386 processor (using platform.processor()). If it doesn't find ony, it raises an ImportError, according to the fail fast principle.

Would you consider including this patch in the psyco source? It would make cross-platform development a bit easier.

Kind regards,

fdb

Discussion

  • Armin Rigo

    Armin Rigo - 2008-01-21

    Logged In: YES
    user_id=4771
    Originator: NO

    platform.processor() is useless for testing; e.g. on my machine it returns the string 'Intel(R) Pentium(R) M processor 1.73GHz'. For consistency, the patch should reuse the code that is currently in setup.py.

    More importantly, Psyco can be compiled for PPC (with the ivm virtual machine backend). I don't know if this gives good enough results for your use case, though.

     
  • Frederik De Bleser

    Logged In: YES
    user_id=316845
    Originator: YES

    Ah, on Mac I got a consistent "i386" or "powerpc" value for platform.processor() -- I assumed this would be the case on any system.

    Importing psyco on PPC doesn't give an error, but running psyco.full() crashes Python, which is undesirable. I'm not sure if I would be able to get psyco to work on PPC; I just want an option to disable it on that platform, preferably with an ImportError. Any other check I could do to make this happen?

     
  • Armin Rigo

    Armin Rigo - 2008-01-22

    Logged In: YES
    user_id=4771
    Originator: NO

    I guess I was unclear in my previous comment, so let me rephrase:

    * Psyco works (i.e. doesn't crash) on PPC. If I go to an OS/X PPC box and type "python setup.py install" then "import psyco; psyco.full()" then everything works. (I have no clue about universal binaries or how you build them so the problem might be there.)

    * The check you are looking for is already written in Psyco's own setup.py.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks