This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal function
Type: crash Stage:
Components: Regular Expressions, Windows Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, mherrmann.at, mrabarnett, pitrou, vstinner
Priority: normal Keywords:

Created on 2013-09-19 07:14 by mherrmann.at, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg198045 - (view) Author: Michael Herrmann (mherrmann.at) Date: 2013-09-19 07:14
I'm on 32 bit Python 2.7.3 and 64 bit Windows 7. I am working on a complex, multithreaded application which uses COM to communicate with other processes.

My application uses regular expressions in a few (but not very many) places. An example re I am trying to match is 'quit(\\(.*\\))?', an example input would be 'quit()'. Nothing exciting.

Very frustratingly, even though the regular expressions and inputs are the same, I spuriously get errors of the following form:

Traceback (most recent call last):
  ...
  File "re.pyc", line 137, in match
SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal function

I have seen the bug many times on 2.7.3. I briefly tried to reproduce it on 2.7.5 and it did not occur. This may be because the bug only occurs spuriously and I was unlucky, or because the bug no longer exists in 2.7.5. My (unverified) hunch is that the bug is not in 2.7.5 anymore. 

I have a C unhandled exception handler installed in my application. What's interesting is that the bug frequently seems to occur together with an unhandled memory access violation (exception code C0000005). When this is the case, the Python interpreter hangs or crashes.

I have not seen similar crashes in my application at other points; only when working with regular expressions and seeing the above stack trace.
msg198056 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-09-19 11:29
Is there any reason why you don't switch to 2.7.5 and let your application run longer?

(FWIW, this may be issue #16602)
msg199429 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-10 23:15
@ichael Herrmann: ping? Without feedback, I will close the issue.
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63246
2014-11-01 19:41:45pitrousetstatus: pending -> closed
resolution: out of date
2014-11-01 18:21:54serhiy.storchakasetstatus: open -> pending
2013-10-10 23:15:58vstinnersetmessages: + msg199429
2013-09-24 22:02:31vstinnersetnosy: + vstinner
2013-09-19 11:29:32pitrousetnosy: + pitrou
messages: + msg198056
2013-09-19 07:14:58mherrmann.atcreate