Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User valentinvs's Avatar
    Join Date
    Apr 2008
    Posts
    4
    Hi PyS60 community,

    I can't use e32.start_service() on the emulator.

    Even the most simple invocation results in a User 42 Panic that shuts down the Python interpreter.

    The most simple code that I tried is this:
    simplestarter.py:
    import e32
    e32.start_server(u"c:\\python\\simpleserver.py")
    simpleserver.py:
    print "i am a simple server"

    I start simplestarter.py via the "Run Script" Menu Option. Needless to say that I double checked if simpleserver.py is in the directory (as supposed to be I get a KErrNotFound error if I alter the location so simplestarter is finding the script).

    At this basic point I'm not sure how to do debugging. I believe that the Python installation works all right - I can run more complicated scripts (with UI and Sockets and so on) just fine. As long as I don't invoke e32.start_server().

    Can somebody point me to the obvious thing I am doing wrong please? :-)

    Thanks for your time.

    Valentin

    PS: I'm using the PyS60 1.4.2 distribution compiled from source on Windows XP Professional SP2

  2. #2
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    Hi Valentin and welcome to the PyS60 Discussion Board.

    I've tried your two scripts both on the emulator and on my phone. I'm also using 1.4.2, on WinXP SP1, and got the USER 42 panic. On my N95 it didn't do anything, no panic, no printed message. So I guess it's a bug. If after some more testing and/or other opinions you draw the conclusion that it is a bug, you can report it here.

  3. #3
    Nokia Developer Champion gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,701
    hi valentin
    i also checked in the way bogdan checked it. i also got the same error in the emulator as of yours. i think the problem can be with the SDK and its a bug i think.
    feelfree to have a fedback

  4. #4
    Registered User valentinvs's Avatar
    Join Date
    Apr 2008
    Posts
    4
    Hi Bogdan and Gaba,

    I must say that I am a bit puzzled that this seems to be a bug - I believe the ui starting a background workhorse via e32.start_server() was a very common design pattern on S60.

    Is there another way to start background process?

    I reported this bug to SF Bug tracker. We'll see what comes out of it...

    Thank you very much for you comments.

    Bye bye,
    Valentin

  5. #5
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    The closest thing to what you want is, the way I see it, this.

  6. #6
    Regular Contributor GameDude's Avatar
    Join Date
    Jan 2007
    Location
    Oulu, Finland
    Posts
    147
    I did some research. 1.3.22 seems to be the first version to cause panic. 1.3.21 works just fine. Since User 42 indicates problems with memory allocation, I thought maybe this has something to do with the backported obmalloc.c from python 2.5.1, which was introduced in 1.3.22.

    I took obmalloc.c from 1.3.21 and replaced the 1.4.2 version with it. After this, the panic did not occur anymore.

  7. #7
    Nokia Developer Champion gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,701
    Quote Originally Posted by valentinvs View Post
    Hi Bogdan and Gaba,

    I must say that I am a bit puzzled that this seems to be a bug - I believe the ui starting a background workhorse via e32.start_server() was a very common design pattern on S60.

    Is there another way to start background process?

    I reported this bug to SF Bug tracker. We'll see what comes out of it...

    Thank you very much for you comments.

    Bye bye,
    Valentin
    hi valentin
    plz look at the wiki you will get something there.
    feel free for a feedback

  8. #8
    Registered User valentinvs's Avatar
    Join Date
    Apr 2008
    Posts
    4
    Quote Originally Posted by gaba88 View Post
    hi valentin
    plz look at the wiki you will get something there.
    feel free for a feedback

    Hi Gaba,
    I am note sure what you mean by "you will get something there".

    But I want to follow up on the Bug report @ https://sourceforge.net/tracker/?fun...roup_id=154155

    jplauril added a discussion about the bug.
    Quote Originally Posted by jplauril
    The reason for this is the use of few instances of writable static data in
    the current DLC allocator code that is part of obmalloc. This prevents
    running several Python processes on the emulator at the same time.

    To fix this in a "nice" way we'd need to perform standard WSD removal for
    dlc.cpp, but since a) this problem only affects the emulator and b) WSD
    removal could reduce the performance of the allocator I think we'll opt to
    simply not use the DLC allocator on the emulator.
    so it appears as if gamedude is right. I guess I have to use threads for the server / ui pattern which introduces tighter (lifetime) coupling and a whole heap of other problems. What a pitty...

  9. #9
    Nokia Developer Champion gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,701
    hi valentine
    i was talking about starting a background process. and you are correct that gamedude is correct in its saying.

  10. #10
    Super Contributor JOM's Avatar
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976
    Quote Originally Posted by valentinvs View Post
    guess I have to use threads for the server / ui pattern which introduces tighter (lifetime) coupling and a whole heap of other problems.
    Well, jplauril did say it affects only emulator. The code should be ok in real device.

    Can you develop and debug without emulator? Might be easier than redesigning whole architecture? Please also consider using some stubs, might allow you to use emulator for something?

    Just an idea,

    --jouni

  11. #11
    Registered User valentinvs's Avatar
    Join Date
    Apr 2008
    Posts
    4
    I reconsidered and patched the emulator the way GameDude suggested. It works just fine so now I have a working toolchain again.

    Thanks everybody - you seem like a great community.

    Byebye,
    Valentin

Similar Threads

  1. Using Bluetooth serial port in MIDlets (nokia 9500 issue)
    By orsteglasy in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2007-10-07, 21:49
  2. user panic 23 when switch views?
    By team-vx in forum Symbian C++
    Replies: 2
    Last Post: 2007-08-31, 12:38
  3. Replies: 1
    Last Post: 2007-03-30, 17:57
  4. Replies: 2
    Last Post: 2004-09-15, 22:47
  5. Replies: 0
    Last Post: 2003-02-20, 13:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved