akrennmair / newsbeuter

Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
http://www.newsbeuter.org/
MIT License
781 stars 100 forks source link

Seg. fault on TTRSS .OPML import #569

Open bobberb opened 7 years ago

bobberb commented 7 years ago

Newsbeuter version:

newsbeuter 2.10-d1c1 System: Linux 4.11.5-1-ARCH (x86_64) Compiler: g++ 7.1.1 20170528 ncurses: ncurses 6.0.20170527 (compiled with 6.0) libcurl: libcurl/7.54.1 OpenSSL/1.1.0f zlib/1.2.11 libpsl/0.17.0 (+libicu/59.1) libssh2/1.8.0 nghttp2/1.23.1 (compiled with 7.54.1) SQLite: 3.19.3 (compiled with 3.19.3) libxml2: compiled with 2.9.4

Steps to reproduce the issue:

  1. compile github master
  2. Fresh install
  3. Import tt-rss exported .opml

gdb debug log:

Starting program: /usr/bin/newsbeuter -i /tank/user/dump/selfhosted_data/TinyTinyRSS_2017-06-07.opml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6424a36 in __strcmp_ssse3 () from /usr/lib/libc.so.6
#0  0x00007ffff6424a36 in __strcmp_ssse3 () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x00000000004647cb in newsbeuter::controller::rec_find_rss_outlines (this=0x7fffffffdac0, 
    node=0x8857f0, tag="tt-rss-filters") at src/controller.cpp:1108
        newtag = "tt-rss-filters"
        __PRETTY_FUNCTION__ = "void newsbeuter::controller::rec_find_rss_outlines(xmlNode*, std::__cxx11::string)"
#2  0x000000000046508d in newsbeuter::controller::rec_find_rss_outlines (this=0x7fffffffdac0, 
    node=0x885320, tag="tt-rss-filters") at src/controller.cpp:1174
        newtag = "tt-rss-filters"
        __PRETTY_FUNCTION__ = "void newsbeuter::controller::rec_find_rss_outlines(xmlNode*, std::__cxx11::string)"
#3  0x000000000046508d in newsbeuter::controller::rec_find_rss_outlines (this=0x7fffffffdac0, 
    node=0x885020, tag="") at src/controller.cpp:1174
        newtag = "tt-rss-filters"
        __PRETTY_FUNCTION__ = "void newsbeuter::controller::rec_find_rss_outlines(xmlNode*, std::__cxx11::string)"
#4  0x00000000004641c2 in newsbeuter::controller::import_opml (this=0x7fffffffdac0, 
    filename="/tank/user/dump/selfhosted_data/TinyTinyRSS_2017-06-07.opml")
    at src/controller.cpp:1063
        node = 0x842fd0
        doc = 0x831110
        root = 0x831460
#5  0x000000000045b32f in newsbeuter::controller::run (this=0x7fffffffdac0, argc=3, 
    argv=0x7fffffffdf68) at src/controller.cpp:357
        c = -1
        do_import = true
        do_export = false
        cachefile_given_on_cmdline = false
        do_vacuum = false
        importfile = "/tank/user/dump/selfhosted_data/TinyTinyRSS_2017-06-07.opml"
        do_read_import = false
        do_read_export = false
        readinfofile = ""
        show_version = 0
        silent = true
        execute_cmds = false
        getopt_str = "i:erhqu:c:C:d:l:vVoxXI:E:"
        longopts = {{name = 0x578eaa "cache-file", has_arg = 1, flag = 0x0, val = 99}, {
            name = 0x578eb5 "config-file", has_arg = 1, flag = 0x0, val = 67}, {
            name = 0x578ec1 "execute", has_arg = 1, flag = 0x0, val = 120}, {
            name = 0x578ec9 "export-to-file", has_arg = 1, flag = 0x0, val = 69}, {
name = 0x578ed8 Quit
quit
Minoru commented 7 years ago

Hi! Thank you for the report!

I grabbed Gwern's OPML file from https://raw.githubusercontent.com/gwern/gwern.net/master/docs/personal/rss-subscriptions.opml , and it imported just fine. Can you share yours?

Alternatively you can narrow it down by deleting parts of the file and keeping the one that triggers the issue, then repeating until you boiled it down to a few lines, then share that (maybe censoring the URLs).

Minoru commented 7 years ago

Oh, and of course you can try Gwern's file with your build to make sure this isn't due to compiler/libraries/other environment-specific things.

bobberb commented 7 years ago

Gwern's OPML does work. I'll see if I can narrow down mine and post it shortly.

bobberb commented 7 years ago

Found the error:

Whereas gwern has a working <outline> for folders, tt-rss is exporting them as

<outline text="Android">

I was able to fix this by reformatting to

<outline title="Android" text="Android" description="Android" type="folder">

Minoru commented 7 years ago

Cool! Here's what I'm going to do over the next few days regarding this:

Minoru commented 7 years ago

OPML spec allows what TT-RSS does:

An is an XML element containing at least one required attribute, text, and zero or more additional attributes.

Need to take a look at our OPML-importing code and see why it requires any other attributes at all. I don't plan to look into this immediately; this issue is free for the taking.