Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Inline scripts causes crash

edited February 2013 in OpenSesame

I am running OpenSesame from the source code and using some software libraries for python from Phidgets Inc. When I include the following code in parrallel with a sketchpad image, it causes OpenSesame to crash when the experiment is run (in fact, it causes the experiment to crash before any information is logged in 100% of cases no matter where in the experiment the script is placed). The experiment usually crashes right at the end. I do not think this is a carryover issue, because I am closing OpenSesame each time between runs and also because the crash occurs on the very first run. This script works fine in python's IDLE, and I am wondering how I might fix this issue. The code I am using in the script is as follows: [Thank you in advance for your help, --Mike]

#Prep Phase:
from Phidgets.PhidgetException import *
from Phidgets.Events.Events import *
from Phidgets.Devices.InterfaceKit import *
import time
import random
import createdevice


global RELAY
global IO

IO = createdevice.createdevice()
time.sleep(2)
RELAY = createdevice.createdevice()
try:
    DEVICE2 = RELAY.isAttached()
    print '1017 is att?: ' + str(DEVICE2)
except:
    print 'error'
#Run Phase:
try:
    M = RELAY.getOutputState(1)
    if M == True:
        RELAY.setOutputState(1, False)
    elif M == False:
        RELAY.setOutputState(1, True)
except:
    print 'error'

Comments

  • edited 5:35PM

    Hi Mike,

    Could you perhaps provide some more information? What exactly happens when OpenSesame crashes, and do you see any useful debugging output (for example in the debug window)? What platform are you using, and what back-end?

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited 5:35PM

    I am using the Expyriment backend, although I have tried using the Psychopy and Legacy backends and neither changed the nature of the problem. I am using a PC running windows 7. I am unable to see any useful debugging output because when OpenSesame crashes it rapidly closes the application completely, bringing me back to my computer desktop. The crash generally occurs like this: I run the experiment (in either the quickrun or the full run) and it works normally until toward the end (usually in the last or second to last stage, which for me is a sketchpad that has a duration of buttonpress). Upon clicking this last button, which should trigger the end of the experiment and log all the data, the application closes rapidly and brings me back to my desktop.

    Best,
    Mike
    [note: same poster, I made a second account for myself in addition to the one for my lab]

  • edited 5:35PM

    Hi Mike,

    I see, yes. These types of hard crashes are always the result of a bug somewhere in a module that is partly coded in C. When a pure Python module, such as OpenSesame, crashes, you will get a nice stacktrace. Assuming that OpenSesame doesn't normally crash this way on your system, the obvious candidate is the Phidgets module. The fact that it doesn't crash using IDLE doesn't really say much, because these things can be really unpredictable.

    If I understand correctly, everything goes fine until the experiment is done, right? And then, instead of closing nicely, the whole things comes crashing down. What might be going on is that the RELAY and/ or IO objects can't handle being deleted after the experiment. As of 0.27.1, OpenSesame cleans up all globals that are registered during the experiment, because the carry-over effects that can result from globals were giving users considerable headaches. You can see how this works here:

    You could see what happens if you explicitly delete your globals in the script:

    print 'Deleting ...'
    del RELAY
    del IO
    print 'I might never see this'
    

    Alternatively, you can see what happens if you disable the experiment.restore_state():

    def dummy(): pass
    exp.restore_state = dummy
    

    It could be anything though, this is just a guess, but worth trying out.

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited 5:35PM

    Thank you Sabastiaan, I will try those solutions and see what happens. I appreciate your help thus far.
    Thanks,
    Mike

  • edited 5:35PM

    Using your fixes and some other software I am now pretty sure that the problem is that the driver for the relay I am using cannot handle being deleted and that it is a problem with the driver software. Thanks for your help.
    --M
    PS. I heard that you were going to the APS conference and were going to give a workshop on OpenSesame. I was interested in attending, and was wondering if that would be before or after the main conference?

  • edited 5:35PM

    Using your fixes and some other software I am now pretty sure that the problem is that the driver for the relay I am using cannot handle being deleted and that it is a problem with the driver software.

    Glad to hear you tracked it down!

    I heard that you were going to the APS conference and were going to give a workshop on OpenSesame. I was interested in attending, and was wondering if that would be before or after the main conference?

    That's a good question. The workshops will be the 23rd (before the conference) and the 26th (after), but I don't see any indication of which workshop will be when. So basically, I don't know yet.

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games