Dialog().select gives segmentation fault
#1
This is really weird.

Yes/No dialogs work fine. OK dialogs work fine. DialogProcess runs fine.

However, if I try to use a Dialog().select xbmc crashes every time with a segmentation fault.

Is there something obviously wrong with my code?

Code:
def ShowUserDialog():
    if actiontype == 0:
        powerMode = "Suspend"
    elif actiontype == 1:
        powerMode = "Hibernate"
    print powerMode
    myArgs = [str(powerMode),'Lock', 'Unlock', 'Cancel']
    print myArgs
    userChoice = xbmcgui.Dialog().select("Myth Suspend Alarm", myArgs)
    print userChoice

xbmc.log shows the output of "print myArgs" - so I know it's crashing on the dialog step.

Even if I replace myArgs with, say ["1", "2"] I get the same error.

This is the crashlog: http://pastebin.com/uCWZVhAK

This is the last piece of my script - gutted that this is causing a problem as it seems so straightforward.

Any help would be greatly appreciated.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#2
Trunk build, or Dharma?
Reply
#3
I just tested this code and it works fine on my two systems(10.1 and pre-11 that was build on the 24th of april) No errors, complete and proper working. I copied and paste the code(corrected for the tabs -> made the into spaces) and it worked flawlessly.

Also, if your actiontype is always going to be an integer, you can use the following code to reduce some lines:

Code:
powerMode = ['Suspend', 'Hibernate', ]
    myArgs = [ powerMode[actiontype], 'Lock', 'Unlock', 'Cancel' ]

Since XBMC is crashing, have you tried to use the traceback module in Python.

for example using your code:

Code:
def ShowUserDialog():
    import traceback
    try:
        if actiontype == 0:
            powerMode = "Suspend"
        elif actiontype == 1:
            powerMode = "Hibernate"
        print powerMode
        myArgs = [str(powerMode),'Lock', 'Unlock', 'Cancel']
        print myArgs
        userChoice = xbmcgui.Dialog().select("Myth Suspend Alarm", myArgs)
        print userChoice
    except:
        print "Error Occured"
        traceback.print_exc()

If the scripting is causing the error, this should show what error happens(and also not crash)


el_Paraguayo Wrote:This is really weird.

Yes/No dialogs work fine. OK dialogs work fine. DialogProcess runs fine.

However, if I try to use a Dialog().select xbmc crashes every time with a segmentation fault.

Is there something obviously wrong with my code?

Code:
def ShowUserDialog():
    if actiontype == 0:
        powerMode = "Suspend"
    elif actiontype == 1:
        powerMode = "Hibernate"
    print powerMode
    myArgs = [str(powerMode),'Lock', 'Unlock', 'Cancel']
    print myArgs
    userChoice = xbmcgui.Dialog().select("Myth Suspend Alarm", myArgs)
    print userChoice

xbmc.log shows the output of "print myArgs" - so I know it's crashing on the dialog step.

Even if I replace myArgs with, say ["1", "2"] I get the same error.

This is the crashlog: http://pastebin.com/uCWZVhAK

This is the last piece of my script - gutted that this is causing a problem as it seems so straightforward.

Any help would be greatly appreciated.
Reply
#4
jfcarroll: Apologies for the lack of info (I'm guilty of something I always get frustrated with other people doing when asking for help!).

I'm running Dharma on Mythbuntu 10.10 with the Aeon Mq 2 skin and (seeing as the crashlog refers to nvidia) I'm using nvidia drivers 260.19.29 on a GT210 card.

Giftie, I'm glad the code works for you (it would have been embarrassing if the error was down to my newbie python coding skills!) however that does seem to leave me with fewer options.

I'll try the traceback tip when I'm home from work and will report back after then.

Thanks.

el_P
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#5
Sadly the traceback plan didn't work.

XBMC crashes as before, no additional info printed to xbmc.log.

UPDATE: Not sure if this means anything or not but, I changed the code to this:
Code:
def ShowUserDialog():
  try:
    if actiontype == 0:
      powerMode = "Suspend"
    elif actiontype == 1:
      powerMode = "Hibernate"
    print powerMode
    myArgs = []
    myArgs = [ 'Unlock', 'Cancel' ]
    print myArgs
    userChoice = xbmcgui.Dialog()
    userChoice.yesno("Myth Suspend Alarm", "test")
    print userChoice
  except:
    print "Error Occured"
    traceback.print_exc()

the dialog showed ok, but I had the following in xbmc.log:

Code:
19:36:43 T:2769283952 M:3747811328  NOTICE: Suspend
19:36:43 T:2769283952 M:3747811328  NOTICE: ['Unlock', 'Cancel']
[b]19:36:43 T:2769283952 M:3747852288 WARNING: Skin has invalid include: DialogInfo[/b]19:37:00 T:2769283952 M:3747385344 WARNING: Previous line repeats 5 times.
19:37:00 T:2769283952 M:3747385344  NOTICE: <xbmcgui.Dialog object at 0xa1a77580>
19:37:00 T:2769283952 M:3747385344  NOTICE: MythSuspendAlarm: Beginning powerdown...

So I'm wondering if it's the skin...
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#6
Yup - looks like the skin is guilty.

Switched to Confluence skin and it worked.

I'll post in that forum.

Thanks for your help.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
Dialog().select gives segmentation fault0