Description of problem: Version in rawhide segfaults as follows, on every file. When compiled from upstream, no errors. For example: Fedora/Rawhide: softhsm-2.6.1]# src/bin/dump/softhsm2-dump-file /var/lib/ipa/dnssec/tokens/35c0069a-5a74-df91-32c5-09191e997b3a/95925d7d-5e9f-c5e7-2840-1f78482a1e00.object Dump of object file "/var/lib/ipa/dnssec/tokens/35c0069a-5a74-df91-32c5-09191e997b3a/95925d7d-5e9f-c5e7-2840-1f78482a1e00.object" 00 00 00 00 00 00 00 27 generation 39 00 00 00 00 00 00 00 00 CKA_CLASS 00 00 00 00 00 00 00 02 unsigned long attribute 00 00 00 00 00 00 00 03 CKO_PRIVATE_KEY 00 00 00 00 00 00 00 01 CKA_TOKEN 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 00 02 CKA_PRIVATE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 00 03 CKA_LABEL 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 40 (length 64) d1 ef b6 b5 2f d3 61 ab <..../.a.> 7c 93 5c 14 9e 4e ee b5 <|.\..N..> d3 bf d1 73 f7 03 1a 9e <...s....> a4 0d 9d d7 29 d8 e4 6d <....)..m> 9d 10 6b 85 e6 eb c9 2d <..k....-> 80 6d 05 4e 23 f9 ab 84 <.m.N#...> de 40 8e 25 18 b4 c5 c1 <.@.%....> 56 d8 13 a4 f9 6e e6 ee <V....n..> 00 00 00 00 00 00 01 00 CKA_KEY_TYPE 00 00 00 00 00 00 00 02 unsigned long attribute 00 00 00 00 00 00 00 00 CKK_RSA 00 00 00 00 00 00 01 01 CKA_SUBJECT 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 00 (length 0) /usr/include/c++/11/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>; std::vector<_Tp, _Alloc>::reference = unsigned char&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed. Upstream, git clone of today, same file as input. Normal operations # pwd /root/SoftHSMv2/src/bin/dump [root@registry1 dump]# ./softhsm2-dump-file /var/lib/ipa/dnssec/tokens/35c0069a-5a74-df91-32c5-09191e997b3a/95925d7d-5e9f-c5e7-2840-1f78482a1e00.object Dump of object file "/var/lib/ipa/dnssec/tokens/35c0069a-5a74-df91-32c5-09191e997b3a/95925d7d-5e9f-c5e7-2840-1f78482a1e00.object" 00 00 00 00 00 00 00 27 generation 39 00 00 00 00 00 00 00 00 CKA_CLASS 00 00 00 00 00 00 00 02 unsigned long attribute 00 00 00 00 00 00 00 03 CKO_PRIVATE_KEY 00 00 00 00 00 00 00 01 CKA_TOKEN 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 00 02 CKA_PRIVATE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 00 03 CKA_LABEL 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 40 (length 64) d1 ef b6 b5 2f d3 61 ab <..../.a.> 7c 93 5c 14 9e 4e ee b5 <|.\..N..> d3 bf d1 73 f7 03 1a 9e <...s....> a4 0d 9d d7 29 d8 e4 6d <....)..m> 9d 10 6b 85 e6 eb c9 2d <..k....-> 80 6d 05 4e 23 f9 ab 84 <.m.N#...> de 40 8e 25 18 b4 c5 c1 <.@.%....> 56 d8 13 a4 f9 6e e6 ee <V....n..> 00 00 00 00 00 00 01 00 CKA_KEY_TYPE 00 00 00 00 00 00 00 02 unsigned long attribute 00 00 00 00 00 00 00 00 CKK_RSA 00 00 00 00 00 00 01 01 CKA_SUBJECT 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 00 (length 0) 00 00 00 00 00 00 01 02 CKA_ID 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 30 (length 48) e5 af ff 18 87 b4 d4 e8 <........> c4 5b f7 5e 5b c4 43 49 <.[.^[.CI> 5e 58 5d 7a 81 b7 83 37 <^X]z...7> 3a 87 4b d8 c5 2f f8 97 <:.K../..> 39 f0 b9 76 94 40 4d 18 <9..v.@M.> 0f 75 07 8f 39 fb 81 5f <.u..9.._> 00 00 00 00 00 00 01 03 CKA_SENSITIVE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 05 CKA_DECRYPT 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 00 00 01 07 CKA_UNWRAP 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 00 00 01 08 CKA_SIGN 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 09 CKA_SIGN_RECOVER 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 0c CKA_DERIVE 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 00 00 01 10 CKA_START_DATE 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 00 (length 0) 00 00 00 00 00 00 01 11 CKA_END_DATE 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 00 (length 0) 00 00 00 00 00 00 01 20 CKA_MODULUS 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 01 a0 (length 416) ed 0c b4 ad ed d6 40 1c <......@.> df c2 9b 0b 49 f8 4a 95 <....I.J.> 0b 62 c1 42 7c fc e6 1d <.b.B|...> ff 2a b5 c5 f3 e8 d8 a1 <.*......> 5b 94 7e 32 e9 16 99 fe <[.~2....> 62 da ba ad 32 52 e8 7c <b...2R.|> 32 51 43 ca 3d 95 5b 9e <2QC.=.[.> b5 af 25 a2 58 44 90 1e <..%.XD..> 4f f7 08 30 ac d4 f4 c9 <O..0....> 2c 01 7a 99 e4 9c a7 c5 <,.z.....> c5 f1 0a 32 a9 02 d0 4e <...2...N> 55 e4 13 88 eb d7 69 77 <U.....iw> 7c cc e0 b6 0a fa dc 7e <|......~> ca 33 c6 52 20 2b ee f7 <.3.R.+..> bb 72 d7 5f 9d e6 c1 9f <.r._....> 50 a2 af cf 07 96 98 ae <P.......> 10 bb 8e 96 1c c3 23 18 <......#.> e1 ec 22 d0 73 8e 75 1a <..".s.u.> 44 5b 2a ed 48 7c 81 f4 <D[*.H|..> c8 b0 8e a1 a9 7f 43 1c <......C.> 52 ac 73 e2 59 2f 4d 01 <R.s.Y/M.> 85 01 cd 1a 7a 32 da f1 <....z2..> a2 91 a4 9e 3a d4 58 b3 <....:.X.> 14 e0 af 0c 94 4a 46 ee <.....JF.> e7 5a 7b da 37 c4 02 18 <.Z{.7...> 3d 96 af e5 8e 76 c9 5f <=....v._> b6 78 87 14 d2 92 91 fe <.x......> 6d 81 79 f8 23 1c 21 eb <m.y.#.!.> 3e c9 15 ea 8f 13 74 c5 <>.....t.> 9e 78 06 37 f1 0a 23 43 <.x.7..#C> cb 6b 9c 19 4c 04 5f f4 <.k..L._.> 6e 8d 9e 59 56 08 8b 98 <n..YV...> ad d8 cc ef e0 6e af 0f <.....n..> 1b 54 c6 53 12 ea 94 4e <.T.S...N> a1 b0 85 b4 fb 59 54 e4 <.....YT.> 6c aa cc f5 e8 33 8d dc <l....3..> 25 8c 08 2c 10 ca e4 fe <%..,....> d7 0d 0f ca af 39 3d fa <.....9=.> 6c e5 7d 28 e5 62 9a de <l.}(.b..> 34 d4 63 91 15 01 3a e4 <4.c...:.> eb af 7a f5 59 6a 74 2d <..z.Yjt-> 80 e9 86 e5 e7 1b 36 82 <......6.> d5 2a 99 b9 26 10 40 1b <.*..&.@.> a3 9e b0 52 f5 90 44 7a <...R..Dz> c1 02 89 66 ab 72 64 00 <...f.rd.> d2 3f 07 e3 cd a5 ba e0 <.?......> 9f 49 89 6d 08 1d 68 9a <.I.m..h.> d2 70 15 ee 8b 93 6c 15 <.p....l.> 7c b0 10 d4 e0 d4 6e 62 <|.....nb> 97 ff 80 f2 0c fb 0c 37 <.......7> e2 6b 3b 80 a8 e1 f5 0e <.k;.....> 34 bb 20 a3 cb fa a6 10 <4.......> 00 00 00 00 00 00 01 22 CKA_PUBLIC_EXPONENT 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 20 (length 32) e7 a7 27 ce b8 2f fc b1 <..'../..> ae f4 74 07 fc 47 fa e1 <..t..G..> c4 9d db 61 c1 e8 81 a0 <...a....> de a5 46 28 46 32 27 68 <..F(F2'h> 00 00 00 00 00 00 01 23 CKA_PRIVATE_EXPONENT 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 01 a0 (length 416) a0 ab 54 4b 18 61 e3 f1 <..TK.a..> fa 6f 1c f2 16 99 63 1d <.o....c.> 7d 2d a9 fa ac d2 79 80 <}-....y.> 7c dc 23 01 7e d6 54 ee <|.#.~.T.> 34 28 b5 67 05 6e ac 2e <4(.g.n..> 75 73 78 ce 89 c7 69 60 <usx...i`> 6f 79 2a fa 89 0d be b9 <oy*.....> cf 32 34 da 27 08 3b fc <.24.'.;.> e7 42 d4 ea a2 fa 12 2b <.B.....+> 84 94 d5 a4 63 0e ba 24 <....c..$> 84 4d a3 41 92 15 f2 4e <.M.A...N> 93 b6 42 44 32 e9 81 0b <..BD2...> 7e f3 9c 1c f7 77 2b dc <~....w+.> b9 0a 19 f5 ed 1b 67 16 <......g.> cd 4e 44 5e 73 d1 c4 96 <.ND^s...> 0e e2 db aa f0 61 be be <.....a..> 98 ad 68 51 7f 68 30 22 <..hQ.h0"> 06 f5 da 29 a9 de b0 b1 <...)....> 95 bd 82 be fe 3e b5 e5 <.....>..> d8 62 b0 26 12 16 26 c1 <.b.&..&.> a3 fb 80 7d 82 2a f0 e7 <...}.*..> fd b5 8b 79 6e 1a 5d a6 <...yn.].> 1c 62 82 bf 28 38 8d d4 <.b..(8..> 20 42 08 97 e5 45 a0 04 <.B...E..> 10 6e 69 fc d6 10 d7 53 <.ni....S> 82 ce 18 11 d2 a9 8e a8 <........> 2b 2b b6 09 7c 49 82 b1 <++..|I..> a6 d1 64 5b 8f 2f fe 1b <..d[./..> 66 6e ea ec 0b 03 82 7a <fn.....z> 87 27 63 7a 5d 60 99 df <.'cz]`..> 31 76 94 71 8b df 26 7c <1v.q..&|> c7 d9 a6 34 11 1f 10 d4 <...4....> 17 12 5d bb 1c ab a8 61 <..]....a> 8c b7 0e 49 0a 30 fc e3 <...I.0..> 4c e2 c1 ad d1 f4 17 65 <L......e> 93 65 c9 b0 2a 7a 53 e4 <.e..*zS.> 00 f8 8c a2 4d f7 01 bf <....M...> d3 a0 c3 c4 e9 05 18 62 <.......b> 57 ef 66 dd 1e 4a aa 7f <W.f..J..> 5e 0b be 10 7f ca 6d e4 <^.....m.> 91 22 c2 5c 10 6e 4c ae <.".\.nL.> 7e 21 89 9a 6c 72 ed 4d <~!..lr.M> aa c1 0d 57 89 05 a0 0b <...W....> e5 4a 08 d6 ff de 06 d7 <.J......> ab db d1 de 84 7f de b2 <........> 77 96 2b f1 5d d0 cf 97 <w.+.]...> b9 8b 0e 80 f3 14 81 5d <.......]> 67 d3 21 ee 5f 5d e5 9c <g.!._]..> da b7 19 c8 c7 0f 05 dd <........> 4f 36 d6 69 bc 36 c6 de <O6.i.6..> 87 f4 fe 9e de 30 e2 d6 <.....0..> c3 0f f1 8d 7a 2b 6d ad <....z+m.> 00 00 00 00 00 00 01 24 CKA_PRIME_1 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 e0 (length 224) 06 b9 2c 1d 5c 1b 7e a7 <..,.\.~.> d8 c5 e1 55 c1 e2 22 be <...U..".> 87 01 c9 66 44 5c 1a 65 <...fD\.e> d4 e9 d4 51 41 8d 21 0c <...QA.!.> 3f 6e 4e 14 80 88 a2 26 <?nN....&> d7 60 48 a0 3e 18 49 73 <.`H.>.Is> d9 a7 7b c7 62 25 6e 35 <..{.b%n5> 5c 24 c0 b0 de f1 01 e2 <\$......> 59 eb b8 58 a9 b5 c8 bc <Y..X....> e0 7e 3e 8f a9 e3 99 6d <.~>....m> d3 bc ce c5 89 05 7f 14 <........> b7 82 fa 43 a8 f3 0b 5d <...C...]> 1c 2a 52 b4 86 20 ce 8e <.*R.....> ba cd 7e c6 26 cd f4 d5 <..~.&...> 8d 2a bc 22 a9 af 90 05 <.*."....> 54 b3 b4 2d 47 10 f4 f9 <T..-G...> 20 bf ce 81 00 c0 fd b3 <........> 7d ae 18 2b 97 0c c2 7f <}..+....> e9 ba 35 f3 e5 6e 31 b2 <..5..n1.> fa 89 6c 42 5a e3 cf ee <..lBZ...> 4f 82 9b d3 4a ea 79 c2 <O...J.y.> 5d 61 23 09 85 2e 16 99 <]a#.....> d0 28 72 72 6f 0a 26 e4 <.(rro.&.> 3a 5e 5d fb c0 64 21 0d <:^]..d!.> b6 98 9c a4 46 67 03 ba <....Fg..> 0e cc 12 14 2a 81 a3 b5 <....*...> b6 8d 40 f8 7e 4d 3c 62 <..@.~M<b> 7e 73 47 0d 78 14 d0 53 <~sG.x..S> 00 00 00 00 00 00 01 25 CKA_PRIME_2 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 e0 (length 224) ca 2c d3 d0 ca e7 ad bb <.,......> 0e ea 6c 15 55 49 1b 51 <..l.UI.Q> 08 d2 0e 0e cb 16 40 71 <......@q> 08 d7 4a d5 8c 52 98 4a <..J..R.J> 11 84 02 ac 3b 69 8e 9a <....;i..> 78 b9 e3 78 ef cb ce c8 <x..x....> 9e f8 85 e8 b0 0e 01 96 <........> 9d 31 2b 31 90 17 11 dc <.1+1....> a8 8f 3c c6 b4 0b 77 f9 <..<...w.> 3b a3 51 e4 5a 28 95 4d <;.Q.Z(.M> 29 3c 3e 20 0f 12 84 03 <)<>.....> b1 c3 1a 01 7e 50 2e 6b <....~P.k> 46 9a bc 90 7a 22 48 90 <F...z"H.> 0e d8 4c 37 f8 2a da 60 <..L7.*.`> b7 17 29 eb 2e 5b e7 ab <..)..[..> 57 e8 72 c6 54 a1 d8 f2 <W.r.T...> 8d 2f dd 7a 5c 92 37 f3 <./.z\.7.> 7c c8 d9 77 b3 0f f8 e7 <|..w....> 45 83 d9 03 4d 62 21 71 <E...Mb!q> d3 f9 37 02 4d 90 dd f8 <..7.M...> d1 04 4f dc 1d be 81 61 <..O....a> 80 bd 66 e6 48 49 14 2c <..f.HI.,> 77 6e f9 9a 24 ab ba ee <wn..$...> 93 13 4a 32 da db 3b a7 <..J2..;.> bd 38 8e a1 71 00 dc 27 <.8..q..'> 16 86 85 b1 3f d9 a2 f0 <....?...> f1 c1 83 47 2f 54 2a da <...G/T*.> 6a 37 0b dc cc 12 18 e7 <j7......> 00 00 00 00 00 00 01 26 CKA_EXPONENT_1 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 e0 (length 224) 36 46 8a 27 3a 56 c3 0d <6F.':V..> e9 09 64 04 ff f4 11 64 <..d....d> fa 26 c6 f1 b7 b7 84 b8 <.&......> 55 e5 08 1b 58 2f 84 ff <U...X/..> 2e f7 b0 c4 0a bc a3 64 <.......d> 33 34 fc 7a 8c cd 60 30 <34.z..`0> b2 93 93 15 4f fe 56 e6 <....O.V.> f4 e2 3b 2f 63 09 12 a3 <..;/c...> f6 a2 df ac 94 aa 84 de <........> 76 7a 30 10 55 6f 52 2d <vz0.UoR-> 79 05 1d e4 04 06 63 5f <y.....c_> ce 7b be 7a 15 9b 57 6c <.{.z..Wl> 61 1b a6 4c d4 33 1e e0 <a..L.3..> 86 bb 6f 65 83 5a 46 2d <..oe.ZF-> 56 41 aa 82 10 6c 13 08 <VA...l..> 0e e7 3a 89 63 99 81 d7 <..:.c...> ce f9 0e 8e 89 89 8d 43 <.......C> 22 30 2c dd aa b2 94 82 <"0,.....> b3 f5 2e 86 8b 2c 00 77 <.....,.w> 26 17 74 4e 95 70 9a da <&.tN.p..> 34 35 ad b9 b4 e0 0e ab <45......> e5 0c 7c 69 7a e3 b9 fc <..|iz...> 2e b0 1c 50 f0 63 5a 27 <...P.cZ'> 9f b5 5f bb 2f c1 e8 65 <.._./..e> b8 3b a1 fd cd 59 8f 14 <.;...Y..> ab 1b 8a de 2c 47 33 43 <....,G3C> 4e e0 75 72 b4 87 5d 1f <N.ur..].> 04 ce 6d f2 f8 79 df a7 <..m..y..> 00 00 00 00 00 00 01 27 CKA_EXPONENT_2 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 e0 (length 224) 23 c1 3b a0 f1 80 29 e7 <#.;...).> 10 14 c9 37 c9 45 1d 1b <...7.E..> ee 10 23 2b 5f 3c 7c 02 <..#+_<|.> 05 6b bb 55 71 2b 99 ff <.k.Uq+..> 05 15 45 d0 d6 dd c0 83 <..E.....> 61 04 f7 d6 c3 da f2 3b <a......;> 33 fd 08 6a 9c 1b 98 bd <3..j....> c5 a5 97 e0 e3 85 cc 3b <.......;> 56 bc 2a 55 da f5 76 3b <V.*U..v;> a4 1b d2 34 54 51 57 d1 <...4TQW.> 5b 1b 86 8c b8 de 58 89 <[.....X.> e8 ad 7a 49 99 fd f4 c1 <..zI....> 74 31 d1 d9 01 8e 66 15 <t1....f.> 2b d1 38 1f d8 16 8f be <+.8.....> 0b 23 54 99 f8 9e 59 74 <.#T...Yt> c8 d4 ce b2 ee 12 dc 36 <.......6> 8d 21 6f 54 64 54 86 33 <.!oTdT.3> 8f e0 1b 15 04 73 d5 3f <.....s.?> 99 2b 18 20 33 67 1a 6d <.+..3g.m> 10 07 d4 e8 fd b4 b0 e0 <........> 42 cb bb bf d1 b3 88 d8 <B.......> 12 d4 48 1f 88 e8 ae 0a <..H.....> b4 4a 41 8e 2d 90 2a c0 <.JA.-.*.> 9d 30 60 7a 2a 94 16 32 <.0`z*..2> 80 1a 08 52 02 53 e9 5e <...R.S.^> 66 ff 63 9e cc c9 fa 28 <f.c....(> 18 75 e0 59 39 cd 45 4c <.u.Y9.EL> f5 29 54 25 79 17 a3 47 <.)T%y..G> 00 00 00 00 00 00 01 28 CKA_COEFFICIENT 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 e0 (length 224) 4b a2 d1 02 68 9e e9 fe <K...h...> 2f 66 6e a4 27 05 8f a8 </fn.'...> d6 03 94 bb 8e 25 07 44 <.....%.D> cc 7e b8 3b 36 44 d8 7c <.~.;6D.|> 28 be 4d 33 9a 61 d7 14 <(.M3.a..> c1 8a 12 8e 25 83 d1 35 <....%..5> ca 87 04 7b 0b 2d 99 2e <...{.-..> 80 72 1d cd 9a da f5 92 <.r......> 6c 5b 7c 3d 29 85 b7 7a <l[|=)..z> 3c 68 d4 a5 d0 e9 f9 2b <<h.....+> 6a dc b4 52 3d 4d ee c1 <j..R=M..> 0a 6a b9 c2 7d d4 e4 40 <.j..}..@> 63 08 5f 2c 61 b9 03 6f <c._,a..o> 83 88 2d 95 cf 73 32 aa <..-..s2.> f1 94 d5 43 5b c8 50 4e <...C[.PN> 7d 19 5e 23 f9 61 f0 2f <}.^#.a./> 27 da 75 17 44 63 56 96 <'.u.DcV.> 79 a5 86 c6 77 67 05 12 <y...wg..> 3a ad dc d7 d1 1c 6d 95 <:.....m.> 94 c0 cf 67 c9 35 cd 06 <...g.5..> bc a2 f7 48 97 5d 01 d4 <...H.]..> 31 14 6e 17 10 81 30 7d <1.n...0}> b1 f2 68 92 75 db 6c 0a <..h.u.l.> e5 11 0f 91 43 87 5d 59 <....C.]Y> 4a b1 95 c8 c6 20 50 69 <J.....Pi> b1 01 fd 70 a0 82 dd fd <...p....> 9b 40 b8 7e ef b0 76 21 <.@.~..v!> e6 d0 b6 22 e1 c6 ab db <..."....> 00 00 00 00 00 00 01 29 CKA_PUBLIC_KEY_INFO 00 00 00 00 00 00 00 03 byte string attribute 00 00 00 00 00 00 00 00 (length 0) 00 00 00 00 00 00 01 62 CKA_EXTRACTABLE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 63 CKA_LOCAL 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 64 CKA_NEVER_EXTRACTABLE 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 00 00 01 65 CKA_ALWAYS_SENSITIVE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 66 CKA_KEY_GEN_MECHANISM 00 00 00 00 00 00 00 02 unsigned long attribute 00 00 00 00 00 00 00 00 CKM_RSA_PKCS_KEY_PAIR_GEN 00 00 00 00 00 00 01 70 CKA_MODIFIABLE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 71 CKA_COPYABLE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 01 72 CKA_DESTROYABLE 00 00 00 00 00 00 00 01 boolean attribute ff TRUE 00 00 00 00 00 00 02 02 CKA_ALWAYS_AUTHENTICATE 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 00 00 02 10 CKA_WRAP_WITH_TRUSTED 00 00 00 00 00 00 00 01 boolean attribute 00 FALSE 00 00 00 00 40 00 02 12 CKA_UNWRAP_TEMPLATE 00 00 00 00 00 00 00 04 attribute map attribute 00 00 00 00 00 00 00 00 (length 0) 00 00 00 00 40 00 06 00 CKA_ALLOWED_MECHANISMS 00 00 00 00 00 00 00 05 mechanism set attribute 00 00 00 00 00 00 00 00 (length 0) [root@registry1 dump]#
I have run into similar, but not the same, bug on Red Hat Enterprise Linux 8.5 - filed upstream with a fix https://github.com/opendnssec/SoftHSMv2/pull/664 The reason why the upstream works is that enterprise linux builds use additional C++ library assertions. You should be able to reproduce this on upstream build by running configure like this: env CXXFLAGS="-D_LIBCPP_DEBUG_LEVEL=1" /path/to/configure .... I can't reproduce this (I don't have a token handy with an empty attribute), but maybe the following patch works: diff --git a/src/bin/dump/softhsm2-dump-file.cpp b/src/bin/dump/softhsm2-dump-file.cpp index 994f67e..0bf8b29 100644 --- a/src/bin/dump/softhsm2-dump-file.cpp +++ b/src/bin/dump/softhsm2-dump-file.cpp @@ -155,10 +155,12 @@ bool readBytes(FILE* stream, std::vector<uint8_t>& value) { return false; } - if (fread(&value[0], 1, len, stream) != len) - { - (void) fsetpos(stream, &pos); - return false; + if (len > 0) { + if (fread(&value[0], 1, len, stream) != len) + { + (void) fsetpos(stream, &pos); + return false; + } } return true; } If it does not, can you try running the dump utility with gdb: Compile upstream source with "env CFLAGS=-g CXXFLAGS="-g -D_LIBCPP_DEBUG_LEVEL=1" /path/to/your/configure" and build it with make OR Install debug symbols for softhsm2 THEN gdb --args softhsm2-dump-file /var/lib/ipa/dnssec/tokens/35c0069a-5a74-df91-32c5-09191e997b3a/95925d7d-5e9f-c5e7-2840-1f78482a1e00.object after this just "run" and when it crashes, "bt".
Thanks for the tip. There were too many other bugs I hit in softhsm to do with contention corruption when dnssec was deployed in freeipa I had to abandon dnssec and hence softhsm until it's fixed.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16. Fedora Linux 36 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.