unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Segmentation fault in notmuch search --format=json
@ 2012-08-07  5:52 Ben Gamari
  2012-08-07  7:07 ` Mark Walters
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Gamari @ 2012-08-07  5:52 UTC (permalink / raw)
  To: notmuch

It seems some messages trigger a segmentation fault in
`do_search_threads()`. It appears the problem occurs (at least) when
`authors` is NULL.

    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000415aa3 in json_string (sp=0x646c70, val=0x0) at sprinter-json.c:121
    121	    json_string_len (sp, val, strlen (val));
    (gdb) bt
    #0  0x0000000000415aa3 in json_string (sp=0x646c70, val=0x0)
        at sprinter-json.c:121
    #1  0x000000000041084b in do_search_threads (format=0x646c70, query=0x64bb70, 
        sort=NOTMUCH_SORT_NEWEST_FIRST, output=OUTPUT_SUMMARY, offset=0, limit=-1)
        at notmuch-search.c:131
    #2  0x0000000000411361 in notmuch_search_command (ctx=0x6361b0, argc=3, 
        argv=0x7fffffffdfb0) at notmuch-search.c:405
    #3  0x0000000000409e22 in main (argc=4, argv=0x7fffffffdfa8) at notmuch.c:294
    (gdb) up
    #1  0x000000000041084b in do_search_threads (format=0x646c70, query=0x64bb70, 
        sort=NOTMUCH_SORT_NEWEST_FIRST, output=OUTPUT_SUMMARY, offset=0, limit=-1)
        at notmuch-search.c:131
    131			format->string (format, authors);
    (gdb) list
    126			format->map_key (format, "matched");
    127			format->integer (format, matched);
    128			format->map_key (format, "total");
    129			format->integer (format, total);
    130			format->map_key (format, "authors");
    131			format->string (format, authors);
    132			format->map_key (format, "subject");
    133			format->string (format, subject);
    134		    }
    135	
    (gdb) 

It seems that the message in question was produced by a script I use to
feed RSS feeds into notmuch so while I wouldn't doubt that there are few
cases where `authors` should be NULL, it would be nice if notmuch
handled this case with a bit more grace.

Cheers,

- Ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-08 16:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07  5:52 Segmentation fault in notmuch search --format=json Ben Gamari
2012-08-07  7:07 ` Mark Walters
2012-08-07  8:08   ` Jameson Graef Rollins
2012-08-07 12:49   ` Austin Clements
2012-08-07 19:48   ` [PATCH] sprinters: bugfix when NULL passed for a string Mark Walters
2012-08-08  1:36     ` Jameson Graef Rollins
2012-08-08  2:09     ` Austin Clements
2012-08-08  7:31       ` Mark Walters
2012-08-08 16:25         ` Jameson Graef Rollins

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).