[Bug 1123588]

Rguenth 1123588 at bugs.launchpad.net
Mon Feb 18 12:48:13 UTC 2013


I don't see how this is a bug.

  job_64 = job_new (class_39, "");
  # DEBUG job => job_64
  if (job_64 == 0B)
    goto <bb 43>;
  else
    goto <bb 44>;

<bb 43>:
  # DEBUG __fmt => "BAD: wrong value for %s, got unexpected %p\n\tat %s:%d (%s).\n"
  __printf_chk (1, "BAD: wrong value for %s, got unexpected %p\n\tat %s:%d (%s).\n", "job", 0B, "tests/test_job.c", 111, &__FUNCTION__);
  abort ();

<bb 44>:
  D.9269_65 = job_64->pid;
  *D.9269_65 = pid_49;

that was the last use of the memory pointed to by job_64 (job_new is marked as malloc).  In fact, job_64->pid is uninitialized!  To quote the documentation
of the malloc attribute:

@item malloc
@cindex @code{malloc} attribute
The @code{malloc} attribute is used to tell the compiler that a function
may be treated as if any non- at code{NULL} pointer it returns cannot
alias any other pointer valid when the function returns and that the memory
has undefined content.
This will often improve optimization.
Standard functions with this property include @code{malloc} and
@code{calloc}.  @code{realloc}-like functions do not have this
property as the memory pointed to does not have undefined content.

it appears that the returned memory does not have undefined contents.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/1123588

Title:
   [4.7 Regression] wrong code with the fix for PR53844

Status in The GNU Compiler Collection:
  Invalid
Status in “gcc-4.7” package in Ubuntu:
  Invalid
Status in “upstart” package in Ubuntu:
  Triaged
Status in “gcc-4.7” source package in Raring:
  Invalid
Status in “upstart” source package in Raring:
  Triaged

Bug description:
  seen with -21ubuntu1, not with -20ubuntu1, reverting the fix for
  PR53844 avoids the issue.

  I think we need a reproducer in upstart, which doesn't just hang.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1123588/+subscriptions




More information about the foundations-bugs mailing list