strange issue with Mutable Array

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

strange issue with Mutable Array

Riccardo Mottola-5
Hi,

Sebastian sent me a stacktrace of GNUMail+Pantomime crashing for him.

Now the issues could be many leading to the crash, but I do not the understand the stactrace, which I paste below.

Frame 2 comes from this code:

[_properties removeObjectForKey: theKey];

can removeObjectForKey fail in a bad way ?

 theKey is a constant, it comes from line 531;
[self setProperty: theBaseSubject forKey: @"baseSubject"]; theBaseSubjet is explicitely nil. The code seems quite simple in this regard. _properties itself is allocated/retained in init and released at the end. Any suggestions? Besides that the whole Message is for some reason not properly retained or allocated, thus leading to a garbage situation- Riccardo
Program received signal SIGBUS, Bus error.
0x00000c48e63800f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
(gdb) bt
#0  0x00000c48e63800f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
#1  0x00000c48fba1ebf8 in -[CWMessage setProperty:forKey:] (self=0xc4862ca8a08, _cmd=0xc48fbd1fc00 <.objc_selector_list+816>, theProperty=0x0, 
    theKey=0xc48fbd1e760 <.objc_str.86>) at CWMessage.m:592
#2  0x00000c48fba1e9f3 in -[CWMessage setBaseSubject:] (self=0xc4862ca8a08, _cmd=0xc48fbd1fe10 <.objc_selector_list+1344>, theBaseSubject=0x0) at CWMessage.m:531
#3  0x00000c48fba1e912 in -[CWMessage setSubject:] (self=0xc4862ca8a08, _cmd=0xc48fbd22908 <.objc_selector_list+880>, theSubject=0xc488c5bc988) at CWMessage.m:502
#4  0x00000c48fba2aebf in +[CWParser parseSubject:inMessage:quick:] (self=0xc48fbd22398 <_OBJC_CLASS_CWParser>, _cmd=0xc48fbd1fdc0 <.objc_selector_list+1264>, 
    theLine=0xc48b5360708, theMessage=0xc4862ca8a08, theBOOL=0 '\000') at CWParser.m:929
#5  0x00000c48fba22f26 in -[CWMessage addHeadersFromData:record:] (self=0xc4862ca8a08, _cmd=0xc48fbd1f9f0 <.objc_selector_list+288>, theHeaders=0xc48b53601c8, 
    theRecord=0x7f7ffffc10c8) at CWMessage.m:1470
#6  0x00000c48fba23248 in -[CWMessage setHeadersFromData:record:] (self=0xc4862ca8a08, _cmd=0xc48fbd07d88 <.objc_selector_list+1168>, theHeaders=0xc48b5360a08, 
    theRecord=0x7f7ffffc10c8) at CWMessage.m:1510
#7  0x00000c48fb9fdad3 in -[CWIMAPStore(Private) _parseFETCH:] (self=0xc484c937708, _cmd=0xc48fbd07b48 <.objc_selector_list+592>, theMSN=12641) at CWIMAPStore.m:2100
#8  0x00000c48fb9f71b4 in -[CWIMAPStore updateRead] (self=0xc484c937708, _cmd=0xc48fbd29e60 <.objc_selector_list+832>) at CWIMAPStore.m:560
#9  0x00000c48fba389b9 in -[CWService receivedEvent:type:extra:forMode:] (self=0xc484c937708, _cmd=0xc48460365e8 <.objc_selector_list+96>, theData=0xa, 
    theType=ET_RDESC, theExtra=0xa, theMode=0xc4845fc6f28 <.objc_str>) at CWService.m:654
#10 0x00000c4845905dcf in -[GSRunLoopCtxt pollUntil:within:] (self=0xc483ab08b08, _cmd=0xc4845fc82e8 <.objc_selector_list+1232>, milliseconds=0, 
    contexts=0xc4901638e08) at GSRunLoopCtxt.m:600
#11 0x00000c48457ea6c1 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0xc4853475008, _cmd=0xc4845fc7e78 <.objc_selector_list+96>, 
    mode=0xc4845fc6f28 <.objc_str>, limit_date=0xc48b0b661a8) at NSRunLoop.m:1224
#12 0x00000c48457eac7a in -[NSRunLoop runMode:beforeDate:] (self=0xc4853475008, _cmd=0xc4879125110 <.objc_selector_list+400>, mode=0xc4845fc6f28 <.objc_str>, 
    date=0xc4853478808) at NSRunLoop.m:1304
#13 0x00000c487861c4d7 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0xc48fd5bd008, 
    _cmd=0xc48e5c24e78 <.objc_selector_list+144>, mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at GSDisplayServer.m:1040
#14 0x00000c48e5929544 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0xc48fd5bd008, _cmd=0xc4878fbee58 <.objc_selector_list+3072>, 
    mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at XGServerEvent.m:2575
#15 0x00000c48783a104c in DPSGetEvent (ctxt=0xc48fd5bd008, mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>)
    at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
#16 0x00000c48783a1e5c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0xc48f93e6e08, _cmd=0xc4878fbf6e8 <.objc_selector_list+5264>, 
    mask=4294967295, expiration=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at NSApplication.m:2178
#17 0x00000c487839ff0c in -[NSApplication run] (self=0xc48f93e6e08, _cmd=0xc4878faaa30 <.objc_selector_list+144>) at NSApplication.m:1553
#18 0x00000c4878373883 in NSApplicationMain (argc=1, argv=0x7f7ffffc3b68) at Functions.m:91
#19 0x00000c462990065e in gnustep_base_user_main (argc=1, argv=0x7f7ffffc3b68, env=0x7f7ffffc3b78) at GNUMail_main.m:41
#20 0x00000c48457ceb8a in main (argc=1, argv=0x7f7ffffc3b68, env=0x7f7ffffc3b78) at NSProcessInfo.m:1002

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Riccardo Mottola-5
Hi,

I mistyped the title: of course it is a Mutable Dictionary and allocated
as such, or the method would be non-existent.

Riccardo

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Fred Kiefer
In reply to this post by Riccardo Mottola-5
Hi Riccardo,

it is hard to help out with the amount of information given. Which version of Pantomime is Sebastian using? And how was the object causing the issue created? (init, initWithData:, initWithCoder:)

The class CWMessage itself is quite a mess. The init method set the version number, this belongs of course into the initialize method that is also present. The initWithData: method work only because the super implementation of this method calls the init method. The initWithData:charset: method is wrong, but it could as well just be deleted as this method is present on the super class and correct there. And the initWithCoder: method does not initialize the _properties ivar.

I would suggest that you clean up these issues first (and similar ones in the super class CWPart) and if the problem persists we have another go on it. If you have trouble with the clean up and am willing to help. I just don’t want to analyse a clearly broken class.

Fred

> Am 15.03.2018 um 12:10 schrieb Riccardo Mottola <[hidden email]>:
>
> Hi,
>
> Sebastian sent me a stacktrace of GNUMail+Pantomime crashing for him.
>
> Now the issues could be many leading to the crash, but I do not the understand the stactrace, which I paste below.
>
> Frame 2 comes from this code:
>
> [_properties removeObjectForKey: theKey];
>
> can removeObjectForKey fail in a bad way ?
>
>  theKey is a constant, it comes from line 531;
> [self setProperty: theBaseSubject  forKey: @"baseSubject"
> ];
>
> theBaseSubjet is explicitely nil. The code seems quite simple in this regard.
> _properties itself is allocated/retained in init and released at the end.
>
> Any suggestions? Besides that the whole Message is for some reason not properly retained or allocated, thus leading to a garbage situation-
>
>
> Riccardo
>
>
>  
> Program received signal SIGBUS, Bus error.
> 0x00000c48e63800f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
> (gdb) bt
> #0  0x00000c48e63800f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
> #1  0x00000c48fba1ebf8 in -[CWMessage setProperty:forKey:] (self=0xc4862ca8a08, _cmd=0xc48fbd1fc00 <.objc_selector_list+816>, theProperty=0x0,
>     theKey=0xc48fbd1e760 <.objc_str.86>) at CWMessage.m:592
> #2  0x00000c48fba1e9f3 in -[CWMessage setBaseSubject:] (self=0xc4862ca8a08, _cmd=0xc48fbd1fe10 <.objc_selector_list+1344>, theBaseSubject=0x0) at CWMessage.m:531
> #3  0x00000c48fba1e912 in -[CWMessage setSubject:] (self=0xc4862ca8a08, _cmd=0xc48fbd22908 <.objc_selector_list+880>, theSubject=0xc488c5bc988) at CWMessage.m:502
> #4  0x00000c48fba2aebf in +[CWParser parseSubject:inMessage:quick:] (self=0xc48fbd22398 <_OBJC_CLASS_CWParser>, _cmd=0xc48fbd1fdc0 <.objc_selector_list+1264>,
>     theLine=0xc48b5360708, theMessage=0xc4862ca8a08, theBOOL=0 '\000') at CWParser.m:929
> #5  0x00000c48fba22f26 in -[CWMessage addHeadersFromData:record:] (self=0xc4862ca8a08, _cmd=0xc48fbd1f9f0 <.objc_selector_list+288>, theHeaders=0xc48b53601c8,
>     theRecord=0x7f7ffffc10c8) at CWMessage.m:1470
> #6  0x00000c48fba23248 in -[CWMessage setHeadersFromData:record:] (self=0xc4862ca8a08, _cmd=0xc48fbd07d88 <.objc_selector_list+1168>, theHeaders=0xc48b5360a08,
>     theRecord=0x7f7ffffc10c8) at CWMessage.m:1510
> #7  0x00000c48fb9fdad3 in -[CWIMAPStore(Private) _parseFETCH:] (self=0xc484c937708, _cmd=0xc48fbd07b48 <.objc_selector_list+592>, theMSN=12641) at CWIMAPStore.m:2100
> #8  0x00000c48fb9f71b4 in -[CWIMAPStore updateRead] (self=0xc484c937708, _cmd=0xc48fbd29e60 <.objc_selector_list+832>) at CWIMAPStore.m:560
> #9  0x00000c48fba389b9 in -[CWService receivedEvent:type:extra:forMode:] (self=0xc484c937708, _cmd=0xc48460365e8 <.objc_selector_list+96>, theData=0xa,
>     theType=ET_RDESC, theExtra=0xa, theMode=0xc4845fc6f28 <.objc_str>) at CWService.m:654
> #10 0x00000c4845905dcf in -[GSRunLoopCtxt pollUntil:within:] (self=0xc483ab08b08, _cmd=0xc4845fc82e8 <.objc_selector_list+1232>, milliseconds=0,
>     contexts=0xc4901638e08) at GSRunLoopCtxt.m:600
> #11 0x00000c48457ea6c1 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0xc4853475008, _cmd=0xc4845fc7e78 <.objc_selector_list+96>,
>     mode=0xc4845fc6f28 <.objc_str>, limit_date=0xc48b0b661a8) at NSRunLoop.m:1224
> #12 0x00000c48457eac7a in -[NSRunLoop runMode:beforeDate:] (self=0xc4853475008, _cmd=0xc4879125110 <.objc_selector_list+400>, mode=0xc4845fc6f28 <.objc_str>,
>     date=0xc4853478808) at NSRunLoop.m:1304
> #13 0x00000c487861c4d7 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0xc48fd5bd008,
>     _cmd=0xc48e5c24e78 <.objc_selector_list+144>, mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at GSDisplayServer.m:1040
> #14 0x00000c48e5929544 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0xc48fd5bd008, _cmd=0xc4878fbee58 <.objc_selector_list+3072>,
>     mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at XGServerEvent.m:2575
> #15 0x00000c48783a104c in DPSGetEvent (ctxt=0xc48fd5bd008, mask=4294967295, limit=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>)
>     at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
> #16 0x00000c48783a1e5c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0xc48f93e6e08, _cmd=0xc4878fbf6e8 <.objc_selector_list+5264>,
>     mask=4294967295, expiration=0xc4853478808, mode=0xc4845fc6f28 <.objc_str>, flag=1 '\001') at NSApplication.m:2178
> #17 0x00000c487839ff0c in -[NSApplication run] (self=0xc48f93e6e08, _cmd=0xc4878faaa30 <.objc_selector_list+144>) at NSApplication.m:1553
> #18 0x00000c4878373883 in NSApplicationMain (argc=1, argv=0x7f7ffffc3b68) at Functions.m:91
> #19 0x00000c462990065e in gnustep_base_user_main (argc=1, argv=0x7f7ffffc3b68, env=0x7f7ffffc3b78) at GNUMail_main.m:41
> #20 0x00000c48457ceb8a in main (argc=1, argv=0x7f7ffffc3b68, env=0x7f7ffffc3b78) at NSProcessInfo.m:1002
>
> _______________________________________________
> Gnustep-dev mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/gnustep-dev


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Riccardo Mottola-5
Fred Kiefer wrote:
> Hi Riccardo,
>
> it is hard to help out with the amount of information given. Which version of Pantomime is Sebastian using? And how was the object causing the issue created? (init, initWithData:, initWithCoder:)

I have some further information here, Sebastian send me other stacks (he
is using current SVN) of repeated crashes and they are all related in
CWIMAPCacheManager and the method initInRange

http://svn.savannah.gnu.org/viewvc/gnustep-nonfsf/frameworks/pantomime/Framework/Pantomime/CWIMAPCacheManager.m?revision=643&view=markup&sortby=date

Here a message is allocated with:
aMessage = [[CWIMAPMessage alloc] init];


then a series of properties are set using CWParser parseXXXX (including
the subject)

The crashes happen either when the pool is released in line 224 and NSData
or in the setter of one of the properties, as the first stack or with a
crash at line 181, which is still inside this method.

Thus, this restricts to the "standard" init method of CWImapMessage (and
the chain of CWMessage and CWPart), one of the setter/parser methods  or
some memory error of the file handling.

I Don't see at a glance a gross error in CWImapCacheManager -
initInRange, neither in the init hierarchy of
CWIMAP-Message-CWMessage-CWPart
>
> The class CWMessage itself is quite a mess. The init method set the version number, this belongs of course into the initialize method that is also present. The initWithData: method work only because the super implementation of this method calls the init method. The initWithData:charset: method is wrong, but it could as well just be deleted as this method is present on the super class and correct there. And the initWithCoder: method does not initialize the _properties ivar.
>
> I would suggest that you clean up these issues first (and similar ones in the super class CWPart) and if the problem persists we have another go on it. If you have trouble with the clean up and am willing to help. I just don’t want to analyse a clearly broken class.
>

Yes it is confusing... also CWMessage has many subclases, so changes
need to be kept in-sync.
I'd appreciate some experience here and if possible, I'd clean up things
gradually. As first, all "plain" init methods, whech seem to be the one
involved in this crash, extenging them to the others.
There are many comments in the code on how it is dangerous e.g. to set
things using accessors instead of setting private IVars or other things
which sound very scary.

Riccardo

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Yavor Doganov-3
В Fri, 16 Mar 2018 14:57:53 +0100, Riccardo Mottola написа:

> The crashes happen either when the pool is released in line 224 and
> NSData or in the setter of one of the properties, as the first stack
> or with a crash at line 181, which is still inside this method.

You haven't posted a backtrace.  I assume you cannot reproduce?

> I Don't see at a glance a gross error in CWImapCacheManager -

Hmm, this is perhaps the buggiest part of the library, or at least the
most fragile.  I remember ~15 years ago Ludo was advising users to
just delete the cache if something goes wrong.

A shot in the dark, but maybe there are some type mismatches or broken
pointer arithmetic (or both) here or in the io.c function definitions.
I would suggest uncommenting these NSLog statements (or converting
them permanently to the appropriate NSDebug*Log) to see what's going
on.  Don't forget to adjust the specifiers for the expected types.

If the crashes occur on a 64-bit machine, it would probably help to
verify if they are reproducible on 32-bit.


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Riccardo Mottola-5
Hi Yavor,

On 2018-03-16 21:49:13 +0100 Yavor Doganov <[hidden email]> wrote:

> В Fri, 16 Mar 2018 14:57:53 +0100, Riccardo Mottola написа:
>
>> The crashes happen either when the pool is released in line 224 and
>> NSData or in the setter of one of the properties, as the first stack
>> or with a crash at line 181, which is still inside this method.
>
> You haven't posted a backtrace.  I assume you cannot reproduce?

no unfortunately not, I do not get this error on any of my machines. I have a couple of other GNUMail issues, but not this one.
I hope Sebastian can post some of the traces here in the ML
 
>> I Don't see at a glance a gross error in CWImapCacheManager -
>
> Hmm, this is perhaps the buggiest part of the library, or at least the
> most fragile.  I remember ~15 years ago Ludo was advising users to
> just delete the cache if something goes wrong.

Yes, it is delicate and very low-level code
 
> A shot in the dark, but maybe there are some type mismatches or broken
> pointer arithmetic (or both) here or in the io.c function definitions.
> I would suggest uncommenting these NSLog statements (or converting
> them permanently to the appropriate NSDebug*Log) to see what's going
> on.  Don't forget to adjust the specifiers for the expected types.

In the past two days I worked with Fred on code cleanup. I found some dubious casts and endianness swaps, but the new code is generally equivalent to the old code, just better readable. My hope is that it at least helps finding the bug better, it does no harm at my place and is even faster :)

> If the crashes occur on a 64-bit machine, it would probably help to
> verify if they are reproducible on 32-bit.

I forgot to ask that Sebastian. However since I cannot reproduce the issue myself, it is inconvenient. I do access my own mail account both from 32bit and 64bit systems and it works.
However, it may be a specific mail message that causes issue (I have been working the past two months on a lot of internal parsing improvements, there is a lot of tricky code when parsing message headers like Sender and Subject). I literally went into my rich "trash" folder and "sent" folder and checked many messages to find strange parsing differences. Now GNUMail (thanks to pantomime) more reliably displays information from most standard mailers including nicknames, quotes, foreign characters as well as Cyrillic and Chinese names (this time Spam messages proved useful!!!)
Furthermore each mail server has its own specialities. All these fixes I attempted are the reason why I asked Sebastian for a test!

Riccardo


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Sebastian Reitenbach-2
Hi,

so just updated pantomime and gnumail to latest svn. Otherwise have packages installed,
latest releases of all gnustep. I'm on OpenBSD amd64, 6.3, everything built with clang.

Now entering my inbox I get:

read_unsinged_int: EOF
read_unsinged_int: EOF
read_unsinged_int: EOF

Program received signal SIGBUS, Bus error.
0x00000467ec5a20f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
(gdb) bt
#0  0x00000467ec5a20f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
#1  0x00000468886624de in -[CWFolder allMessages] (self=0x4686ec9f008, _cmd=0x468889774b8 <.objc_selector_list+192>) at CWFolder.m:201
#2  0x000004688866297c in -[CWFolder count] (self=0x4686ec9f008, _cmd=0x46888979d70 <.objc_selector_list+592>) at CWFolder.m:284
#3  0x0000046888667089 in -[CWIMAPFolder prefetch] (self=0x4686ec9f008, _cmd=0x4684b12d040 <.objc_selector_list+2736>) at CWIMAPFolder.m:183
#4  0x000004684ab14bd6 in -[TaskManager folderOpenCompleted:] (self=0x4685c65b448, _cmd=0x4688897d068 <.objc_selector_list+1792>, theNotification=0x468c63921c8) at TaskManager.m:1747
#5  0x000004682d6fc81b in -[NSObject performSelector:withObject:] (self=0x4685c65b448, _cmd=0x4688897cd28 <.objc_selector_list+960>, aSelector=0x4688897d068 <.objc_selector_list+1792>, anObject=0x468c63921c8) at NSObject.m:2000
#6  0x0000046888678318 in -[CWIMAPStore(Private) _parseSELECT] (self=0x46821d91c08, _cmd=0x4688897d018 <.objc_selector_list+1712>) at CWIMAPStore.m:2897
#7  0x0000046888675f1a in -[CWIMAPStore(Private) _parseOK] (self=0x46821d91c08, _cmd=0x4688897caa8 <.objc_selector_list+320>) at CWIMAPStore.m:2575
#8  0x000004688866ad97 in -[CWIMAPStore updateRead] (self=0x46821d91c08, _cmd=0x4688899ed28 <.objc_selector_list+368>) at CWIMAPStore.m:660
#9  0x00000468886abf99 in -[CWService receivedEvent:type:extra:forMode:] (self=0x46821d91c08, _cmd=0x4682df935a8 <.objc_selector_list+32>, theData=0xa, theType=ET_RDESC, theExtra=0xa, theMode=0x4682df23f28 <.objc_str>) at CWService.m:654
#10 0x000004682d862e35 in -[GSRunLoopCtxt pollUntil:within:] (self=0x468b84f9708, _cmd=0x4682df252e8 <.objc_selector_list+1232>, milliseconds=405, contexts=0x4687fa69108) at GSRunLoopCtxt.m:600
#11 0x000004682d747867 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x46829cd0e88, _cmd=0x4682df24fe8 <.objc_selector_list+464>, mode=0x4682df23f28 <.objc_str>, limit_date=0x4689e5dd148) at NSRunLoop.m:1224
#12 0x000004682d747e34 in -[NSRunLoop runMode:beforeDate:] (self=0x46829cd0e88, _cmd=0x467d307f060 <.objc_selector_list+224>, mode=0x4682df23f28 <.objc_str>, date=0x468a8be6b68) at NSRunLoop.m:1304
#13 0x00000467d25763e7 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x46857cc6808, _cmd=0x467d713afd8 <.objc_selector_list+496>, mask=4294967295, limit=0x468a8be6b68, mode=0x4682df23f28 <.objc_str>, flag=1 '\001') at GSDisplayServer.m:1040
#14 0x00000467d6e3f4e4 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x46857cc6808, _cmd=0x467d2f18f08 <.objc_selector_list+3248>, mask=4294967295, limit=0x468a8be6b68, mode=0x4682df23f28 <.objc_str>, flag=1 '\001') at XGServerEvent.m:2575
#15 0x00000467d22fb15c in DPSGetEvent (ctxt=0x46857cc6808, mask=4294967295, limit=0x468a8be6b68, mode=0x4682df23f28 <.objc_str>) at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
#16 0x00000467d22fbf7c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x467f680b108, _cmd=0x467d2f19528 <.objc_selector_list+4816>, mask=4294967295, expiration=0x468a8be6b68, mode=0x4682df23f28 <.objc_str>, flag=1 '\001') at NSApplication.m:2178
#17 0x00000467d22fa01c in -[NSApplication run] (self=0x467f680b108, _cmd=0x467d2f04a30 <.objc_selector_list+144>) at NSApplication.m:1553
#18 0x00000467d22cd888 in NSApplicationMain (argc=1, argv=0x7f7ffffe08c8) at Functions.m:91
#19 0x00000465cda0065a in gnustep_base_user_main (argc=1, argv=0x7f7ffffe08c8, env=0x7f7ffffe08d8) at GNUMail_main.m:41
#20 0x000004682d72bd3a in main (argc=1, argv=0x7f7ffffe08c8, env=0x7f7ffffe08d8) at NSProcessInfo.m:1002
#21 0x00000465cda00456 in _start ()
(gdb) frame 1
#1  0x00000468886624de in -[CWFolder allMessages] (self=0x4686ec9f008, _cmd=0x468889774b8 <.objc_selector_list+192>) at CWFolder.m:201
201                   if ([[aMessage flags] contain: PantomimeDeleted])
(gdb) list
196                 {
197                   [_allVisibleMessages addObject: aMessage];
198                 }
199               else
200                 {
201                   if ([[aMessage flags] contain: PantomimeDeleted])
202                     {
203                       // Do nothing
204                       continue;
205                     }
(gdb) print aMessage
$1 = (struct CWMessage *) 0x467f6f8ad88
(gdb) po aMessage

Program received signal SIGBUS, Bus error.
0x00000467ec5a20f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(_NSPrintForDebugger) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb)


then on a second try I got this double free again, that I usually see:

read_unsinged_int: EOF
read_unsinged_int: EOF
read_unsinged_int: EOF
GNUMail(32653) in free(): chunk is already free 0x8cd71005e00

Program received signal SIGABRT, Aborted.
thrkill () at -:3
3       -: No such file or directory.
(gdb) bt
#0  thrkill () at -:3
#1  0x000008cd3bed0d2e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2  0x000008cd3be8f4b9 in wrterror (d=0x8cd72753b90, msg=0x8cd3c025b89 "chunk is already free %p") at /usr/src/lib/libc/stdlib/malloc.c:288
#3  0x000008cd3be92305 in find_chunknum (d=0x0, info=<optimized out>, ptr=0x0, check=-85688) at /usr/src/lib/libc/stdlib/malloc.c:1040
#4  0x000008cd3be8fa4c in ofree (argpool=<optimized out>, p=<optimized out>, clear=0, check=0, argsz=0) at /usr/src/lib/libc/stdlib/malloc.c:1356
#5  0x000008cd3be8f599 in free (ptr=0x8cd71005e00) at /usr/src/lib/libc/stdlib/malloc.c:1416
#6  0x000008ccb4b92f09 in default_free (zone=0x8ccb530cb28 <default_zone>, ptr=0x8cd71005e00) at NSZone.m:150
#7  0x000008ccb4b92d16 in NSZoneFree (zone=0x8ccb530cb28 <default_zone>, ptr=0x8cd71005e00) at NSZone.m:1792
#8  0x000008ccb49fe691 in -[NSDataMalloc dealloc] (self=0x8cd0600d208, _cmd=0x8cd1ed321a8 <.objc_selector_list>) at NSData.m:3326
#9  0x000008cd1eb1701a in release (obj=0x8cd0600d208) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:212
#10 0x000008cd1eb16e50 in emptyPool (tls=0x8cc95c196e0, stop=0x8cd35a16f30) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:115
#11 0x000008cd1eb16cd1 in objc_autoreleasePoolPop (pool=0x8cd35a16f30) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:358
#12 0x000008ccb49afde3 in -[NSAutoreleasePool emptyPool] (self=0x8cce9c10ec8, _cmd=0x8ccb52742d0 <.objc_selector_list+48>) at NSAutoreleasePool.m:245
#13 0x000008ccb49aff8c in -[NSAutoreleasePool dealloc] (self=0x8cce9c10ec8, _cmd=0x8ccb52742f0 <.objc_selector_list+80>) at NSAutoreleasePool.m:571
#14 0x000008ccb49afeea in -[NSAutoreleasePool release] (self=0x8cce9c10ec8, _cmd=0x8cce5eb2aa8 <.objc_selector_list+144>) at NSAutoreleasePool.m:558
#15 0x000008cce5b9f7f3 in -[CWIMAPCacheManager readMessagesInRange:] (self=0x8cce6942288, _cmd=0x8cce5eb2b28 <.objc_selector_list+272>, theRange=...) at CWIMAPCacheManager.m:220
#16 0x000008cce5b9f1b3 in -[CWIMAPCacheManager readAllMessages] (self=0x8cce6942288, _cmd=0x8cd0df2dc50 <.objc_selector_list+656>) at CWIMAPCacheManager.m:134
#17 0x000008cd0d945aa1 in -[MailboxManagerController(Private) _openIMAPFolderWithName:store:sender:] (self=0x8cce3f5d408, _cmd=0x8cd0df2de60 <.objc_selector_list+1184>, theFolderName=0x933a14fb0000002c, theStore=0x8cd29263b08, theSender=0x8cd38a32808) at MailboxManagerController.m:3116
#18 0x000008cd0d93b117 in -[MailboxManagerController open:] (self=0x8cce3f5d408, _cmd=0x8cd0df2e4d0 <.objc_selector_list+2832>, sender=0x8cd38a32808) at MailboxManagerController.m:1158
#19 0x000008cd0d936ec8 in -[MailboxManagerController outlineViewSelectionDidChange:] (self=0x8cce3f5d408, _cmd=0x8cd3090ee50 <.objc_selector_list+2944>, theNotification=0x8cd4099bfc8) at MailboxManagerController.m:565
#20 0x000008ccb4aaa81b in -[NSObject performSelector:withObject:] (self=0x8cce3f5d408, _cmd=0x8ccb52b3a40 <.objc_selector_list+448>, aSelector=0x8cd3090ee50 <.objc_selector_list+2944>, anObject=0x8cd4099bfc8) at NSObject.m:2000
#21 0x000008ccb4a95335 in -[NSNotificationCenter _postAndRelease:] (self=0x8ccadc39d88, _cmd=0x8ccb52b38f0 <.objc_selector_list+112>, notification=0x8cd4099bfc8) at NSNotificationCenter.m:1198
#22 0x000008ccb4a95af4 in -[NSNotificationCenter postNotificationName:object:userInfo:] (self=0x8ccadc39d88, _cmd=0x8ccb52b39e0 <.objc_selector_list+352>, name=0x8cd309d21e0 <.objc_str.343>, object=0x8cd38a32808, info=0x0) at NSNotificationCenter.m:1258
#23 0x000008ccb4a959c7 in -[NSNotificationCenter postNotificationName:object:] (self=0x8ccadc39d88, _cmd=0x8cd3090e430 <.objc_selector_list+352>, name=0x8cd309d21e0 <.objc_str.343>, object=0x8cd38a32808) at NSNotificationCenter.m:1238
#24 0x000008cd2fd7e43d in -[NSOutlineView(NotificationRequestMethods) _postSelectionDidChangeNotification] (self=0x8cd38a32808, _cmd=0x8cd30977500 <.objc_selector_list+3872>) at NSOutlineView.m:1742
#25 0x000008cd2fe0a282 in -[NSTableView mouseDown:] (self=0x8cd38a32808, _cmd=0x8cd3090ed60 <.objc_selector_list+2704>, theEvent=0x8cd728c0908) at NSTableView.m:3943
#26 0x000008cd2fd7a463 in -[NSOutlineView mouseDown:] (self=0x8cd38a32808, _cmd=0x8cd309b3180 <.objc_selector_list+2576>, theEvent=0x8cd728c0908) at NSOutlineView.m:871
#27 0x000008cd2fe99596 in -[NSWindow sendEvent:] (self=0x8cd86c07c08, _cmd=0x8cd308593c8 <.objc_selector_list+368>, theEvent=0x8cd728c0908) at NSWindow.m:3929
#28 0x000008cd2fc3cd4d in -[NSApplication sendEvent:] (self=0x8cd3d183608, _cmd=0x8cd308593c8 <.objc_selector_list+368>, theEvent=0x8cd728c0908) at NSApplication.m:2124
#29 0x000008cd2fc3b06d in -[NSApplication run] (self=0x8cd3d183608, _cmd=0x8cd30845a30 <.objc_selector_list+144>) at NSApplication.m:1562
#30 0x000008cd2fc0e888 in NSApplicationMain (argc=1, argv=0x7f7ffffed338) at Functions.m:91
#31 0x000008ca8c80065a in gnustep_base_user_main (argc=1, argv=0x7f7ffffed338, env=0x7f7ffffed348) at GNUMail_main.m:41
#32 0x000008ccb4ad9d3a in main (argc=1, argv=0x7f7ffffed338, env=0x7f7ffffed348) at NSProcessInfo.m:1002
#33 0x000008ca8c800456 in _start ()

sebastian

 
Am Samstag, März 17, 2018 23:45 CET, Riccardo Mottola <[hidden email]> schrieb:
 

> Hi Yavor,
>
> On 2018-03-16 21:49:13 +0100 Yavor Doganov <[hidden email]> wrote:
>
> > В Fri, 16 Mar 2018 14:57:53 +0100, Riccardo Mottola написа:
> >
> >> The crashes happen either when the pool is released in line 224 and
> >> NSData or in the setter of one of the properties, as the first stack
> >> or with a crash at line 181, which is still inside this method.
> >
> > You haven't posted a backtrace.  I assume you cannot reproduce?
>
> no unfortunately not, I do not get this error on any of my machines. I have a couple of other GNUMail issues, but not this one.
> I hope Sebastian can post some of the traces here in the ML
>  
> >> I Don't see at a glance a gross error in CWImapCacheManager -
> >
> > Hmm, this is perhaps the buggiest part of the library, or at least the
> > most fragile.  I remember ~15 years ago Ludo was advising users to
> > just delete the cache if something goes wrong.
>
> Yes, it is delicate and very low-level code
>  
> > A shot in the dark, but maybe there are some type mismatches or broken
> > pointer arithmetic (or both) here or in the io.c function definitions.
> > I would suggest uncommenting these NSLog statements (or converting
> > them permanently to the appropriate NSDebug*Log) to see what's going
> > on.  Don't forget to adjust the specifiers for the expected types.
>
> In the past two days I worked with Fred on code cleanup. I found some dubious casts and endianness swaps, but the new code is generally equivalent to the old code, just better readable. My hope is that it at least helps finding the bug better, it does no harm at my place and is even faster :)
>
> > If the crashes occur on a 64-bit machine, it would probably help to
> > verify if they are reproducible on 32-bit.
>
> I forgot to ask that Sebastian. However since I cannot reproduce the issue myself, it is inconvenient. I do access my own mail account both from 32bit and 64bit systems and it works.
> However, it may be a specific mail message that causes issue (I have been working the past two months on a lot of internal parsing improvements, there is a lot of tricky code when parsing message headers like Sender and Subject). I literally went into my rich "trash" folder and "sent" folder and checked many messages to find strange parsing differences. Now GNUMail (thanks to pantomime) more reliably displays information from most standard mailers including nicknames, quotes, foreign characters as well as Cyrillic and Chinese names (this time Spam messages proved useful!!!)
> Furthermore each mail server has its own specialities. All these fixes I attempted are the reason why I asked Sebastian for a test!
>
> Riccardo
>
>
> _______________________________________________
> Gnustep-dev mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/gnustep-dev


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Riccardo Mottola-5
In reply to this post by Yavor Doganov-3
Hi,

Yavor Doganov wrote:
> Hmm, this is perhaps the buggiest part of the library, or at least the
> most fragile.  I remember ~15 years ago Ludo was advising users to
> just delete the cache if something goes wrong.

just for a notice: if you delete your IMAP Cache, everything will reload
the next time.
If you remove your Local cache (Mailbox) then.... you loose all your
messages. Just attempted that becuase I think I corrupted it during some
tests :)

Riccardo

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Riccardo Mottola-5
In reply to this post by Sebastian Reitenbach-2
Hi,

thanks for your efforts.
Unfortunately they give me no real clue to ehere the problem is.
I cleaned up the init methods and the Flags seem to me properly
allocated and release.
So I guess something goes wrong on the whole message or some issue
reading the cache file (maybe corrupted).

Sebastian Reitenbach wrote:

> Hi,
>
> so just updated pantomime and gnumail to latest svn. Otherwise have packages installed,
> latest releases of all gnustep. I'm on OpenBSD amd64, 6.3, everything built with clang.
>
> Now entering my inbox I get:
>
> read_unsinged_int: EOF
> read_unsinged_int: EOF
> read_unsinged_int: EOF

This, which you get at the second attempt to, is not something good. It
means that reading certain values from the file, 0 bytes gets read,
which is interpreted as EOF according to the manpages.

It would be good to know if it is always the same message or not.
I enhanced the read APIs to return an error result and write the value
in a variable passed by-reference.
Perhaps this can  help us narrowing down the issue.

Although GNUMail is not perfect, I can use IMAP on several different
setups: Mac, GNUstep, 32bit and 64bit. So it is not "so bad".
I remember having a computer where sometimes the Cachefiles become
immense (months ago, maybe that issue was fixed and y ou have old cache
files, I don't know)

First, I would ask you to update and retry.
If we are lucky, we will get more Debug output, e.g. a message number
out of the expected ones present in the Folder.
If that happens, please try again and see if it is always the same
message. Maybe it has issues or it is corrupted.

Also, let's do a sanity check: cache files contain only headers, so they
should be fairly small.
you will find them in GNUstep/LIbrary/GNUMail
IMAPCache_*

to give a ballpark: my Trash has 9900 messages and has a 3.7M file big
and other folders are proportinal to them
Please check your sizes and tell us the message count (e.g. by using
another Mail Agent). Due to the size being encoded in a 32bit er may
have either a 4GB or 2GB because sometimes a signed representation is
used. This should give us space for about 500.000 messages per folder.

If you think they are corrupt, do not remove them yet (they will
regenerate) I still hope the code can be cleaned to fail more gracefully
or at least return a more significant message than EOF!

Thank you,
Riccardo

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange issue with Mutable Dictionary

Sebastian Reitenbach-2
Hi,
 
Am Donnerstag, März 22, 2018 15:08 CET, Riccardo Mottola <[hidden email]> schrieb:
 

> Hi,
>
> thanks for your efforts.
> Unfortunately they give me no real clue to ehere the problem is.
> I cleaned up the init methods and the Flags seem to me properly
> allocated and release.
> So I guess something goes wrong on the whole message or some issue
> reading the cache file (maybe corrupted).
>
> Sebastian Reitenbach wrote:
> > Hi,
> >
> > so just updated pantomime and gnumail to latest svn. Otherwise have packages installed,
> > latest releases of all gnustep. I'm on OpenBSD amd64, 6.3, everything built with clang.
> >
> > Now entering my inbox I get:
> >
> > read_unsinged_int: EOF
> > read_unsinged_int: EOF
> > read_unsinged_int: EOF

I updated gnumail and pantomine to latest svn:
above messages seem to be gone for now, did you removed these messages?

so, entering my inbox still crashes GNUMail, first try:

2018-03-25 09:26:07.669 GNUMail[85799:18748151160712] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView
2018-03-25 09:26:07.672 GNUMail[85799:18748151160712] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView

Program received signal SIGBUS, Bus error.
0x0000110cdab480f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
(gdb) bt
#0  0x0000110cdab480f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
#1  0x0000110d4fab685a in -[CWMessage receivedDate] (self=0x110d23f4c388, _cmd=0x110d4fdbaf50 <.objc_selector_list+1184>) at CWMessage.m:371
#2  0x0000110d4fabb780 in -[CWMessage(Comparing) compareAccordingToDate:] (self=0x110d23f4c388, _cmd=0x110ceb7d1110 <.objc_selector_list+4288>,
    aMessage=0x110cc33dcf08) at CWMessage.m:1553
#3  0x0000110cd9bade8b in compare (elem1=0x110d23f4c388, elem2=0x110cc33dcf08, context=0x110ceb7d1110 <.objc_selector_list+4288>) at NSArray.m:1066
#4  0x0000110cd9b93d05 in GSCompareUsingDescriptorOrComparator (first=0x110d23f4c388, second=0x110cc33dcf08, descOrComp=0x110cd9baddb0 <compare>, cmprType=2,
    context=0x110ceb7d1110 <.objc_selector_list+4288>) at ././GSSorting.h:154
#5  0x0000110cd9b95998 in internalBinarySort (buffer=0x110cf336e000, r=..., start=12640, compOrDesc=0x110cd9baddb0 <compare>, type=2,
    context=0x110ceb7d1110 <.objc_selector_list+4288>) at GSTimSort.m:345
#6  0x0000110cd9b9262a in _GSTimSort (objects=0x110cf336e000, sortRange=..., sortDescriptorOrComparator=0x110cd9baddb0 <compare>, comparisonType=2,
    context=0x110ceb7d1110 <.objc_selector_list+4288>) at GSTimSort.m:1152
#7  0x0000110cd9d1e708 in GSSortUnstable (buffer=0x110cf336e000, range=..., descriptorOrComparator=0x110cd9baddb0 <compare>, type=2,
    context=0x110ceb7d1110 <.objc_selector_list+4288>) at NSSortDescriptor.m:308
#8  0x0000110cd9b34d1c in -[GSMutableArray sortUsingFunction:context:] (self=0x110cb2121e08, _cmd=0x110cda47b918 <.objc_selector_list+1072>,
    compare=0x110cd9baddb0 <compare>, context=0x110ceb7d1110 <.objc_selector_list+4288>) at GSArray.m:854
#9  0x0000110cd9badfb6 in -[NSArray sortedArrayUsingFunction:context:hint:] (self=0x110d69d656c8, _cmd=0x110cda47b658 <.objc_selector_list+368>,
    comparator=0x110cd9baddb0 <compare>, context=0x110ceb7d1110 <.objc_selector_list+4288>, hint=0x0) at NSArray.m:1114
#10 0x0000110cd9badee7 in -[NSArray sortedArrayUsingFunction:context:] (self=0x110d69d656c8, _cmd=0x110cda47b678 <.objc_selector_list+400>,
    comparator=0x110cd9baddb0 <compare>, context=0x110ceb7d1110 <.objc_selector_list+4288>) at NSArray.m:1087
#11 0x0000110cd9badda6 in -[NSArray sortedArrayUsingSelector:] (self=0x110d69d656c8, _cmd=0x110ceb7d1090 <.objc_selector_list+4160>,
    comparator=0x110ceb7d1110 <.objc_selector_list+4288>) at NSArray.m:1075
#12 0x0000110ceb1e073e in -[MailWindowController tableViewShouldReloadData] (self=0x110d06054c08, _cmd=0x110ceb7d1180 <.objc_selector_list+4400>)
    at MailWindowController.m:1454
#13 0x0000110ceb1e81d4 in -[MailWindowController updateDataView] (self=0x110d06054c08, _cmd=0x110ceb828a90 <.objc_selector_list+1216>)
    at MailWindowController.m:2627
#14 0x0000110ceb20e09e in -[TaskManager folderPrefetchCompleted:] (self=0x110d395fe248, _cmd=0x110d4fda2be8 <.objc_selector_list+528>,
    theNotification=0x110cb4214c48) at TaskManager.m:1190
#15 0x0000110cd9cb481b in -[NSObject performSelector:withObject:] (self=0x110d395fe248, _cmd=0x110d4fda29d8 <.objc_selector_list>,
    aSelector=0x110d4fda2be8 <.objc_selector_list+528>, anObject=0x110cb4214c48) at NSObject.m:2000
#16 0x0000110d4fa9b512 in -[CWIMAPStore(Private) _parseOK] (self=0x110d693cff08, _cmd=0x110d4fda2a98 <.objc_selector_list+192>) at CWIMAPStore.m:2605
#17 0x0000110d4fa8fcd9 in -[CWIMAPStore updateRead] (self=0x110d693cff08, _cmd=0x110d4fdc4dc8 <.objc_selector_list+160>) at CWIMAPStore.m:660
#18 0x0000110d4fad0cb9 in -[CWService receivedEvent:type:extra:forMode:] (self=0x110d693cff08, _cmd=0x110cda54b5a8 <.objc_selector_list+32>, theData=0xa,
    theType=ET_RDESC, theExtra=0xa, theMode=0x110cda4dbf28 <.objc_str>) at CWService.m:650
#19 0x0000110cd9e1ae35 in -[GSRunLoopCtxt pollUntil:within:] (self=0x110d38dd5708, _cmd=0x110cda4dd2e8 <.objc_selector_list+1232>, milliseconds=565,
    contexts=0x110d66214608) at GSRunLoopCtxt.m:600
#20 0x0000110cd9cff867 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x110d23f1fa48, _cmd=0x110cda4dcfe8 <.objc_selector_list+464>,
    mode=0x110cda4dbf28 <.objc_str>, limit_date=0x110d9d94f448) at NSRunLoop.m:1224
#21 0x0000110cd9cffe34 in -[NSRunLoop runMode:beforeDate:] (self=0x110d23f1fa48, _cmd=0x110d15056060 <.objc_selector_list+224>, mode=0x110cda4dbf28 <.objc_str>,
    date=0x110d472f3a68) at NSRunLoop.m:1304
#22 0x0000110d1454d3e7 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x110d51596c08,
    _cmd=0x110d8ee6efd8 <.objc_selector_list+496>, mask=4294967295, limit=0x110d472f3a68, mode=0x110cda4dbf28 <.objc_str>, flag=1 '\001')
    at GSDisplayServer.m:1040
#23 0x0000110d8eb734e4 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x110d51596c08,
    _cmd=0x110d14eeff08 <.objc_selector_list+3248>, mask=4294967295, limit=0x110d472f3a68, mode=0x110cda4dbf28 <.objc_str>, flag=1 '\001') at XGServerEvent.m:2575
#24 0x0000110d142d215c in DPSGetEvent (ctxt=0x110d51596c08, mask=4294967295, limit=0x110d472f3a68, mode=0x110cda4dbf28 <.objc_str>)
    at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
#25 0x0000110d142d2f7c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x110cfda55b08, _cmd=0x110d14ef0528 <.objc_selector_list+4816>,
    mask=4294967295, expiration=0x110d472f3a68, mode=0x110cda4dbf28 <.objc_str>, flag=1 '\001') at NSApplication.m:2178
---Type <return> to continue, or q <return> to quit---
#26 0x0000110d142d101c in -[NSApplication run] (self=0x110cfda55b08, _cmd=0x110d14edba30 <.objc_selector_list+144>) at NSApplication.m:1553
#27 0x0000110d142a4888 in NSApplicationMain (argc=1, argv=0x7f7ffffd3b08) at Functions.m:91
#28 0x0000110aa920065a in gnustep_base_user_main (argc=1, argv=0x7f7ffffd3b08, env=0x7f7ffffd3b18) at GNUMail_main.m:41
#29 0x0000110cd9ce3d3a in main (argc=1, argv=0x7f7ffffd3b08, env=0x7f7ffffd3b18) at NSProcessInfo.m:1002
#30 0x0000110aa9200456 in _start ()
(gdb) frame 1
#1  0x0000110d4fab685a in -[CWMessage receivedDate] (self=0x110d23f4c388, _cmd=0x110d4fdbaf50 <.objc_selector_list+1184>) at CWMessage.m:371
371       return [_headers objectForKey: @"Date"];
(gdb) po _headers
CWIMAPMessage
(gdb) print _headers
$1 = (struct NSMutableDictionary *) 0x110d4fda08f0 <_OBJC_CLASS_CWIMAPMessage>


a second try got me a different backtrace:

2018-03-25 09:28:15.766 GNUMail[64105:4053200990216] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView
2018-03-25 09:28:15.769 GNUMail[64105:4053200990216] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView

Program received signal SIGBUS, Bus error.
0x000003afcab2e0f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
(gdb) bt
#0  0x000003afcab2e0f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
#1  0x000003af576ee50d in -[CWFolder allMessages] (self=0x3af81b84708, _cmd=0x3af57a045b8 <.objc_selector_list+448>) at CWFolder.m:201
#2  0x000003af576ee9bc in -[CWFolder count] (self=0x3af81b84708, _cmd=0x3af57a06c80 <.objc_selector_list+240>) at CWFolder.m:284
#3  0x000003af576f2f69 in -[CWIMAPFolder prefetch] (self=0x3af81b84708, _cmd=0x3af1cafca50 <.objc_selector_list+1152>) at CWIMAPFolder.m:183
#4  0x000003af1c4e4da6 in -[TaskManager folderOpenCompleted:] (self=0x3af75f7fa88, _cmd=0x3af57a09d48 <.objc_selector_list+880>, theNotification=0x3af2a5806c8) at TaskManager.m:1747
#5  0x000003af7c92081b in -[NSObject performSelector:withObject:] (self=0x3af75f7fa88, _cmd=0x3af57a099d8 <.objc_selector_list>, aSelector=0x3af57a09d48 <.objc_selector_list+880>,
    anObject=0x3af2a5806c8) at NSObject.m:2000
#6  0x000003af57704141 in -[CWIMAPStore(Private) _parseSELECT] (self=0x3af96a8c208, _cmd=0x3af57a0a278 <.objc_selector_list+2208>) at CWIMAPStore.m:2897
#7  0x000003af57701d79 in -[CWIMAPStore(Private) _parseOK] (self=0x3af96a8c208, _cmd=0x3af57a09a98 <.objc_selector_list+192>) at CWIMAPStore.m:2575
#8  0x000003af576f6cd9 in -[CWIMAPStore updateRead] (self=0x3af96a8c208, _cmd=0x3af57a2bdc8 <.objc_selector_list+160>) at CWIMAPStore.m:660
#9  0x000003af57737cb9 in -[CWService receivedEvent:type:extra:forMode:] (self=0x3af96a8c208, _cmd=0x3af7d1b75a8 <.objc_selector_list+32>, theData=0xa, theType=ET_RDESC, theExtra=0xa,
    theMode=0x3af7d147f28 <.objc_str>) at CWService.m:650
#10 0x000003af7ca86e35 in -[GSRunLoopCtxt pollUntil:within:] (self=0x3afd25d9608, _cmd=0x3af7d1492e8 <.objc_selector_list+1232>, milliseconds=401, contexts=0x3afa67445c8) at GSRunLoopCtxt.m:600
#11 0x000003af7c96b867 in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x3af0946c208, _cmd=0x3af7d148fe8 <.objc_selector_list+464>, mode=0x3af7d147f28 <.objc_str>, limit_date=0x3aef5cbeb28)
    at NSRunLoop.m:1224
#12 0x000003af7c96be34 in -[NSRunLoop runMode:beforeDate:] (self=0x3af0946c208, _cmd=0x3af54731060 <.objc_selector_list+224>, mode=0x3af7d147f28 <.objc_str>, date=0x3af0946a428) at NSRunLoop.m:1304
#13 0x000003af53c283e7 in -[GSDisplayServer(EventOps) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x3afc8deb408, _cmd=0x3af14721fd8 <.objc_selector_list+496>, mask=4294967295,
    limit=0x3af0946a428, mode=0x3af7d147f28 <.objc_str>, flag=1 '\001') at GSDisplayServer.m:1040
#14 0x000003af144264e4 in -[XGServer(X11Ops) getEventMatchingMask:beforeDate:inMode:dequeue:] (self=0x3afc8deb408, _cmd=0x3af545caf08 <.objc_selector_list+3248>, mask=4294967295,
    limit=0x3af0946a428, mode=0x3af7d147f28 <.objc_str>, flag=1 '\001') at XGServerEvent.m:2575
#15 0x000003af539ad15c in DPSGetEvent (ctxt=0x3afc8deb408, mask=4294967295, limit=0x3af0946a428, mode=0x3af7d147f28 <.objc_str>) at ../Headers/Additions/GNUstepGUI/GSDisplayServer.h:200
#16 0x000003af539adf7c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x3af6023aa08, _cmd=0x3af545cb528 <.objc_selector_list+4816>, mask=4294967295,
    expiration=0x3af0946a428, mode=0x3af7d147f28 <.objc_str>, flag=1 '\001') at NSApplication.m:2178
#17 0x000003af539ac01c in -[NSApplication run] (self=0x3af6023aa08, _cmd=0x3af545b6a30 <.objc_selector_list+144>) at NSApplication.m:1553
#18 0x000003af5397f888 in NSApplicationMain (argc=1, argv=0x7f7ffffd6858) at Functions.m:91
#19 0x000003acdda0065a in gnustep_base_user_main (argc=1, argv=0x7f7ffffd6858, env=0x7f7ffffd6868) at GNUMail_main.m:41
#20 0x000003af7c94fd3a in main (argc=1, argv=0x7f7ffffd6858, env=0x7f7ffffd6868) at NSProcessInfo.m:1002
#21 0x000003acdda00456 in _start ()
(gdb) frame 1
#1  0x000003af576ee50d in -[CWFolder allMessages] (self=0x3af81b84708, _cmd=0x3af57a045b8 <.objc_selector_list+448>) at CWFolder.m:201
201                   if ([[aMessage flags] contain: PantomimeDeleted])
(gdb) print aMessage
$1 = (struct CWMessage *) 0x3af1254e408
(gdb) po aMessage

Program received signal SIGBUS, Bus error.
0x000003afcab2e0f4 in objc_msgSend_fpret () from /usr/local/lib/libobjc2.so.1.1
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(_NSPrintForDebugger) will be abandoned.
When the function is done executing, GDB will silently stop.


on a third try, I got the same as the second one, but a fourth try I got:

2018-03-25 09:33:40.247 GNUMail[37137:20562122298248] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView
2018-03-25 09:33:40.247 GNUMail[37137:20562122298248] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView
2018-03-25 09:33:40.249 GNUMail[37137:20562122298248] Method setIndicatorImage:inTableColumn: is not implemented for class NSTableView
GNUMail(37137) in free(): chunk is already free 0x12b415979c80

Program received signal SIGABRT, Aborted.
thrkill () at -:3
3       -: No such file or directory.
(gdb) bt
#0  thrkill () at -:3
#1  0x000012b31e70c36e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2  0x000012b31e715099 in wrterror (d=0x12b3cd9fa670, msg=0x12b31e86d2ab "chunk is already free %p") at /usr/src/lib/libc/stdlib/malloc.c:288
#3  0x000012b31e717ee5 in find_chunknum (d=0x0, info=<optimized out>, ptr=0x0, check=-136088) at /usr/src/lib/libc/stdlib/malloc.c:1040
#4  0x000012b31e71562c in ofree (argpool=<optimized out>, p=<optimized out>, clear=0, check=0, argsz=0) at /usr/src/lib/libc/stdlib/malloc.c:1356
#5  0x000012b31e715179 in free (ptr=0x12b415979c80) at /usr/src/lib/libc/stdlib/malloc.c:1416
#6  0x000012b349948f09 in default_free (zone=0x12b34a0c2b28 <default_zone>, ptr=0x12b415979c80) at NSZone.m:150
#7  0x000012b349948d16 in NSZoneFree (zone=0x12b34a0c2b28 <default_zone>, ptr=0x12b415979c80) at NSZone.m:1792
#8  0x000012b3497b4691 in -[NSDataMalloc dealloc] (self=0x12b412bc0dc8, _cmd=0x12b3e17721a8 <.objc_selector_list>) at NSData.m:3326
#9  0x000012b3e155701a in release (obj=0x12b412bc0dc8) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:212
#10 0x000012b3e1556e50 in emptyPool (tls=0x12b36a787a20, stop=0x12b3e3d042a8) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:115
#11 0x000012b3e1556cd1 in objc_autoreleasePoolPop (pool=0x12b3e3d042a8) at /home/ports/pobj/amd64/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/arc.m:358
#12 0x000012b349765de3 in -[NSAutoreleasePool emptyPool] (self=0x12b37d7bc088, _cmd=0x12b34a02a2d0 <.objc_selector_list+48>) at NSAutoreleasePool.m:245
#13 0x000012b349765f8c in -[NSAutoreleasePool dealloc] (self=0x12b37d7bc088, _cmd=0x12b34a02a2f0 <.objc_selector_list+80>) at NSAutoreleasePool.m:571
#14 0x000012b349765eea in -[NSAutoreleasePool release] (self=0x12b37d7bc088, _cmd=0x12b349363af8 <.objc_selector_list+96>) at NSAutoreleasePool.m:558
#15 0x000012b34904f87e in -[CWIMAPCacheManager readMessagesInRange:] (self=0x12b3619ecd08, _cmd=0x12b349363ab8 <.objc_selector_list+32>, theRange=...) at CWIMAPCacheManager.m:237
#16 0x000012b34904f200 in -[CWIMAPCacheManager readAllMessages] (self=0x12b3619ecd08, _cmd=0x12b35d726c50 <.objc_selector_list+4752>) at CWIMAPCacheManager.m:142
#17 0x000012b35d13db68 in -[MailboxManagerController(Private) _openIMAPFolderWithName:store:sender:] (self=0x12b325358408, _cmd=0x12b35d726930 <.objc_selector_list+3952>,
    theFolderName=0x933a14fb0000002c, theStore=0x12b416414e08, theSender=0x12b39a348408) at MailboxManagerController.m:3116
#18 0x000012b35d133237 in -[MailboxManagerController open:] (self=0x12b325358408, _cmd=0x12b35d725ca0 <.objc_selector_list+736>, sender=0x12b39a348408) at MailboxManagerController.m:1158
#19 0x000012b35d12efd8 in -[MailboxManagerController outlineViewSelectionDidChange:] (self=0x12b325358408, _cmd=0x12b35cf3ce50 <.objc_selector_list+2944>, theNotification=0x12b35df3ad88)
    at MailboxManagerController.m:565
#20 0x000012b34986081b in -[NSObject performSelector:withObject:] (self=0x12b325358408, _cmd=0x12b34a069a40 <.objc_selector_list+448>, aSelector=0x12b35cf3ce50 <.objc_selector_list+2944>,
    anObject=0x12b35df3ad88) at NSObject.m:2000
#21 0x000012b34984b335 in -[NSNotificationCenter _postAndRelease:] (self=0x12b33864cf68, _cmd=0x12b34a0698f0 <.objc_selector_list+112>, notification=0x12b35df3ad88) at NSNotificationCenter.m:1198
#22 0x000012b34984baf4 in -[NSNotificationCenter postNotificationName:object:userInfo:] (self=0x12b33864cf68, _cmd=0x12b34a0699e0 <.objc_selector_list+352>, name=0x12b35d0001e0 <.objc_str.343>,
    object=0x12b39a348408, info=0x0) at NSNotificationCenter.m:1258
#23 0x000012b34984b9c7 in -[NSNotificationCenter postNotificationName:object:] (self=0x12b33864cf68, _cmd=0x12b35cf3c430 <.objc_selector_list+352>, name=0x12b35d0001e0 <.objc_str.343>,
    object=0x12b39a348408) at NSNotificationCenter.m:1238
#24 0x000012b35c3ac43d in -[NSOutlineView(NotificationRequestMethods) _postSelectionDidChangeNotification] (self=0x12b39a348408, _cmd=0x12b35cfa5500 <.objc_selector_list+3872>)
    at NSOutlineView.m:1742
#25 0x000012b35c438282 in -[NSTableView mouseDown:] (self=0x12b39a348408, _cmd=0x12b35cf3cd60 <.objc_selector_list+2704>, theEvent=0x12b370643008) at NSTableView.m:3943
#26 0x000012b35c3a8463 in -[NSOutlineView mouseDown:] (self=0x12b39a348408, _cmd=0x12b35cfe1180 <.objc_selector_list+2576>, theEvent=0x12b370643008) at NSOutlineView.m:871
#27 0x000012b35c4c7596 in -[NSWindow sendEvent:] (self=0x12b3f7fae808, _cmd=0x12b35ce873c8 <.objc_selector_list+368>, theEvent=0x12b370643008) at NSWindow.m:3929
#28 0x000012b35c26ad4d in -[NSApplication sendEvent:] (self=0x12b36edb0c08, _cmd=0x12b35ce873c8 <.objc_selector_list+368>, theEvent=0x12b370643008) at NSApplication.m:2124
#29 0x000012b35c26906d in -[NSApplication run] (self=0x12b36edb0c08, _cmd=0x12b35ce73a30 <.objc_selector_list+144>) at NSApplication.m:1562
#30 0x000012b35c23c888 in NSApplicationMain (argc=1, argv=0x7f7ffffe0e58) at Functions.m:91
#31 0x000012b11af0065a in gnustep_base_user_main (argc=1, argv=0x7f7ffffe0e58, env=0x7f7ffffe0e68) at GNUMail_main.m:41
#32 0x000012b34988fd3a in main (argc=1, argv=0x7f7ffffe0e58, env=0x7f7ffffe0e68) at NSProcessInfo.m:1002
#33 0x000012b11af00456 in _start ()

My INBOX cache file is about 3.9 MB.

Note: I'll be on vacation starting tomorrow, will be back on Easter Monday.

cheers,
Sebastian

>
> This, which you get at the second attempt to, is not something good. It
> means that reading certain values from the file, 0 bytes gets read,
> which is interpreted as EOF according to the manpages.
>
> It would be good to know if it is always the same message or not.
> I enhanced the read APIs to return an error result and write the value
> in a variable passed by-reference.
> Perhaps this can  help us narrowing down the issue.
>
> Although GNUMail is not perfect, I can use IMAP on several different
> setups: Mac, GNUstep, 32bit and 64bit. So it is not "so bad".
> I remember having a computer where sometimes the Cachefiles become
> immense (months ago, maybe that issue was fixed and y ou have old cache
> files, I don't know)
>
> First, I would ask you to update and retry.
> If we are lucky, we will get more Debug output, e.g. a message number
> out of the expected ones present in the Folder.
> If that happens, please try again and see if it is always the same
> message. Maybe it has issues or it is corrupted.
>
> Also, let's do a sanity check: cache files contain only headers, so they
> should be fairly small.
> you will find them in GNUstep/LIbrary/GNUMail
> IMAPCache_*
>
> to give a ballpark: my Trash has 9900 messages and has a 3.7M file big
> and other folders are proportinal to them
> Please check your sizes and tell us the message count (e.g. by using
> another Mail Agent). Due to the size being encoded in a 32bit er may
> have either a 4GB or 2GB because sometimes a signed representation is
> used. This should give us space for about 500.000 messages per folder.
>
> If you think they are corrupt, do not remove them yet (they will
> regenerate) I still hope the code can be cleaned to fail more gracefully
> or at least return a more significant message than EOF!
>
> Thank you,
> Riccardo


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev