Skip to content

openssl wrapper corrupts stack on OpenSSL 1.1.1f + Android #13903

Closed
@dom96

Description

@dom96

I'm not sure this is Android-specific. I actually vaguely remember seeing others having the same issues with a similar stack trace leading to...

    C:\Users\morfe\.choosenim\toolchains\nim-1.0.6\lib\pure\net.nim(543) newContext

i.e. a SIGSEGV on the newContext call, specifically the call to SSLv23_method(). Which as it happens has some really funky logic: https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L327

Guessing it's an issue that only appears on newer OpenSSL's (the one I'm using is currently the latest).

I've tried to resolve it but couldn't figure out what's wrong, that said the code does have some suspicious things, it calls a possibly nil proc pointer for example (I fixed that and still had corruptions though).

In any case, it's likely a good idea to at least allow to disable these hacks, I had to add or defined(noOpenSSLHacks): to https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L247 :/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions