gks: zero-initialize ref_cntx before use#883
gks: zero-initialize ref_cntx before use#883jerryyiransun wants to merge 2 commits intoflame:masterfrom
Conversation
|
Hi @jerryyiransun nice debugging work, but I'm concerned that your fix works as the context is supposed to be fully initialized by err_t e_val = bli_cntx_init( cntx );
bli_check_error_code( e_val );I am interested to see if this detects an error in the initialization. |
|
err_t e_val = bli_gks_init_ref_cntx( &ref_cntx );
bli_check_error_code( e_val );EDIT: never mind, the code IS checked there. |
|
Would it be more appropriate to put the memset inside the function |
I got a slightly different error from bli_check_error_code |
good point, let me make that update |
|
So there is definitely some UB going on. I would be very interested to see what happens if you do While I know you're probably just trying to move forward with the z/OS port, I would like to make sure the bug is fixed "for good"... |
Previously, ref_cntx was left uninitialized in bli_gks_cntx_ukr_is_ref() and bli_gks_cntx_ukr2_is_ref(). This lead to undefined behavior. The changes explicitly zero the structure to ensure deterministic behavior.
This fixes the issue mention at #882