Re: [gmime-devel] Porting from GMime 2.6 to GMime 3



Hi,

So I *think* the problem is that you haven't called g_mime_init() which initializes the default GMimeParserOptions.

Jeff

On 4/26/2019 12:45 PM, Detlef Graef wrote:
Hi,

I'm trying to build the newsreader Pan
(https://gitlab.gnome.org/GNOME/pan) with GMime 3.

A segfault occurs when calling the follwing function:

messages[i] = g_mime_parser_construct_message(parser, NULL);

Whith GMime 2.6 the calls looks as follows:

messages[i] = g_mime_parser_construct_message(parser);

Backtrace from gdb:

Thread 1 "pan" received signal SIGSEGV, Segmentation fault.
0x00007ffff745ff99 in g_mime_parser_options_clone () from
/usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
(gdb) ba
#0  0x00007ffff745ff99 in g_mime_parser_options_clone () at
/usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
#1  0x00007ffff7451755 in g_mime_header_list_new () at
/usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
#2  0x00007ffff7457ac6 in  () at /usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
#3  0x00007ffff770108c in g_type_create_instance () at
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4  0x00007ffff76e3528 in  () at
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff76e4ca5 in g_object_new_with_properties () at
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007ffff76e5711 in g_object_new () at
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007ffff7453b3d in g_mime_message_new () at
/usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
#8  0x00007ffff745fa45 in g_mime_parser_construct_message () at
/usr/lib/x86_64-linux-gnu/libgmime-3.0.so.0
#9  0x00005555556bf7dd in pan::mime::construct_message(_GMimeStream**,
int, pan::GPGDecErr&) (istreams=<optimized out>, qty=1, err=...)
     at mime-utils.cc:1201
...


I've had a similar issue (segfault) with the function
g_mime_utils_header_decode_text()

First I had (a segfault occured):
char * decoded (g_mime_utils_header_decode_text (NULL, s.c_str()));

Then I created GMimeParserOptions with default settings like this (then
it works):

GMimeParserOptions *gmpo  = g_mime_parser_options_new();
char * decoded (g_mime_utils_header_decode_text (gmpo, s.c_str()));
g_mime_parser_options_free (gmpo);


Passing GMimeParserOptions with default settings to
g_mime_parser_construct_message() doesn't solve the segfault.

The segfault occurs trying to open any news article.

Used version of GMime lib (from
/usr/include/gmime-3.0/gmime/gmime-version.h):

#define GMIME_MAJOR_VERSION (3U)
#define GMIME_MINOR_VERSION (2U)
#define GMIME_MICRO_VERSION (1U)

libgmime-3.0-dev    3.2.1-1 (Debian package version)

gcc version: gcc version 8.3.0 (Debian 8.3.0-6)


Any advice is appreciated. Thanks.


Best regards,

Detlef
_______________________________________________
gmime-devel-list mailing list
gmime-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gmime-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]