Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the program crash on auto-completion #8

Open
luffah opened this issue Jul 13, 2016 · 18 comments
Open

the program crash on auto-completion #8

luffah opened this issue Jul 13, 2016 · 18 comments

Comments

@luffah
Copy link

luffah commented Jul 13, 2016

The editor design and functionality seem amazing, but crashs occurs evertime :(

OS : Linux ( Trisquel {a kind of GNU Ubuntu} )
Test case : i openned a css file and edit::::
the program crash on auto-completion

python UliPad.py
begin... 15:01:14
end... 15:01:14
Erreur de segmentation

python UliPad.pyc
begin... 15:05:14
end... 15:05:15
python: Fatal IO error 11 (Ressource temporairement non disponible) on X server :0.0.

@zhangchunlin
Copy link

@limodou Where is the auto-completion related code in ulipad? I can reproduce this issue in ubuntu 16.04 wxgtk3.0 , I want to try fix it.
Thanks.

@limodou
Copy link
Owner

limodou commented Oct 14, 2016

in mixins/InputAssistant.py

@zhangchunlin
Copy link

[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted (core dumped)

Maybe a wxpython bug?

@zhangchunlin
Copy link

It seems that it is a multi-thread issue : https://groups.google.com/forum/#!topic/wxpython-users/6rKyY_ICUSc
Maybe some code need to change to use callafter?
But it is too hard to debug this kind of problem.

@limodou
Copy link
Owner

limodou commented Oct 15, 2016

Yes I think so.

On Sat, Oct 15, 2016 at 10:48 AM, zhangchunlin notifications@github.com
wrote:

It seems that it is a multi-thread issue : https://groups.google.com/
forum/#!topic/wxpython-users/6rKyY_ICUSc
Maybe some code need to change to use callafter?
But it is too hard to debug this kind of problem.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAHHQC3PRVTGU7mTsMqQNJteEfMcgDfvks5q0D8MgaJpZM4JLZgH
.

I like python!
UliPad <>: http://code.google.com/p/ulipad/
UliWeb <>: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou

@zhangchunlin
Copy link

I found that the crash still happen in ubuntu16.04 wxgtk2.8
I install wxgtk2.8 using method of this article: http://askubuntu.com/questions/789302/install-python-wxgtk2-8-on-ubuntu-16-04

But still crash, so it might not because of wxpython version.

@zhangchunlin
Copy link

zhangchunlin commented Oct 20, 2016

There are 2 kinds of errors, one is

begin... 21:54:15
end... 21:54:16
--------------------------------------------------
get_calltip main
     attributes: [] firstword: main
     guess [main] result: ('function', <modules.PyParse.FuncNode object at 0x7fc3fcab1210>)
     begin try_get_obj_type: function [name=main,type=function,span=[4, 7],info=main(),docstring=] []
     try_get_obj_type function [name=main,type=function,span=[4, 7],info=main(),docstring=] 10
     result: source [name=main,type=function,span=[4, 7],info=main(),docstring=] []
     ready to output: source [name=main,type=function,spa

the other:

begin... 21:54:39
end... 21:54:40
--------------------------------------------------
getAutoCompleteList os.
     attributes: [u''] firstword: os
     guess [os] result: None
     getObject: os
import_document
     getObject result [os]: <module 'os' from '/usr/lib/python2.7/os.pyc'>
     ready to output: obj <module 'os' from '/usr/lib/python2.7/os.pyc'>
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:274:poll_for_event: 假设 ‘!xcb_xlib_threads_sequence_lost’ 失败。
已放弃 (核心已转储)

@zhangchunlin
Copy link

But I try wxpython 2.8 demo in ubuntu 16.04, didn't find any crash.

@limodou
Copy link
Owner

limodou commented Nov 2, 2016

我不知道是不是和按键事件的处理有关。因为我为了实现延迟处理,以避免按得快时每次都激活自动补全,所以对按键事件进行了捕获和模拟。可能会对linux不兼容。

@zhangchunlin
Copy link

@limodou 这部分代码在哪里?说不定有规避的方法哈.

@limodou
Copy link
Owner

limodou commented Nov 2, 2016

主体在mixinx中的Editor.py中:

    def clone_key_event(self, event):
        if wx.version().split('.')[:2] > ['2', '8']:
            evt = MyKeyEvent()
            evt.altDown = event.altDown
            evt.controlDown = event.controlDown
            evt.KeyCode = event.KeyCode
            evt.metaDown = event.metaDown
            if wx.Platform == '__WXMSW__':
                evt.RawKeyCode = event.RawKeyCode
                evt.RawKeyFlags = event.RawKeyFlags
            #evt.m_scanCode = event.m_scanCode
            evt.shiftDown = event.shiftDown
            evt.X = event.X
            evt.Y = event.Y
        else:
            evt = wx.KeyEvent()
            evt.m_altDown = event.m_altDown
            evt.m_controlDown = event.m_controlDown
            evt.m_keyCode = event.m_keyCode
            evt.m_metaDown = event.m_metaDown
            if wx.Platform == '__WXMSW__':
                evt.m_rawCode = event.m_rawCode
                evt.m_rawFlags = event.m_rawFlags
            #evt.m_scanCode = event.m_scanCode
            evt.m_shiftDown = event.m_shiftDown
            evt.m_x = event.m_x
            evt.m_y = event.m_y
            evt.SetEventType(event.GetEventType())
            evt.SetId(event.GetId())
        return evt

我通过克隆按键事件,然后延迟处理。不知道这块是不是有问题。

@zhangchunlin
Copy link

recommend ninja-ide ( http://ninja-ide.org/ ), but just use the stable version (now 2.3.x), the beta version 3.x is not stable.

@N46AN
Copy link

N46AN commented Mar 17, 2017

Maybe we can add another option to disable automatic code completion. Instead, a shortcut key has to be pressed to trigger completion.

@zhangchunlin
Copy link

Yes, @N46AN @limodou
After I remove the "def clone_key_event(self, event):" function body, ulipad do not crash any more

@N46AN
Copy link

N46AN commented May 9, 2017

@zhangchunlin , Care to explain with more detail on what you did? I also would like to 'workaround' this issue.
Thanks!

zhangchunlin pushed a commit to zhangchunlin/ulipad that referenced this issue May 9, 2017
@zhangchunlin
Copy link

@zhangchunlin
Copy link

zhangchunlin commented May 16, 2018

Today I happened to find that it is modification of mixins/InputAssistant.py in 5da7d5f which cause this crash issue, so I try to revert and it is OK now and keep the auto completion feature.

@luffah
Copy link
Author

luffah commented May 23, 2018

I shortly tested on my side. It works. (But i'm on debian now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants