getting an edit control in python script crashes xbmc
#1
I have a custom window with id 9542 and an edit control with id 30 and radio button with id 70

I want to read text entered in the edit control, so I do following in my script
PHP Code:
myWindow xbmcgui.Window(19542)
ctrlEditIPAddress myWindow.getControl(30
the xbmc crashes with message:
Segmentation fault (core dumped)

when I try to pass id of radio button like this:
PHP Code:
myWindow.getControl(70
It does not crash.
So why is it crashing for edit control?

Thanks for help in advance.
Reply
#2
Hi, Slinuxgeek,
I have same problem, do you find s solution?
Thanks in advance
Reply
#3
I have the same Problem with Android, Win 7 64bit work

Code:
xel = xbmcgui.Window(xbmcgui.getCurrentWindowId())
    timex = xel.getControl(1304).getText()
what alternative there is to editcontrol

please help
Reply
#4
Supply an example script and a dev will test it out and/or fix the problem.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
if you save this as a script and callest, goodbye xbmc
but there must exist a editcontroll - with other Controlls there is no problem, only with the editcontrol
under windows also no problem

gruß Gerhard

Code:
import xbmcplugin,xbmcgui,xbmc,xbmcaddon,time
from datetime import date, datetime, timedelta

def crashAndroid():

    xel = xbmcgui.Window(xbmcgui.getCurrentWindowId())
    timex = xel.getControl(1304).getText()        # Edit Control in a View
    print timex

crashAndroid()

and this is the Control
Code:
    <control type="edit" id="1304">
                    <posx>10</posx>
                    <posy>530</posy>
                    <width>160</width>
                    <height>25</height>
                    <visible>true</visible>
                    <aligny>center</aligny>
                    <label>Play Time:</label>
                    <hinttext>$INFO[System.Time]</hinttext>
                    <font>font12_title</font>
                    <textoffsetx>10</textoffsetx>
                    <texturefocus>scrollxf-full.png</texturefocus>
                    <texturenofocus>scrollx-full.png</texturenofocus>
                    <pulseonselect>no</pulseonselect>
                </control>

EDIT: with setText() same Problem
Reply
#6
I can see some potential threading issues with calls to getText/setText, but the getControl() by itself doesn't cause it, right? (As per the original thread).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
getControl for Buttons work very fine, i think its a Problem with the Edit Control

Buttons Big Grin
local = xel.getControl(1307).getLabel()
datex = xel.getControl(1301).getLabel()
stream = xel.getControl(1311).getLabel()

Edit Control Confused
timex = xel.getControl(1304).getText()

what is the alternative to a EditControll, i only need one input option for a string
Reply
#8
Again, it's not the problem with the getControl(). The problem is getText(), correct?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#9
yes, the problem is getText()

Edit:
one Poeple test it with ATV 2 - no Problems, work 100%


Nod This Crash Is Powered By Android Nod
Reply
#10
here an alternative which I now use:

I have now created a regular Button, and call this definition to - later I retrieve only the label
also works on Android

Code:
def timeset():
    xel = xbmcgui.Window(xbmcgui.getCurrentWindowId())
    dialog = xbmcgui.Dialog()        
    keyboard = xbmc.Keyboard()
    keyboard.setHiddenInput(False)
    keyboard.setHeading('Set Play Time - examples 20:15 or 2015 or 20x15 ')
    keyboard.doModal()
    if keyboard.isConfirmed():            
           timex = keyboard.getText()
           xel.getControl(1304).setLabel(timex)
Reply
#11
Hi,

Is there any fix to this? I'm having exactly the same problem on Linux.
Reply
#12
Has there been any fix to this problem? I'm having same problem. Kodi crashes when i call getControl() on my Edi control..
Reply
#13
can't reproduce. works fine on linux.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#14
This issue is on Android version of Kodi only right now.

The ControlEdit is somehow broken on android version of kodi.

When there id a ControlEdit, and user invoke 'back' or self.close() it crash with this log:

logcat:

pid: 13700, tid: 13777, name: Thread-3  >>> org.xbmc.kodi <<<
    #00 pc 0000000001165e70  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN9XBMCAddon7xbmcgui11ControlEditD0Ev+264)
    #01 pc 000000000117f218  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN9XBMCAddon7xbmcgui6Window7disposeEv+448)
    #02 pc 0000000001155d14  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN14PythonBindings15cleanForDeallocEPN9XBMCAddon7xbmcgui6WindowE+100)
    #03 pc 000000000142e5c4  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so
    #04 pc 00000000015bc228  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so
    #05 pc 00000000015e5868  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalFrameEx+12912)
    #06 pc 00000000015e5fd4  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalFrameEx+14812)
    #07 pc 00000000015e7b2c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalCodeEx+2012)
    #08 pc 00000000016bc038  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so
    #09 pc 00000000015821b0  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyObject_Call+84)
    #10 pc 00000000015e721c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalFrameEx+19492)
    #11 pc 00000000015e5fd4  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalFrameEx+14812)
    #12 pc 00000000015e5fd4  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalFrameEx+14812)
    #13 pc 00000000015e7b2c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalCodeEx+2012)
    #14 pc 00000000015e7bf0  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyEval_EvalCode+40)
    #15 pc 00000000015fe06c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so
    #16 pc 00000000015fefd8  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (PyRun_FileExFlags+164)
    #17 pc 000000000114e29c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN14CPythonInvoker7executeERKSsRKSt6vectorISsSaISsEE+1652)
    #18 pc 0000000001211758  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN16ILanguageInvoker7ExecuteERKSsRKSt6vectorISsSaISsEE+68)
    #19 pc 000000000114f300  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN14CPythonInvoker7ExecuteERKSsRKSt6vectorISsSaISsEE+240)
    #20 pc 0000000001211a38  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN22CLanguageInvokerThread7ProcessEv+40)
    #21 pc 0000000000b6663c  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN7CThread6ActionEv+44)
    #22 pc 0000000000b668d0  /data/app/org.xbmc.kodi-1/lib/arm64/libkodi.so (_ZN7CThread12staticThreadEPv+148)

Reply
#15
This is the fix for the issue, as this is an android issue only:

In my case I had in `onInit`
python:
self._address = self.getControl(IP_ADDRESS)
I end up with not binding this control to variable I just replace all the variable with direct self.getControl(IP_ADDRESS)
Reply

Logout Mark Read Team Forum Stats Members Help
getting an edit control in python script crashes xbmc0