Comment 23 for bug 419663

Revision history for this message
In , Martin Pitt (pitti) wrote :

Some analysis:

- According to some duplicates, this crash is 100% reproducible with some devices (unfortunately with none of mine)
- stdout is not NULL (the -O2 optimized that away unfortunately, but the condition is checked before)
- devkit-disks-helper-ata-smart-collect returned with exit code 0 (condition is checked before)
- blob_size could be already written by g_base64_decode(), or just be uninitialized, so we can't rely on the origin of "1"
- g_base64_decode() code shows that it can only return NULL in those conditions:

  g_return_val_if_fail (text != NULL, NULL);
  g_return_val_if_fail (out_len != NULL, NULL);

  input_length = strlen (text);

  g_return_val_if_fail (input_length > 1, NULL);

  We already know that text != NULL (which is "stdout" here), and we also know that out_len != NULL (it's a pointer to a local variable.

So it seems that the reason is that stdout is just a single character.

I propose to intercept this condition gracefully and add some debug logging what the output is, so that in the future we can get to the root cause.