etcimon / botan

Block & stream ciphers, public key crypto, hashing, KDF, MAC, PKCS, TLS, ASN.1, BER/DER, etc.
Other
85 stars 22 forks source link

broken dmd release build #23

Closed MartinNowak closed 7 years ago

MartinNowak commented 7 years ago

Always end up in botan.tls.extensions.SupportedEllipticCurves.nameToCurveId w/ no arguments and a broken stack trace. I'd guess because of some memory corruption.

#0  botan.tls.extensions.SupportedEllipticCurves.nameToCurveId(const(immutable(char)[])) (name=...)
    at ../../../../.dub/packages/botan-1.12.7/botan/source/botan/tls/extensions.d:791
#1  0x0000000000000000 in ?? ()
etcimon commented 7 years ago

Any details regarding the other dependencies or usage?

etcimon commented 7 years ago

Also, build "versions" tags, did you try DisableDebugger or EnableDebugger? Is this a core dump or a gdb debugging session / reproducible?

etcimon commented 7 years ago

Do you use concurrency? Which curves are you using?

etcimon commented 7 years ago

Try removing the name append here: https://github.com/etcimon/botan/blob/v1.12.7/source/botan/tls/extensions.d#L790 which could have been deserialized as null maybe?

MartinNowak commented 7 years ago

The stack trace is fairly broken in gdb, so it might not even be a regular call. Here is the stracktrace from the exception http://pastebin.com/p4qaWEbA.

etcimon commented 7 years ago

Did you provide a custom curve list? Which DMD version does this run with?

MartinNowak commented 7 years ago

No, I did not, seems like policy.allowedEccCurves() get's broken.

import std.stdio;
auto curves = policy.allowedEccCurves();
foreach (c; curves)
    writeln("allowedEccCurves: ", c);

It's dmd 2.071.2.

etcimon commented 7 years ago

Ok with that info I'll attempt to update my DMD version tomorrow and reproduce

MartinNowak commented 7 years ago

Ok with that info I'll attempt to update my DMD version tomorrow and reproduce

I can recommend curl -fsS https://dlang.org/install.sh | bash -s dmd-2.071.2 ;).

etcimon commented 7 years ago

I decided to test run everything with 2.072.0, lots of regressions and errors. I couldn't get the same error but I can downgrade to 2.071.2 to see

MartinNowak commented 7 years ago

Seems like the error happens in vibe.d filling it's CustomTLSPolicy, can take care of the rest of debugging.

MartinNowak commented 7 years ago

Duplicate of https://github.com/rejectedsoftware/vibe.d/issues/1578