Comments (14)
Do you have a minimal/anonymized version of the email that I could use?
It would be easier to test it out on that.
Is this an attached mime-message which you open in Astroid? Does the
thread open and only crash when you try to open the attachment, or at
once when you open the thread?
from astroid.
I just sent you an email with which I can reproduce the bug. Here's the output:
[debug] (23:02:04): ky: Mode, unknown key: j
[debug] (23:02:04): ky: ThreadIndex mode, handling: j (thread_index.next_thread)
[debug] (23:02:05): ky: Mode, unknown key: k
[debug] (23:02:05): ky: ThreadIndex mode, handling: k (thread_index.prev_thread)
[debug] (23:02:07): ky: Mode, unknown key: Return
[debug] (23:02:07): ky: ThreadIndex mode, handling: Return (thread_index.open_thread)
[debug] (23:02:07): ti: open thread: 000000000001f362 (1)
[info ] (23:02:07): tv: using user html file: /home/hugo/.config/astroid/ui/thread-view.html
[debug] (23:02:07): tv: testing version: 1
[info ] (23:02:07): tv: using user css file: /home/hugo/.config/astroid/ui/thread-view.css
[debug] (23:02:07): tv: testing version: 1
[debug] (23:02:07): key: registering key: thread_view.down: j
[debug] (23:02:07): key: registering key: thread_view.next_element: C-j
[debug] (23:02:07): key: registering key: thread_view.scroll_down: J
[debug] (23:02:07): key: alias: Down(65364)
[debug] (23:02:07): key: registering key: thread_view.page_down: C-J
[debug] (23:02:07): key: alias: C-Down(65364)
[debug] (23:02:07): key: alias: 65366(65366)
[debug] (23:02:07): key: registering key: thread_view.up: k
[debug] (23:02:07): key: registering key: thread_view.previous_element: C-k
[debug] (23:02:07): key: registering key: thread_view.scroll_up: K
[debug] (23:02:07): key: alias: Up(65362)
[debug] (23:02:07): key: registering key: thread_view.page_up: C-K
[debug] (23:02:07): key: alias: C-Up(65362)
[debug] (23:02:07): key: alias: 65365(65365)
[debug] (23:02:07): key: registering key: thread_view.home: 1
[debug] (23:02:07): key: alias: Home(65360)
[debug] (23:02:07): key: registering key: thread_view.end: 0
[debug] (23:02:07): key: alias: End(65367)
[debug] (23:02:07): key: registering key: thread_view.activate: Return
[debug] (23:02:07): key: alias: KP_Enter(65421)
[debug] (23:02:07): key: registering key: thread_view.save: s
[debug] (23:02:07): key: registering key: thread_view.delete: d
[debug] (23:02:07): key: registering key: thread_view.open: o
[debug] (23:02:07): key: registering key: thread_view.expand: e
[debug] (23:02:07): key: registering key: thread_view.toggle_expand_all: C-e
[debug] (23:02:07): key: registering key: thread_view.mark: t
[debug] (23:02:07): key: registering key: thread_view.toggle_mark_all: T
[debug] (23:02:07): key: registering key: thread_view.show_remote_images: C-i
[debug] (23:02:07): key: registering key: thread_view.save_all_attachments: S
[debug] (23:02:07): key: registering key: thread_view.next_message: n
[debug] (23:02:07): key: registering key: thread_view.next_message_expand: C-n
[debug] (23:02:07): key: registering key: thread_view.previous_message: p
[debug] (23:02:07): key: registering key: thread_view.previous_message_expand: C-p
[debug] (23:02:07): key: registering key: thread_view.reply: r
[debug] (23:02:07): key: registering key: thread_view.reply_all: G
[debug] (23:02:07): key: registering key: thread_view.forward: f
[debug] (23:02:07): key: registering key: thread_view.flat: C-f
[debug] (23:02:07): key: registering key: thread_view.view_raw: V
[debug] (23:02:07): key: registering key: thread_view.edit_draft: E
[debug] (23:02:07): key: registering key: thread_view.multi.toggle: t
[debug] (23:02:07): key: registering key: thread_view.multi.save: s
[debug] (23:02:07): key: registering key: therad_view.multi: +
[info ] (23:02:07): tv: load thread: 000000000001f362
[info ] (23:02:07): db: open db read-only.
[debug] (23:02:07): db: open time: 0.23 ms.
[info ] (23:02:07): msg: loading mid: [email protected]
[info ] (23:02:07): msg: filename: /home/hugo/Mail/ampoliros/Envoyes/cur/1451858452_0.8031.xps,U=2240,FMD5=f390ab84202335e9b190e29a5c64daa4:2,S
[debug] (23:02:07): chunk: content-type: multipart/signed
[debug] (23:02:07): chunk: multi part
[debug] (23:02:07): chunk: alternative: 0
[debug] (23:02:07): chunk: content-type: multipart/mixed
[debug] (23:02:07): chunk: multi part
[debug] (23:02:07): chunk: alternative: 0
[debug] (23:02:07): chunk: content-type: text/plain
[debug] (23:02:07): chunk: preferred.
[debug] (23:02:07): chunk: is part (viewable: 1, attachment: 0)
[debug] (23:02:07): chunk: content-type: message/rfc822
[debug] (23:02:07): chunk: message part
(astroid:8670): gmime-CRITICAL **: g_mime_content_type_to_string: assertion 'GMIME_IS_CONTENT_TYPE (mime_type)' failed
[debug] (23:02:07): chunk: content-type:
[debug] (23:02:07): chunk: mime message
[debug] (23:02:07): chunk: multi part end
[debug] (23:02:07): chunk: content-type: application/pgp-signature
[debug] (23:02:07): chunk: is part (viewable: 0, attachment: 1)
[debug] (23:02:07): chunk: multi part end
[info ] (23:02:07): render: loading html..
[info ] (23:02:07): tv: navigation action: 5
[info ] (23:02:07): tv: navigating to: /home/hugo/.config/astroid/k5pxepv9x1ayfla371bmprzgm1cjomkwm7jl01vt6auqqupi7x8p8zmmsioazxacc19lfriy6zdcts5v0kz3eyrmzx9z7k79m967ol5pi65uqj3pefzj48co
[debug] (23:02:07): tv: on_load_changed: 0
[info ] (23:02:07): db: closing db.
[debug] (23:02:07): tv: on_load_changed: 1
[debug] (23:02:07): tv: on_load_changed: 3
[debug] (23:02:07): tv: on_load_changed: 2
[debug] (23:02:07): tv: load finished.
[debug] (23:02:07): tv: mathjax request: approved
[debug] (23:02:07): tv: code prettify request: approved
[debug] (23:02:07): render: html loaded, building messages..
[debug] (23:02:07): tv: adding message: [email protected]
[debug] (23:02:07): gravatar: for: XXXXXfsfe.org, uri: http://www.gravatar.com/avatar/c2502eb125052a741348c3ae2eec036a?d=retro&s=48
[info ] (23:02:07): db: open db read-only.
[debug] (23:02:07): db: open time: 0.256 ms.
[info ] (23:02:07): db: closing db.
[debug] (23:02:07): create message part: 0 (siblings: 0) (kids: 2) (attachment: 0) (viewable: 0) (mimetype: multipart/signed)
[debug] (23:02:07): create message part: 1 (siblings: 0) (kids: 2) (attachment: 0) (viewable: 0) (mimetype: multipart/mixed)
[debug] (23:02:07): create message part: 2 (siblings: 0) (kids: 0) (attachment: 0) (viewable: 1) (mimetype: text/plain)
[debug] (23:02:07): create body part: 2
[debug] (23:02:07): chunk: body: part
[debug] (23:02:07): chunk: plain text (out html: 1)
[debug] (23:02:07): enc: quoted-printable
[debug] (23:02:07): charset: utf-8
[debug] (23:02:07): mq: quote filter done, time: 0 ms.
[debug] (23:02:07): tv: code filter done, time: 0 ms.
[debug] (23:02:07): create message part: 3 (siblings: 0) (kids: 1) (attachment: 0) (viewable: 0) (mimetype: message/rfc822)
(astroid:8670): gmime-CRITICAL **: g_mime_content_type_to_string: assertion 'GMIME_IS_CONTENT_TYPE (mime_type)' failed
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
[1] 8670 abort (core dumped) astroid
Is this an attached mime-message which you open in Astroid? Does the thread open and only crash when you try to open the attachment, or at once when you open the thread?
It crashes right away from the thread_index, I never get to thread_view
from astroid.
Hugo Roy writes on January 3, 2016 23:03:
I just sent you an email with which I can reproduce the bug. Here's the output:
Yup, that does it :) Do you mind if I include it in the tests as it is
now (I haven't really looked at it of course :p)?
from astroid.
from astroid.
FYI, another email crashing debut output:
[debug] (23:29:39): create body part: 4
[debug] (23:29:39): chunk: body: part
[debug] (23:29:39): chunk: plain text (out html: 1)
[debug] (23:29:39): enc: 8bit
[debug] (23:29:39): charset: UTF-8
[debug] (23:29:39): mq: quote filter done, time: 0 ms.
[debug] (23:29:39): tv: code filter done, time: 0 ms.
[debug] (23:29:39): create message part: 5 (siblings: 0) (kids: 1) (attachment: 0) (viewable: 0) (mimetype: message/rfc822)
(astroid:6697): gmime-CRITICAL **: g_mime_content_type_to_string: assertion 'GMIME_IS_CONTENT_TYPE (mime_type)' failed
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
[1] 6697 abort (core dumped) astroid
from astroid.
The message "[Gaudenz Steinlin] Bug#810784 [....]" by David Bremner arrived yesterday (jan.12 2015) via the notmuch mailing list which also crashes astroid. Should be the same reason.
from astroid.
The following patch fixes the issue:
diff --git a/src/modes/thread_view/thread_view.cc b/src/modes/thread_view/thread_view.cc
index 58abf08..548089a 100644
--- a/src/modes/thread_view/thread_view.cc
+++ b/src/modes/thread_view/thread_view.cc
@@ -1031,7 +1031,9 @@ namespace Astroid {
bool /* check_siblings */)
{
- ustring mime_type = ustring(g_mime_content_type_to_string (c->content_type));
+ ustring mime_type;
+ if(c && c->content_type)
+ mime_type = ustring(g_mime_content_type_to_string (c->content_type));
log << debug << "create message part: " << c->id << " (siblings: " << c->siblings.size() << ") (kids: " << c->kids.size() << ")" <<
" (attachment: " << c->attachment << ")" << " (viewable: " << c->viewable << ")" << " (mimetype: " << mime_type << ")" << endl;
But I don't konw if it's the best to deal with the issue this way...
from astroid.
ff2000 writes on January 13, 2016 9:35:
The following patch fixes the issue:
diff --git a/src/modes/thread_view/thread_view.cc b/src/modes/thread_view/thread_view.cc index 58abf08..548089a 100644 --- a/src/modes/thread_view/thread_view.cc +++ b/src/modes/thread_view/thread_view.cc @@ -1031,7 +1031,9 @@ namespace Astroid { bool /* check_siblings */) { - ustring mime_type = ustring(g_mime_content_type_to_string (c->content_type)); + ustring mime_type; + if(c && c->content_type) + mime_type = ustring(g_mime_content_type_to_string (c->content_type));
should probably have:
} else {
mime_type = "unknown";
}
log << debug << "create message part: " << c->id << " (siblings: " << c->siblings.size() << ") (kids: " << c->kids.size() << ")" << " (attachment: " << c->attachment << ")" << " (viewable: " << c->viewable << ")" << " (mimetype: " << mime_type << ")" << endl;
But I don't konw if it's the best to deal with the issue this way...
I hope so, can you open the mime-message afterwards?
Also, need to fix the gmime warning in chunk.cc (check the output from
the test-case in #55.
Would be great with a PR, please include the commit from #55 in it too!
from astroid.
Gaute Hope writes on January 13, 2016 9:40:
ff2000 writes on January 13, 2016 9:35:
The following patch fixes the issue:
diff --git a/src/modes/thread_view/thread_view.cc b/src/modes/thread_view/thread_view.cc index 58abf08..548089a 100644 --- a/src/modes/thread_view/thread_view.cc +++ b/src/modes/thread_view/thread_view.cc @@ -1031,7 +1031,9 @@ namespace Astroid { bool /* check_siblings */) { - ustring mime_type = ustring(g_mime_content_type_to_string (c->content_type)); + ustring mime_type; + if(c && c->content_type) + mime_type = ustring(g_mime_content_type_to_string (c->content_type));should probably have:
} else {
mime_type = "unknown";
}
Rather, it should be:
mime_type = "application/octet-stream";
as on line 1625. and you do not need to check if (c), only if
content_type == NULL.
from astroid.
Oh, didn't see your new comments. Need to rebase, which might take some time, as I am not that good at git ;)
from astroid.
The way I would use git here is to keep fixing the minor imporvements and adding them to the branch (as commits), once it matures I would use git rebase -i to squash some of the commits that are not needed to keep in the history. The final rebase is something I could do as well before merging to master. That way it is easy for me to keep track of which comments or improvements have been taken care of.
from astroid.
I know about rebase -i and squash. My issue was, that I merged your commit from #55, then added the changes, so the commits to squash were not follow-ups. I didn't know I can reorder commits in rebase -i which safed my issue ;)
Everything should be OK now.
from astroid.
ff2000 writes on January 13, 2016 10:56:
I know about rebase -i and squash. My issue was, that I merged your commit from #55, then added the changes, so the commits to squash were not follow-ups. I didn't know I can reorder commits in rebase -i which safed my issue ;)
Everything should be OK now.
Thanks, merged, this issue should be fixed now.
from astroid.
It works! :-)
Thanks a lot
from astroid.
Related Issues (20)
- error: no notmuch config file found. HOT 1
- sending mail hangs astroid with adwaita-icon-theme 42 installed HOT 2
- mails display blank screen with webkitgtk 2.36.0 HOT 2
- segfaults handling exclude_tags on startup HOT 2
- "Attach:" Pseudo-Header support
- webkit_settings_set_enable_frame_flattening() deprecation HOT 9
- Wrong variable in error message HOT 1
- How to delete messages not documented HOT 3
- [Feature Request] Package keybindings file by default
- Can't send message, can't edit message. HOT 1
- Messages without a Date header get a bogus fallback value
- segfault when attaching a file to an email HOT 6
- segfault when trying to run HOT 3
- error: no database path specified HOT 3
- Can't open attachments HOT 5
- Can't bind "main_window.next_page" to Ctrl+Tab
- emails shown truncated with webkit 2.40.3 HOT 2
- Expanded mail has fixed height regardless of its content HOT 10
- Can't open HTML parts HOT 5
- Stop using libsoup2.4 and webkit2gtk 4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astroid.