ENGINE-505 testNullInnerMimeType
authorDirk Zimmermann <dz@pep.security>
Mon, 07 Jan 2019 11:27:55 +0100
changeset 74355676db751f0f
parent 7434 1f367c99fbbd
child 7436 64582a8b0f9a
ENGINE-505 testNullInnerMimeType
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOSTests/DecryptImportedMessagesTests.swift
pEpForiOSTests/Resources/ENGINE-505_Mail_NullInnerMimeType.txt
     1.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Mon Jan 07 08:41:36 2019 +0100
     1.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Mon Jan 07 11:27:55 2019 +0100
     1.3 @@ -314,6 +314,7 @@
     1.4  		4337E52A21B68FCA00826CAB /* Thread+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4337E52921B68FCA00826CAB /* Thread+Extension.swift */; };
     1.5  		433BCD951D5388C100DD98EF /* ReplyUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 433BCD941D5388C100DD98EF /* ReplyUtil.swift */; };
     1.6  		433C51D31E66CCA900272E19 /* CreateRequiredFoldersOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 433C51D11E66CB9C00272E19 /* CreateRequiredFoldersOperation.swift */; };
     1.7 +		433F2E2A21E3581800E1CA49 /* ENGINE-505_Mail_NullInnerMimeType.txt in Resources */ = {isa = PBXBuildFile; fileRef = 433F2E2921E3581800E1CA49 /* ENGINE-505_Mail_NullInnerMimeType.txt */; };
     1.8  		4341980520AB037E0062F7F6 /* CGImageSource+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4341980420AB037E0062F7F6 /* CGImageSource+Extension.swift */; };
     1.9  		4341EBCF2089F674004CE6B8 /* QualifyServerIsLocalOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4341EBCE2089F674004CE6B8 /* QualifyServerIsLocalOperation.swift */; };
    1.10  		4341EBD1208A0961004CE6B8 /* QualifyServerIsLocalServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4341EBD0208A0961004CE6B8 /* QualifyServerIsLocalServiceProtocol.swift */; };
    1.11 @@ -934,6 +935,7 @@
    1.12  		4337E52921B68FCA00826CAB /* Thread+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Thread+Extension.swift"; sourceTree = "<group>"; };
    1.13  		433BCD941D5388C100DD98EF /* ReplyUtil.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReplyUtil.swift; sourceTree = "<group>"; };
    1.14  		433C51D11E66CB9C00272E19 /* CreateRequiredFoldersOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateRequiredFoldersOperation.swift; sourceTree = "<group>"; };
    1.15 +		433F2E2921E3581800E1CA49 /* ENGINE-505_Mail_NullInnerMimeType.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ENGINE-505_Mail_NullInnerMimeType.txt"; sourceTree = "<group>"; };
    1.16  		4341980420AB037E0062F7F6 /* CGImageSource+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGImageSource+Extension.swift"; sourceTree = "<group>"; };
    1.17  		4341EBCE2089F674004CE6B8 /* QualifyServerIsLocalOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QualifyServerIsLocalOperation.swift; sourceTree = "<group>"; };
    1.18  		4341EBD0208A0961004CE6B8 /* QualifyServerIsLocalServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QualifyServerIsLocalServiceProtocol.swift; sourceTree = "<group>"; };
    1.19 @@ -2502,6 +2504,7 @@
    1.20  				438F4EE8215FB99400168B5E /* Leon Kowalski (19B9EE3B) – Private.asc */,
    1.21  				438F4EE4215FAD0500168B5E /* Harry Bryant iostest002@peptest.ch (0x5716EA2D9AE32468) pub-sec.asc */,
    1.22  				438F4EE0215F9CB300168B5E /* SimplifiedKeyImport_Harry_To_Rick_with_Leon.txt */,
    1.23 +				433F2E2921E3581800E1CA49 /* ENGINE-505_Mail_NullInnerMimeType.txt */,
    1.24  			);
    1.25  			path = Resources;
    1.26  			sourceTree = "<group>";
    1.27 @@ -3166,6 +3169,7 @@
    1.28  				43C3B16720038B2500ED48A4 /* IOS-884_001_iostest002@peptest.ch.sec.key in Resources */,
    1.29  				435F7C75215E05DA00F21EFD /* 1364_Mail_missing_attached_image.txt in Resources */,
    1.30  				43B2C31B1D2280ED00A08557 /* 5A90_3590_0E48_AB85_F3DB__045E_4623_C5D1_EAB6_643E.asc in Resources */,
    1.31 +				433F2E2A21E3581800E1CA49 /* ENGINE-505_Mail_NullInnerMimeType.txt in Resources */,
    1.32  				1568FEA11FACDCC600993EA3 /* IOS-211_hi_there.txt in Resources */,
    1.33  				153CA6E81FB61B53003C9629 /* IOS-815_pep_rating_zero.txt in Resources */,
    1.34  				436795FC1EE98E9900B03E23 /* CommunicationTypeTests_test002@peptest.ch.asc in Resources */,
     2.1 --- a/pEpForiOSTests/DecryptImportedMessagesTests.swift	Mon Jan 07 08:41:36 2019 +0100
     2.2 +++ b/pEpForiOSTests/DecryptImportedMessagesTests.swift	Mon Jan 07 11:27:55 2019 +0100
     2.3 @@ -196,6 +196,41 @@
     2.4          try! session.setOwnKey(leon, fingerprint: "63FC29205A57EB3AEB780E846F239B0F19B9EE3B")
     2.5      }
     2.6  
     2.7 +    // ENGINE-505
     2.8 +    func testNullInnerMimeType() {
     2.9 +        let cdOwnAccount = DecryptionUtil.createLocalAccount(
    2.10 +            ownUserName: "ThisIsMe",
    2.11 +            ownUserID: "User_Me",
    2.12 +            ownEmailAddress: "guile-user@gnu.org")
    2.13 +
    2.14 +        self.backgroundQueue = OperationQueue()
    2.15 +        let cdMessage = DecryptionUtil.decryptTheMessage(
    2.16 +            testCase: self,
    2.17 +            backgroundQueue: backgroundQueue,
    2.18 +            cdOwnAccount: cdOwnAccount,
    2.19 +            fileName: "ENGINE-505_Mail_NullInnerMimeType.txt")
    2.20 +
    2.21 +        guard let theCdMessage = cdMessage else {
    2.22 +            XCTFail()
    2.23 +            return
    2.24 +        }
    2.25 +
    2.26 +        XCTAssertEqual(theCdMessage.pEpRating, Int16(PEP_rating_unencrypted.rawValue))
    2.27 +        XCTAssertEqual(theCdMessage.shortMessage,
    2.28 +                       "Re: Help needed debugging segfault with Guile 1.8.7")
    2.29 +        XCTAssertNil(theCdMessage.longMessage)
    2.30 +
    2.31 +        let attachments = theCdMessage.attachments?.array as? [CdAttachment] ?? []
    2.32 +        XCTAssertEqual(attachments.count, 2)
    2.33 +
    2.34 +        guard let msg = theCdMessage.message() else {
    2.35 +            XCTFail()
    2.36 +            return
    2.37 +        }
    2.38 +
    2.39 +        XCTAssertEqual(msg.attachments.count, 1)
    2.40 +    }
    2.41 +
    2.42      // MARK: - Helpers
    2.43  
    2.44      func check(attachments: [MimeProtocol]) {
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/pEpForiOSTests/Resources/ENGINE-505_Mail_NullInnerMimeType.txt	Mon Jan 07 11:27:55 2019 +0100
     3.3 @@ -0,0 +1,115 @@
     3.4 +Delivered-To: me@dirkz.com
     3.5 +Received: by 10.204.56.145 with SMTP id y17cs277633bkg;
     3.6 +Wed, 10 Nov 2010 13:35:55 -0800 (PST)
     3.7 +Received: by 10.42.240.134 with SMTP id la6mr120782icb.144.1289424944825;
     3.8 +Wed, 10 Nov 2010 13:35:44 -0800 (PST)
     3.9 +Return-Path: <guile-user-bounces+me=dirkz.com@gnu.org>
    3.10 +Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
    3.11 +by mx.google.com with ESMTP id l27si2697457qck.83.2010.11.10.13.35.44;
    3.12 +Wed, 10 Nov 2010 13:35:44 -0800 (PST)
    3.13 +Received-SPF: pass (google.com: domain of guile-user-bounces+me=dirkz.com@gnu.org designates 199.232.76.165 as permitted sender) client-ip=199.232.76.165;
    3.14 +Authentication-Results: mx.google.com; spf=pass (google.com: domain of guile-user-bounces+me=dirkz.com@gnu.org designates 199.232.76.165 as permitted sender) smtp.mail=guile-user-bounces+me=dirkz.com@gnu.org
    3.15 +Received: from localhost ([127.0.0.1]:52713 helo=lists.gnu.org)
    3.16 +by lists.gnu.org with esmtp (Exim 4.43)
    3.17 +id 1PGIKV-00064F-Rt
    3.18 +for me@dirkz.com; Wed, 10 Nov 2010 16:35:43 -0500
    3.19 +Received: from [140.186.70.92] (port=55125 helo=eggs.gnu.org)
    3.20 +by lists.gnu.org with esmtp (Exim 4.43) id 1PGIKM-000644-H3
    3.21 +for guile-user@gnu.org; Wed, 10 Nov 2010 16:35:35 -0500
    3.22 +Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
    3.23 +(envelope-from <guile-user@m.gmane.org>) id 1PGIKL-000700-BX
    3.24 +for guile-user@gnu.org; Wed, 10 Nov 2010 16:35:34 -0500
    3.25 +Received: from lo.gmane.org ([80.91.229.12]:48677)
    3.26 +by eggs.gnu.org with esmtp (Exim 4.71)
    3.27 +(envelope-from <guile-user@m.gmane.org>) id 1PGIKL-0006zj-19
    3.28 +for guile-user@gnu.org; Wed, 10 Nov 2010 16:35:33 -0500
    3.29 +Received: from list by lo.gmane.org with local (Exim 4.69)
    3.30 +(envelope-from <guile-user@m.gmane.org>) id 1PGIKJ-0003BR-84
    3.31 +for guile-user@gnu.org; Wed, 10 Nov 2010 22:35:31 +0100
    3.32 +Received: from 109.170.137.199 ([109.170.137.199])
    3.33 +by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
    3.34 +id 1AlnuQ-0007hv-00
    3.35 +for <guile-user@gnu.org>; Wed, 10 Nov 2010 22:35:31 +0100
    3.36 +Received: from peter by 109.170.137.199 with local (Gmexim 0.1 (Debian))
    3.37 +id 1AlnuQ-0007hv-00
    3.38 +for <guile-user@gnu.org>; Wed, 10 Nov 2010 22:35:31 +0100
    3.39 +X-Injected-Via-Gmane: http://gmane.org/
    3.40 +To: guile-user@gnu.org
    3.41 +From: Peter TB Brett <peter@peter-b.co.uk>
    3.42 +Date: Wed, 10 Nov 2010 21:35:52 +0000
    3.43 +Lines: 48
    3.44 +Message-ID: <m3r5esuaiv.fsf@harrington.peter-b.co.uk>
    3.45 +References: <m3wrol5oxx.fsf@harrington.peter-b.co.uk>
    3.46 +Mime-Version: 1.0
    3.47 +Content-Type: multipart/signed; boundary="=-=-=";
    3.48 +micalg=pgp-sha1; protocol="application/pgp-signature"
    3.49 +X-Complaints-To: usenet@dough.gmane.org
    3.50 +X-Gmane-NNTP-Posting-Host: 109.170.137.199
    3.51 +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
    3.52 +Cancel-Lock: sha1:UVOm/T1rWA2b95nupcrUsEldbE0=
    3.53 +X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
    3.54 +Subject: Re: Help needed debugging segfault with Guile 1.8.7
    3.55 +X-BeenThere: guile-user@gnu.org
    3.56 +X-Mailman-Version: 2.1.5
    3.57 +Precedence: list
    3.58 +List-Id: General Guile related discussions <guile-user.gnu.org>
    3.59 +List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/guile-user>,
    3.60 +<mailto:guile-user-request@gnu.org?subject=unsubscribe>
    3.61 +List-Archive: <http://lists.gnu.org/archive/html/guile-user>
    3.62 +List-Post: <mailto:guile-user@gnu.org>
    3.63 +List-Help: <mailto:guile-user-request@gnu.org?subject=help>
    3.64 +List-Subscribe: <http://lists.gnu.org/mailman/listinfo/guile-user>,
    3.65 +<mailto:guile-user-request@gnu.org?subject=subscribe>
    3.66 +Sender: guile-user-bounces+me=dirkz.com@gnu.org
    3.67 +Errors-To: guile-user-bounces+me=dirkz.com@gnu.org
    3.68 +
    3.69 +--=-=-=
    3.70 +Content-Transfer-Encoding: quoted-printable
    3.71 +
    3.72 +Peter TB Brett <peter@peter-b.co.uk> writes:
    3.73 +
    3.74 +> I've added a testsuite for the libgeda Scheme API.  In one commit [2],
    3.75 +> the testsuite succeeds.  In the following commit [3], a test which does
    3.76 +> not touch any of the changed code starts causing a segfault in the Guile
    3.77 +> interpreter.
    3.78 +>
    3.79 +> [snip]
    3.80 +>
    3.81 +> Valgrind / Memcheck wasn't very helpful either.  Is there a way to make
    3.82 +> Guile zero each new heap page it requests before using it in order to
    3.83 +> reduce the number of false positives the gc generates in Memcheck?
    3.84 +>
    3.85 +> In fact, *none* of the ways I've found of running the test without the
    3.86 +> segfault occurring have given me *any* clue as to how to fix it
    3.87 +> "properly".
    3.88 +>
    3.89 +> I'd really appreciate any suggestions that anyone might be able to give
    3.90 +> me on figuring out how I've managed to break things.  At the moment, I'm
    3.91 +> at a complete loss.
    3.92 +
    3.93 +So far, as far as I can tell the problem is due to freelist corruption
    3.94 +in the garbage collector, and I'm not sufficiently au fait with Guile
    3.95 +internals to be able to diagnose what's going on.  Is this a known
    3.96 +issue?
    3.97 +
    3.98 +Peter
    3.99 +
   3.100 +
   3.101 +=2D-=20
   3.102 +Peter Brett <peter@peter-b.co.uk>
   3.103 +Remote Sensing Research Group
   3.104 +Surrey Space Centre
   3.105 +
   3.106 +--=-=-=
   3.107 +Content-Type: application/pgp-signature
   3.108 +
   3.109 +-----BEGIN PGP SIGNATURE-----
   3.110 +Version: GnuPG v1.4.11 (GNU/Linux)
   3.111 +
   3.112 +iEYEARECAAYFAkzbEDgACgkQZ7Gbq7g7vpp2awCfc78m4qd+LfV5Esi+ISIzbN2W
   3.113 +IiMAoJnAnLluoIx003sLAkVW8TTUz7Nt
   3.114 +=ANC+
   3.115 +-----END PGP SIGNATURE-----
   3.116 +--=-=-=--
   3.117 +
   3.118 +