error handling in initialize_globals() from cextensions can cause interpreter to segfault

Bug #1006284 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
Fix Released
Medium
James Henstridge

Bug Description

The initialize_globals() function in the Storm C extensions exits early if it detects that it has been run before. Unfortunately, if it failed on the first run then it will return successfully on all subsequent runs despite not having performed necessary initialisation:

    static int
    initialize_globals(void)
    {
        static int initialized = 0;
        if (initialized)
            return 1;
        initialized = 1;
        [actual initialisation goes here]
    }

This can cause the interpreter to segfault, as demonstrated by the attached program.

Related branches

Revision history for this message
James Henstridge (jamesh) wrote :
Changed in storm:
assignee: nobody → James Henstridge (jamesh)
importance: Undecided → Medium
milestone: none → 0.20
status: New → In Progress
Changed in storm:
status: In Progress → Fix Committed
Changed in storm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.