OpenIDC / ngx_oauth2_module

OAuth 2.x Resource Server module for NGINX
Apache License 2.0
15 stars 12 forks source link

unaligned memory access on 64-bit SPARC during module initialization #2

Closed glenk closed 2 years ago

glenk commented 3 years ago

When starting up nginx built with the ngx_oauth2_module on 64-bit SPARC (niagara4) on Solaris 10 with gcc 5.5.0, nginx dumps core with a SIGBUS error:

Program terminated with signal SIGBUS, Bus error.

0 0x0000000100166f54 in ngx_openidc_set_claim (cf=0xffffffff7ffff480,

cmd=0x1002efe70 <ngx_openidc_commands+336>, conf=0x100370380)
at /home/webops/myghadm/src/ngx_openidc_module-master/src/ngx_openidc_module.c:144

144 claim->name = oauth2_strndup((const char *)value[1].data, value[1].len);

As SPARC is sensitive to alignment issues, I expect that this is a platform-specific issue.

My OpenIDC config (redacted, from the server location section of a very generic nginx.conf) is attached at OpenIDC-Config.txt.

The stack trace from the core file is attached as gdb_ngx_core.txt.

I'm happy to provide any additional information on this issue, and any further assistance to help resolve this. Thanks for taking a look!

OpenIDC-Config.txt gdb_ngx_core.txt

zandbelt commented 3 years ago

hmm, can you use "-misalign" as a compiler option?

also, the stack trace seems to be about ngx_openidc_module rather than ngx_oauth2_module?

glenk commented 3 years ago

Hi Hans,

I’m sorry, I missed your note when I was out last Friday. I’m using gcc 5.5, and that doesn’t seem to be a command-line option recognized by gcc. The output from nginx auto/configure reports:

gcc: error: unrecognized command line option '-misalign'

Would it help to switch to the Oracle (formerly Sun) Studio developer compiler? Are there other gcc flags that would help?

Thanks! -glen

From: Hans Zandbelt @.> Sent: Friday, May 28, 2021 1:36 AM To: zmartzone/ngx_oauth2_module @.> Cc: Glen R. Kriekenbeck @.>; Author @.> Subject: Re: [zmartzone/ngx_oauth2_module] unaligned memory access on 64-bit SPARC during module initialization (#2)

Caution: This email came from outside Kaiser Permanente. Do not open attachments or click on links if you do not recognize the sender.


hmm, can you use "-misalign" as a compiler option?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/zmartzone/ngx_oauth2_module/issues/2*issuecomment-850252365__;Iw!!BZ50a36bapWJ!441pHeZNYf0Fq6UHk5ASrH5ZLTwJSqEffzEg0Rvk-kEFKz0HqPIIWgogWRnxPM7V64Od$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AAPLUH3LSAJ4RA6W5L34LJLTP5IX3ANCNFSM45WAO2FA__;!!BZ50a36bapWJ!441pHeZNYf0Fq6UHk5ASrH5ZLTwJSqEffzEg0Rvk-kEFKz0HqPIIWgogWRnxPFePq-84$. NOTICE TO RECIPIENT: If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. v.173.295 Thank you.

zandbelt commented 3 years ago

please try https://github.com/zmartzone/ngx_openidc_module/commit/1d886282b9042814d66a802e7a60c5bbf20b7a45 and https://github.com/zmartzone/ngx_oauth2_module/commit/3309c78e389c3ec28630e8ec0f37d963b74f6e22