"make debug" runs into a "analyzer-deref-before-check" -error #114

Closed
opened 2025-03-14 02:56:21 -04:00 by jeukku · 1 comment

"make release" compiles fine. I think this is a issue with make or gcc version.

I currently have:
GNU Make 4.4.1
gcc (GCC) 14.2.1 20250207

Here is a snippet of the error:

src/ssb.c: In function ‘_tf_ssb_connection_box_stream_send’:
src/ssb.c:600:21: error: check of ‘message_enc’ for NULL after already dereferencing it [-Werror=analyzer-deref-before-check]
  600 |                 if (crypto_secretbox_easy(message_enc, header, sizeof(header), nonce1, connection->c_to_s_box_key) != 0)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ‘tf_ssb_tunnel_create’: events 1-2
    |
    | 4595 | bool tf_ssb_tunnel_create(tf_ssb_t* ssb, const char* portal_id, const char* target_id, int connect_flags)
    |      |      ^~~~~~~~~~~~~~~~~~~~
    |      |      |
    |      |      (1) entry to ‘tf_ssb_tunnel_create’
    | 4596 | {
    | 4597 |         tf_ssb_connection_t* connection = tf_ssb_connection_get(ssb, portal_id);
    |      |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |      |                                           |
    |      |                                           (2) calling ‘tf_ssb_connection_get’ from ‘tf_ssb_tunnel_create’
    |
"make release" compiles fine. I think this is a issue with make or gcc version. I currently have: GNU Make 4.4.1 gcc (GCC) 14.2.1 20250207 Here is a snippet of the error: ``` src/ssb.c: In function ‘_tf_ssb_connection_box_stream_send’: src/ssb.c:600:21: error: check of ‘message_enc’ for NULL after already dereferencing it [-Werror=analyzer-deref-before-check] 600 | if (crypto_secretbox_easy(message_enc, header, sizeof(header), nonce1, connection->c_to_s_box_key) != 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ‘tf_ssb_tunnel_create’: events 1-2 | | 4595 | bool tf_ssb_tunnel_create(tf_ssb_t* ssb, const char* portal_id, const char* target_id, int connect_flags) | | ^~~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to ‘tf_ssb_tunnel_create’ | 4596 | { | 4597 | tf_ssb_connection_t* connection = tf_ssb_connection_get(ssb, portal_id); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (2) calling ‘tf_ssb_connection_get’ from ‘tf_ssb_tunnel_create’ | ```
Owner

The best I have around is gcc 14.2.0, and I couldn't repro this with that, but I made a speculative fix. Thanks.

The best I have around is gcc 14.2.0, and I couldn't repro this with that, but I made a speculative fix. Thanks.
cory closed this issue 2025-03-15 13:55:30 -04:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cory/tildefriends#114
No description provided.