Closed woodruffw closed 5 years ago
Is this the only issue? Every time I've seen this message so far, it's because something else was crashing, and the exception handler was causing threading issues.
Those are the only exceptions I see, although that "Exception during reset or similar" line is suspect (I can't find it anywhere in our source).
Tried using a contextmanager here, with no luck. "Exception during reset or similar" is apparently an SQLAlchemy NullPool
thing, so I'll try fiddling with our pooling strategy.
Alright, I think I solved it: it looks the problem was not closing the session in the cached checksec case. I've also added an explicit session.close()
to the fallthrough case. My best guess is that the underlying problem was that the session (or some part of it) gets embedded into each Checksec
instance via Base
, making SQLite unhappy when the former instances pass over threads.
New problem in the non-cached case:
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: checksec.hash [SQL: 'INSERT INTO checksec (hash, aslr, authenticode, cfg, "dynamicBase", "forceIntegrity", gs, "highEntropyVA", isolation, nx, rfg, "safeSEH", seh, path) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('87e4b7f186b9bf1f7d95c77c63793f7a3a1a887d4967b7519053b911eadb5ea3', 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 'C:\\Users\\IEUser\\Downloads\\fuzzgoat-master\\x64\\Release\\Fuzzgoat.exe')] (Background on this error at: http://sqlalche.me/e/gkpj)
This is almost working, although I'm getting some exceptions from
pysqlite
about threads:I'm not that familiar with Qt's threading model or SQLAlchemy, but these exceptions don't make much sense to me: the session that we use in
db.Checksec.byExecutable
is created internally, within (what I think is) the same thread. CCing @ehennenfent for ideas here.Closes #306.