8000 Bad access in SPTSharedExampleGroups · Issue #225 · specta/specta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Bad access in SPTSharedExampleGroups #225
Open
@jmoody

Description

@jmoody

Reproduce

  • Xcode 9.2, 9.3, 9.4 beta
  • macOS Sierra, High Sierra
  1. Pull calabash-ios-server develop/ branch
  2. Update code sign settings for the XCTest target to match your signing environment
  3. Run an individual XCTest via the Xcode UI until the crash happens (takes 2 - 3 tries)

Expected

Tests to complete.

Found

Bad access in
SPTShareExampleGroups.m#L28

Analysis

        if (numClasses > 0) {
            classes = (Class *)malloc(sizeof(Class) * numClasses);
            numClasses = objc_getClassList(classes, numClasses);

            Class klass, superClass;
            for(uint i = 0; i < numClasses; i++) {
                klass = classes[i];
                    superClass = class_getSuperclass(klass);
                    if (superClass == SPTSharedExampleGroupsClass) {
                            [[[klass alloc] init] sharedExampleGroups];
                        }
                    }
                }
            }
            free(classes);
        }

I believe classes are being dealloc'd during the loop.

I am not sure what this code is trying to accomplish. Skipping the loop appears to have no effect on Specta.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0