Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python hangs on FreeBSD7 in test_capi #46816

Closed
trepan mannequin opened this issue Apr 6, 2008 · 7 comments
Closed

Python hangs on FreeBSD7 in test_capi #46816

trepan mannequin opened this issue Apr 6, 2008 · 7 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@trepan
Copy link
Mannequin

trepan mannequin commented Apr 6, 2008

BPO 2564
Nosy @amauryfa, @tpn
Files
  • backtrace: GDB Backtrace
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tpn'
    closed_at = <Date 2008-04-08.21:28:47.678>
    created_at = <Date 2008-04-06.16:05:14.866>
    labels = ['type-bug']
    title = 'Python hangs on FreeBSD7 in test_capi'
    updated_at = <Date 2008-04-08.21:28:47.676>
    user = 'https://bugs.python.org/trepan'

    bugs.python.org fields:

    activity = <Date 2008-04-08.21:28:47.676>
    actor = 'amaury.forgeotdarc'
    assignee = 'trent'
    closed = True
    closed_date = <Date 2008-04-08.21:28:47.678>
    closer = 'amaury.forgeotdarc'
    components = ['None']
    creation = <Date 2008-04-06.16:05:14.866>
    creator = 'trepan'
    dependencies = []
    files = ['9964']
    hgrepos = []
    issue_num = 2564
    keywords = []
    message_count = 7.0
    messages = ['65043', '65159', '65161', '65165', '65202', '65216', '65220']
    nosy_count = 4.0
    nosy_names = ['amaury.forgeotdarc', 'gpolo', 'trent', 'trepan']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2564'
    versions = ['Python 2.5']

    @trepan trepan mannequin added the type-bug An unexpected behavior, bug, or error label Apr 6, 2008
    @trepan
    Copy link
    Mannequin Author

    trepan mannequin commented Apr 6, 2008

    When doing import.test_autotest, test_capi hangs.
    It seems that threads 1,2,3 are trying to acquire import lock, which is
    owned by thread 4, which is trying to lock some other lock.

    Python 2.5.2 (r252:60911, Apr 6 2008, 17:28:23)
    [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7

    @tpn
    Copy link
    Member

    tpn commented Apr 8, 2008

    Ahh, more FreeBSD threading woes. If no-one beats me to it, I'll be
    able to start taking a look at this when our FreeBSD 7 server is up in
    a week or so.

    @tpn tpn self-assigned this Apr 8, 2008
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Apr 8, 2008

    Hi Trent,

    FreeBSD 7 uses libthr as default, which would possibly eliminate this
    problem.

    @amauryfa
    Copy link
    Member

    amauryfa commented Apr 8, 2008

    I think that this problem is not FreeBSD specific:

    • "import test.autotest" runs the whole test suite as a side-effect of
      an import statement.
    • in the test suite test_capi spawns threads, which also import.
    • a lock ensues...

    See for example test_threaded_import.py::

        if imp.lock_held():
            # This triggers on, e.g., from test import autotest.
            raise TestSkipped("can't run when import lock is held")

    I the test_capi case, I think that the two imports in TestThreadState
    should be moved outside the function.

    Also, the backtrace file shows two other threads locked in a "import
    socket" statement. I suspect problems in test_urllib2.py or
    test_urllib2net.py...

    @trepan
    Copy link
    Mannequin Author

    trepan mannequin commented Apr 8, 2008

    I don't that the problem is in tests. For example
    import pygtk
    import gtk
    hangs also. I don't have backtrace for PyGtk hang yet, but it hangs in
    ucond state too (like test_capi).

    @amauryfa
    Copy link
    Member

    amauryfa commented Apr 8, 2008

    In any case, I reproduce the problem on Windows too.

    @amauryfa
    Copy link
    Member

    amauryfa commented Apr 8, 2008

    Committed r62229. Please file a separate issue for the gtk module, it's
    really another thing.

    @amauryfa amauryfa closed this as completed Apr 8, 2008
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants