Skip to content

exception on function that defines a pointer to a union #2

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

The struct xpmem_id is a length of 8.
I know there are other ways to do this, but
this function causes an exception in just loading
the script.

static void
show_id(long id)
{
        union locid {
                struct xpmem_id sid;
                long lid;
        } *lup;
        long local_id;

        local_id = id;
        lup = (union locid *)&local_id;

        printf("(pid %d uniq %d partid %d)",
                lup->sid.tgid, lup->sid.uniq,
                lup->sid.partid);
}

What is the expected output? What do you see instead?

exception, and failure to load the script

What version of the product are you using? On what operating system?

crash.6.0.8   sles11sp2 on x86_64

Please provide any additional information below.

Luc, you saw this already.  This is just a
memory jogger.

Original issue reported on code.google.com by cpwick...@gmail.com on 9 Aug 2012 at 2:10

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions