Bug 1128204 - retext crashes with core dump
retext crashes with core dump
Status: RESOLVED WONTFIX
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Other
Leap 15.0
x86-64 SUSE Other
: P5 - None : Major (vote)
: ---
Assigned To: Atri Bhattacharya
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-06 17:44 UTC by Dave Howorth
Modified: 2020-06-14 11:11 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
README.markdown from the php7-redis package (104.11 KB, text/plain)
2019-03-07 13:23 UTC, Dave Howorth
Details
repositories for python packages (556 bytes, text/plain)
2019-03-08 11:49 UTC, Dave Howorth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Howorth 2019-03-06 17:44:40 UTC
I installed retext 6.0.0-lp150.2.3.1 on my Leap 15 system and tried to use it to read the redis README.markdown file. It briefly displays a window then crashes with a core dump.

$ retext /usr/share/doc/packages/php7-redis/README.markdown
Using configuration file: /home/dhoworth/.config/ReText project/ReText.conf
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/site-packages/ReText/converterprocess.py", line 57, in _converter_process_func
    current_markup = markup_class(job['filename'])
  File "/usr/lib/python3.6/site-packages/markups/markdown.py", line 146, in __init__
    self._apply_extensions()
  File "/usr/lib/python3.6/site-packages/markups/markdown.py", line 132, in _apply_extensions
    self.md = self.markdown.Markdown(extensions=extensions_final, output_format='html4')
  File "/usr/lib64/python3.6/site-packages/markdown/core.py", line 100, in __init__
    configs=kwargs.get('extension_configs', {}))
  File "/usr/lib64/python3.6/site-packages/markdown/core.py", line 126, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
  File "/usr/lib64/python3.6/site-packages/markdown/core.py", line 166, in build_extension
    module = importlib.import_module(ext_name)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'markups.mdx_mathjax(enable_dollar_delimiter=False)'
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ReText/tab.py", line 233, in updatePreviewBox
    self.converted = self.converterProcess.get_result()
  File "/usr/lib/python3.6/site-packages/ReText/converterprocess.py", line 136, in get_result
    status, converted = receiveObject(self.conn)
  File "/usr/lib/python3.6/site-packages/ReText/converterprocess.py", line 24, in receiveObject
    sizeBuf = recvall(sock, 4)
  File "/usr/lib/python3.6/site-packages/ReText/converterprocess.py", line 17, in recvall
    raise EOFError('Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?')
EOFError: Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?
Aborted (core dumped)

Sorry, I don't know where core files are put these days, if anywhere. Hopefully the program will crash for you too and you can obtain your own.
Comment 1 Atri Bhattacharya 2019-03-07 11:44:00 UTC
Seems to be working OK for me. Could you attach the file so I can try opening retext with the same file? May be something in the file causes it to crash (it's still a bug then but something we will send upstream).
Comment 2 Dave Howorth 2019-03-07 13:23:32 UTC
Created attachment 799266 [details]
README.markdown from the php7-redis package

No problem, here it is, but it's just README.markdown from the php7-redis package so if there's a problem with the content, that's a bug too.
Comment 3 Atri Bhattacharya 2019-03-08 10:52:43 UTC
Still seems to be working for me. Is there any chance you have a mix-match of python packages from multiple repositories. Please paste the output of the following command from a terminal:

zypper se -x -si python3-Markups python3-Markdown python3-qt5
Comment 4 Dave Howorth 2019-03-08 11:49:52 UTC
Created attachment 799388 [details]
repositories for python packages
Comment 5 Atri Bhattacharya 2019-03-08 13:27:04 UTC
(Sorry for the many questions, but since I cannot reproduce the error on my system, this is the only way I can figure out what is going wrong. I hope you understand, even if this might be somewhat annoying.)

The line "No module named 'markups.mdx_mathjax..." may be worth pursuing further. Can you please let me know what happens when you run the following from a terminal:

python3 -c "import markups.mdx_mathjax as mj; print(mj.MathExtension)"

(On mine, I get <class 'markups.mdx_mathjax.MathExtension'> as the output.)
Comment 6 Dave Howorth 2019-03-08 16:46:15 UTC
(In reply to Atri Bhattacharya from comment #5)
> (Sorry for the many questions, but since I cannot reproduce the error on my
> system, this is the only way I can figure out what is going wrong. I hope
> you understand, even if this might be somewhat annoying.)
> 
> The line "No module named 'markups.mdx_mathjax..." may be worth pursuing
> further. Can you please let me know what happens when you run the following
> from a terminal:
> 
> python3 -c "import markups.mdx_mathjax as mj; print(mj.MathExtension)"
> 
> (On mine, I get <class 'markups.mdx_mathjax.MathExtension'> as the output.)

No problem; I'm glad to help. I get the same output as you. I also ran

$ python3 /usr/bin/retext /usr/share/doc/packages/php7-redis/README.markdown

to see if I got a different result, but I got the same crash. I then wondered if python has a debugger and it does :) So I've single-stepped and it brings up an empty window and then crashes but with a different error (and with the window still on display). FWIW, here's the log:

$ python3 -m pdb /usr/bin/retext /usr/share/doc/packages/php7-redis/README.markdown
> /usr/bin/retext(20)<module>()
-> import multiprocessing as mp
(Pdb) n
> /usr/bin/retext(21)<module>()
-> import sys
(Pdb) n
> /usr/bin/retext(22)<module>()
-> import signal
(Pdb) n
> /usr/bin/retext(23)<module>()
-> import markups
(Pdb) n
> /usr/bin/retext(24)<module>()
-> from os import devnull
(Pdb) n
> /usr/bin/retext(25)<module>()
-> from os.path import join
(Pdb) n
> /usr/bin/retext(26)<module>()
-> from ReText import datadirs, settings, globalSettings, app_version
(Pdb) n
> /usr/bin/retext(27)<module>()
-> from ReText.window import ReTextWindow
(Pdb) n
> /usr/bin/retext(29)<module>()
-> from PyQt5.QtCore import QFile, QFileInfo, QIODevice, QLibraryInfo, \
(Pdb) n
> /usr/bin/retext(31)<module>()
-> from PyQt5.QtWidgets import QApplication
(Pdb) n
> /usr/bin/retext(32)<module>()
-> from PyQt5.QtNetwork import QNetworkProxyFactory
(Pdb) n
> /usr/bin/retext(34)<module>()
-> def canonicalize(option):
(Pdb) n
> /usr/bin/retext(39)<module>()
-> def main():
(Pdb) n
> /usr/bin/retext(101)<module>()
-> if __name__ == '__main__':
(Pdb) n
> /usr/bin/retext(102)<module>()
-> mp.set_start_method('spawn')
(Pdb) n
> /usr/bin/retext(103)<module>()
-> main()
(Pdb) n
Using configuration file: /home/dhoworth/.config/ReText project/ReText.conf
AttributeError: module '__main__' has no attribute '__spec__'
> /usr/bin/retext(103)<module>()
-> main()
(Pdb) n
--Return--
> /usr/bin/retext(103)<module>()->None
-> main()
(Pdb) n
AttributeError: module '__main__' has no attribute '__spec__'
> <string>(1)<module>()->None
(Pdb) n
--Return--
> <string>(1)<module>()->None
(Pdb) n
Traceback (most recent call last):
  File "/usr/lib64/python3.6/pdb.py", line 1667, in main
    pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.6/pdb.py", line 1548, in _runscript
    self.run(statement)
  File "/usr/lib64/python3.6/bdb.py", line 434, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "/usr/bin/retext", line 103, in <module>
    main()
  File "/usr/bin/retext", line 83, in main
    window.openFileWrapper(fileName)
  File "/usr/lib/python3.6/site-packages/ReText/window.py", line 767, in openFileWrapper
    self.createTab(fileName)
  File "/usr/lib/python3.6/site-packages/ReText/window.py", line 459, in createTab
    previewState=int(globalSettings.livePreviewByDefault))
  File "/usr/lib/python3.6/site-packages/ReText/tab.py", line 75, in __init__
    self.converterProcess = converterprocess.ConverterProcess()
  File "/usr/lib/python3.6/site-packages/ReText/converterprocess.py", line 95, in __init__
    child.start()
  File "/usr/lib64/python3.6/multiprocessing/process.py", line 105, in start
    self._popen = self._Popen(self)
  File "/usr/lib64/python3.6/multiprocessing/context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/lib64/python3.6/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/usr/lib64/python3.6/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/lib64/python3.6/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/lib64/python3.6/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/usr/lib64/python3.6/multiprocessing/spawn.py", line 172, in get_preparation_data
    main_mod_name = getattr(main_module.__spec__, "name", None)
AttributeError: module '__main__' has no attribute '__spec__'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/lib64/python3.6/multiprocessing/spawn.py(172)get_preparation_data()
-> main_mod_name = getattr(main_module.__spec__, "name", None)
(Pdb)
Comment 7 Dave Howorth 2019-03-08 16:48:17 UTC
Just to add, I don't really know what I'm doing with the debugger (though I am very familiar with the perl debugger) so I've left that terminal in the state it is. Let me know if I can do anything more useful with it.
Comment 8 Atri Bhattacharya 2019-03-10 13:28:52 UTC
I actually see similar messages when running retext via the python debugger, but in my case the app just keeps going. So, this may not be the major issue.

Fwiw, you can run gdb on the coredump process as follows:

sudo coredumpctl list # List all coredumps
sudo coredumpctl gdb <pid> # Where <pid> is the process-id from
                           # the above list which dumped core

May be this helps.
Comment 9 Dave Howorth 2019-03-10 15:34:43 UTC
Thanks. sudo coredumpctl list gives me a status of 'none' for all /usr/bin/python3.6 entries and a lot of others, and 'missing' for all the rest. So I suppose there's something I need to adjust to get a dump? It all used to be so much simpler.

BTW, I used retext to view a different markdown file and got a similar crash, so it doesn't seem likely to be a data-dependent error so much as it seems there must be something different in my environment that isn't correctly handled by retext, but finding what it is and where the retext code needs tightening up is the tricky bit :)
Comment 10 Dave Howorth 2019-03-10 15:36:47 UTC
(In reply to Atri Bhattacharya from comment #8)
> I actually see similar messages when running retext via the python debugger,
> but in my case the app just keeps going. So, this may not be the major issue.

Just to add, where does your debugging log start to diverge from mine? That might be a good place to start looking for whatever's happening on my machine.
Comment 11 Atri Bhattacharya 2020-06-07 19:16:08 UTC
Sorry Dave, I missed the train on this one. Can you still reproduce this with the latest TW?
Comment 12 Atri Bhattacharya 2020-06-14 11:11:53 UTC
Many thanks for the report. However, Leap 15.0 reached end-of-life status on Dec 3, 2019. Please reopen if you can reproduce the issue with a supported version of openSUSE (Leap 15.1, Leap 15.2, or Tumbleweed).