Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.048 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'creates': 0.14; 'thread': 0.14; "wouldn't": 0.14; '*any*': 0.16; '4:25': 0.16; 'at,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals': 0.16; 'igor': 0.16; 'mutable': 0.16; 'shared.': 0.16; 'sorts': 0.16; 'sqlite': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'header:In- Reply-To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'easier': 0.31; 'probably': 0.32; 'stuff': 0.32; 'another': 0.32; "i'd": 0.34; "can't": 0.35; 'created': 0.35; 'something': 0.35; 'objects': 0.35; 'operations': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'issue': 0.38; 'fact': 0.38; 'pm,': 0.38; 'that,': 0.38; 'expect': 0.39; '12,': 0.39; 'even': 0.60; 'more': 0.64; 'due': 0.66; 'sharing': 0.69; 'drive.': 0.84; 'factors,': 0.84; 'replicate': 0.84; 'significance': 0.84; 'to:none': 0.92; 'race': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=oPO3sIdvYXPIHOt0CunO31UUKpsYuS1E7yaYKPYNo/E=; b=JFQHXm0lWv2Nsw3Vh8eL2wzrhYSSWIFrh8AGmXgzJBQayLrjpuXF4HMgs3poIlvNzq VZ0iOR8qoR3sjIbMYKLaVqf7bABFwzDWwqhMR/OdDHqLAAKTMdg3TEf0wyFnHtDgeBn6 lbV9KsG/0xkn8mMybK6roC8OGWCbAiRlb5axCjsGYXjXhHjGcOpp1Np67YX3K5v19mRA NReTAb5Jz+wDoCgUwoN5mUd2Jj+JeB7C9itdS/D8jR7GjzdCNkAyLud18Nm00svem6gs DS0HJanizjsElORq99M0iZOOVWq4LZS83fI/XqaQx9dKzg43+j7zrh+vmIcvP0ITFJDw NcEA== MIME-Version: 1.0 X-Received: by 10.68.212.163 with SMTP id nl3mr8484498pbc.25.1386826310302; Wed, 11 Dec 2013 21:31:50 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Dec 2013 16:31:50 +1100 Subject: Re: Strange crashes From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386826313 news.xs4all.nl 2841 [2001:888:2000:d::a6]:48078 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61662 On Thu, Dec 12, 2013 at 4:25 PM, Igor Korot wrote: > ProgrammingError: SQLite objects created in a thread can only be used > in that same thread.The object was created in thread id 14260 and this > is thread id 9264 > > Where should I start looking for causes? Well, I'd look for something that creates an SQLite object on one thread and uses it on another :) More generally, your issue is probably due to sharing things across threads that shouldn't be shared. That's going to give all sorts of race conditions that you might never be able to replicate - the exact order of operations might depend on any number of factors, even stuff you wouldn't expect to have ANY significance like the speed of your hard drive. The fact that it works on your system is indicative of luck. See if you can avoid *any* mutable globals in your thread handlers, or if you can't achieve that, have a good hard look at every global that any thread other than the main thread can change. The less you have to look at, the easier it'll be to find this sort of thing. ChrisA