Rev b937f02 in devel cures python_terminal segfaults

62 views
Skip to first unread message

Edward K. Ream

unread,
Jun 19, 2019, 10:39:50 AM6/19/19
to leo-editor
When entering a blank line, the last_line var was unexpected assigned to [] instead of an empty string.

Imo, the resulting segfault must be a python bug somewhere, but I haven't isolated it yet.

Please test the python_terminal plugin and report any further troubles.

Edward

Edward K. Ream

unread,
Jun 19, 2019, 10:53:35 AM6/19/19
to leo-editor
On Wednesday, June 19, 2019 at 9:39:50 AM UTC-5, Edward K. Ream wrote:

Imo, the resulting segfault must be a python bug somewhere, but I haven't isolated it yet.

Er, probably not.  Python may have been justified in reporting an "uncaught exception".

Rev 76a235a now catches all exceptions in the python_terminal key handler. Most of Leo is covered like this, but the occasional event handler isn't.

Edward

Chris George

unread,
Jun 19, 2019, 11:38:06 AM6/19/19
to leo-e...@googlegroups.com
chris@technatica:~/leo-editor$ python3 ./launchLeo.py --trace=startup

setting leoID from os.getenv('USER'): 'chris'
reading settings in /home/chris/leo-editor/leo/config/leoSettings.leo
reading settings in /home/chris/.leo/myLeoSettings.leo
reading settings in /home/chris/.leo/themes/BreezeDarkThemeLocal.leo
getGitVersion commit 76a235a6538293f5dcd0fca63d5ffb2d98c84f22
Author: Edward K. Ream <edre...@gmail.com>
Date:   2019-06-19 09:50:05 -0500

    Catch all exceptions in PyInterp.keyPressEvent

getGitVersion commit 76a235a6538293f5dcd0fca63d5ffb2d98c84f22
Author: Edward K. Ream <edre...@gmail.com>
Date:   2019-06-19 09:50:05 -0500

    Catch all exceptions in PyInterp.keyPressEvent

Leo 6.0-b2-devel, devel branch, build 76a235a653
2019-06-19 09:50:05 -0500
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = python3.6 path = /usr/bin pid = 19054
KCrash: Arguments: /usr/bin/python3.6
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0

[1]+  Stopped                 python3 ./launchLeo.py --trace=startup

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/238f7229-5867-4b24-a082-161d3c631fd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edward K. Ream

unread,
Jun 19, 2019, 11:44:31 AM6/19/19
to leo-editor
On Wed, Jun 19, 2019 at 10:38 AM Chris George <techn...@gmail.com> wrote:
chris@technatica:~/leo-editor$ python3 ./launchLeo.py --trace=startup
 
KCrash: crashing... crashRecursionCounter = 2
...
[1]+  Stopped                 python3 ./launchLeo.py --trace=startup

Well, that's too bad.  Lot's of problems remain, but segfaults don't happen for me.

The detailed segfault messages don't help.

Please describe what you were doing when the segfault happened.

Previously, just entering a blank line caused the crash.

Really, python should never segfault outside of Qt and other C modules.

Edward

Chris George

unread,
Jun 19, 2019, 12:02:50 PM6/19/19
to leo-editor
I was starting Leo. This is the exact same thing that happens every time I enable this plugin. I have seen this when using three different distributions over the past six months or so.

The startup process never completes. I never see a widget or the mainwindow.

Luckily I am getting real good at editing myLeoSettings.leo with kwrite. This would hit me every time I downloaded a clean install of Leo after installing a fresh OS.

So I was not doing anything to trigger it other than try to start Leo.

Chris

Edward K. Ream

unread,
Jun 19, 2019, 1:03:03 PM6/19/19
to leo-editor
On Wed, Jun 19, 2019 at 11:02 AM Chris George <techn...@gmail.com> wrote:
I was starting Leo.

Whoa.  That's totally unexpected.  That's an important clue.

Edward

Edward K. Ream

unread,
Jun 19, 2019, 1:23:09 PM6/19/19
to leo-editor
Important, but not hopeful.  I had forgotten (if I ever knew) that the plugin uses a subclass of class code.InteractiveInterpreter.  My guess is the crash happens in PyInterp.initInterpreter, which does  some pretty strange things.

I also took a look at pyzo's PythonShell class, but that's not too helpful, as it just sends a message (via yoton) somewhere else.

In short, this looks like a project for another day.

Edward

Jacob Peck

unread,
Jun 19, 2019, 2:02:55 PM6/19/19
to leo-e...@googlegroups.com

Hi all,

I've been out of Leo development for a while now.  But I'm sorry this little plugin toy of mine is causing such huge issues.  I'm surprised to hear of segfaults in python, though.

FWIW, I never intended the plugin to be enabled by default -- it was just a quick proof of concept on my part.  But that doesn't excuse the poor code I pushed back in those days.

A thousand apologies!

-->Jake

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.

Edward K. Ream

unread,
Jun 19, 2019, 3:54:55 PM6/19/19
to leo-editor
On Wed, Jun 19, 2019 at 1:02 PM Jacob Peck <gates...@gmail.com> wrote:
I've been out of Leo development for a while now.  But I'm sorry this little plugin toy of mine is causing such huge issues.  I'm surprised to hear of segfaults in python, though.

That's hardly your fault.

FWIW, I never intended the plugin to be enabled by default -- it was just a quick proof of concept on my part.  But that doesn't excuse the poor code I pushed back in those days.

A thousand apologies!

None needed.  I've messed around with code, and probably messed it up.

Edward
Reply all
Reply to author
Forward
0 new messages