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

test_sqlite crashes on OS X tiger 3.x buildbot #62719

Closed
ned-deily opened this issue Jul 21, 2013 · 17 comments
Closed

test_sqlite crashes on OS X tiger 3.x buildbot #62719

ned-deily opened this issue Jul 21, 2013 · 17 comments
Labels
type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@ned-deily
Copy link
Member

BPO 18519
Nosy @vstinner, @ned-deily, @bitdancer
Files
  • sqlite_authorizer_err.patch
  • 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 = None
    closed_at = <Date 2013-08-02.00:09:28.146>
    created_at = <Date 2013-07-21.09:57:50.684>
    labels = ['type-crash']
    title = 'test_sqlite crashes on OS X tiger 3.x buildbot'
    updated_at = <Date 2013-08-02.00:09:28.145>
    user = 'https://github.com/ned-deily'

    bugs.python.org fields:

    activity = <Date 2013-08-02.00:09:28.145>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-08-02.00:09:28.146>
    closer = 'vstinner'
    components = []
    creation = <Date 2013-07-21.09:57:50.684>
    creator = 'ned.deily'
    dependencies = []
    files = ['31002']
    hgrepos = []
    issue_num = 18519
    keywords = ['patch', 'buildbot']
    message_count = 17.0
    messages = ['193431', '193436', '193437', '193449', '193457', '193458', '193503', '193622', '193738', '193739', '193959', '193961', '194136', '194138', '194140', '194141', '194142']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'ned.deily', 'r.david.murray', 'python-dev']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue18519'
    versions = ['Python 3.4']

    @ned-deily
    Copy link
    Member Author

    See for instance:
    http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/6626

    I was also able to reproduce and bisect on an OS X 10.5 (Leopard) PPC system:

    $ hg bisec -b
    The first bad revision is:
    changeset:   84704:48a869a39e2d
    user:        Victor Stinner <victor.stinner@gmail.com>
    date:        Thu Jul 18 01:41:08 2013 +0200
    summary:     Issue python/cpython#62608: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail

    Crash and gdb "where" with current tip:

    $ hg log -r tip
    changeset:   84749:5643e873f06e
    tag:         tip
    parent:      84746:c5d128b201af
    parent:      84748:db6a22943a3f
    user:        Ned Deily <nad@acm.org>
    date:        Sat Jul 20 15:08:22 2013 -0700
    summary:     Issue python/cpython#61734: merge from 3.3
    $ ./python -m test  test_sqlite
    [1/1] test_sqlite
    Assertion failed: (!PyErr_Occurred()), function PyEval_EvalFrameEx, file Python/ceval.c, line 1210.
    Fatal Python error: Aborted

    Current thread 0xa0343820:
    File "/Volumes/cache/py/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 441 in authorizer_cb
    File "/Volumes/cache/py/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 406 in test_table_access
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/case.py", line 496 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/case.py", line 535 in __call__
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__
    File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1480 in run
    File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1581 in _run_suite
    File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1615 in run_unittest
    File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1304 in <lambda>
    File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1305 in runtest_inner
    File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1009 in runtest
    File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 796 in main
    File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1590 in main_in_temp_cwd
    File "/Volumes/cache/py/3x/unix/source/Lib/test/main.py", line 3 in <module>
    File "/Volumes/cache/py/3x/unix/source/Lib/runpy.py", line 73 in _run_code
    File "/Volumes/cache/py/3x/unix/source/Lib/runpy.py", line 160 in _run_module_as_main
    Abort trap
    $ gdb ./python
    GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:15:14 UTC 2009)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries .... done

    (gdb) -m test -w -uall,-largefile test_sqlite
    Undefined command: "-m". Try "help".
    (gdb) r -m test -w -uall,-largefile test_sqlite
    Starting program: /Volumes/cache/py/3x/unix/source/python -m test -w -uall,-largefile test_sqlite
    Reading symbols for shared libraries +++..... done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries ... done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries .. done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries .. done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    [1/1] test_sqlite
    Reading symbols for shared libraries .. done
    Reading symbols for shared libraries . done
    Assertion failed: (!PyErr_Occurred()), function PyEval_EvalFrameEx, file Python/ceval.c, line 1210.

    Program received signal SIGABRT, Aborted.
    0x918089f0 in __kill ()
    (gdb) where
    #0 0x918089f0 in __kill ()
    #1 0x918a3bfc in abort ()
    #2 0x91896c0c in __assert_rtn ()
    #3 0x001bb630 in PyEval_EvalFrameEx (f=0x15e04d0, throwflag=0) at Python/ceval.c:1210
    #4 0x001cda1c in PyEval_EvalCodeEx (_co=0x1528df8, globals=0x14fe778, locals=0x0, args=0x12b9cf4, argcount=5, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #5 0x0006a07c in function_call (func=0x152fa58, arg=0x12b9ce0, kw=0x0) at Objects/funcobject.c:633
    #6 0x00012918 in PyObject_Call (func=0x152fa58, arg=0x12b9ce0, kw=0x0) at Objects/abstract.c:2105
    #7 0x00012b74 in call_function_tail (callable=0x152fa58, args=0x12b9ce0) at Objects/abstract.c:2142
    #8 0x00012cc8 in PyObject_CallFunction (callable=0x152fa58, format=0x14eaa88 "issss") at Objects/abstract.c:2166
    #9 0x014deaac in _authorizer_callback (user_arg=0x152fa58, action=20, arg1=0x5a2910 "t2", arg2=0x5a21b0 "c2", dbname=0x94145940 "main", access_attempt_source=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:886
    #10 0x940e6a60 in lookupName ()
    #11 0x9412a2f0 in nameResolverStep ()
    #12 0x940c62a8 in walkExprTree ()
    #13 0x94129e40 in sqlite3SelectResolve ()
    #14 0x9410c2f4 in sqlite3Select ()
    #15 0x9411d848 in yy_reduce ()
    #16 0x941213a4 in sqlite3Parser ()
    #17 0x94121928 in sqlite3RunParser ()
    #18 0x94123364 in sqlite3Prepare ()
    #19 0x014e7c94 in pysqlite_statement_create (self=0x15e3290, connection=0x15dc7a8, sql=0x1529388) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/statement.c:73
    #20 0x014dfaf4 in pysqlite_connection_call (self=0x15dc7a8, args=0x15e3150, kwargs=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:1231
    #21 0x00012918 in PyObject_Call (func=0x15dc7a8, arg=0x15e3150, kw=0x0) at Objects/abstract.c:2105
    #22 0x00012b74 in call_function_tail (callable=0x15dc7a8, args=0x15e3150) at Objects/abstract.c:2142
    #23 0x00012cc8 in PyObject_CallFunction (callable=0x15dc7a8, format=0x14ea730 "O") at Objects/abstract.c:2166
    #24 0x014db6d8 in pysqlite_cache_get (self=0x15e3178, args=0x15e3150) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cache.c:184
    #25 0x014e38a0 in _pysqlite_query_execute (self=0x15cd080, multiple=0, args=0x15e3380) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cursor.c:541
    #26 0x014e47d4 in pysqlite_cursor_execute (self=0x15cd080, args=0x15e3380) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cursor.c:752
    #27 0x000a3c00 in PyCFunction_Call (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Objects/methodobject.c:93
    #28 0x00012918 in PyObject_Call (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Objects/abstract.c:2105
    #29 0x001d0110 in PyEval_CallObjectWithKeywords (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Python/ceval.c:4089
    #30 0x0001284c in PyObject_CallObject (o=0x1502eb8, a=0x15e3380) at Objects/abstract.c:2093
    #31 0x014dff64 in pysqlite_connection_execute (self=0x15dc7a8, args=0x15e3380, kwargs=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:1281
    #32 0x000a3c00 in PyCFunction_Call (func=0x1502f78, arg=0x15e3380, kw=0x0) at Objects/methodobject.c:93
    #33 0x001d0bfc in call_function (pp_stack=0xbffefb70, oparg=1) at Python/ceval.c:4213
    #34 0x001c8954 in PyEval_EvalFrameEx (f=0x15e1038, throwflag=0) at Python/ceval.c:2818
    #35 0x001d12fc in fast_function (func=0x152f8d8, pp_stack=0xbfff04f0, n=1, na=1, nk=0) at Python/ceval.c:4310
    #36 0x001d0e44 in call_function (pp_stack=0xbfff04f0, oparg=0) at Python/ceval.c:4238
    #37 0x001c8954 in PyEval_EvalFrameEx (f=0x944220, throwflag=0) at Python/ceval.c:2818
    #38 0x001cda1c in PyEval_EvalCodeEx (_co=0x11e2e60, globals=0x11d50f8, locals=0x0, args=0x158558c, argcount=2, kws=0x42804c, kwcount=0, defs=0x121cb04, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #39 0x0006a07c in function_call (func=0x1223098, arg=0x1585578, kw=0x1585538) at Objects/funcobject.c:633
    #40 0x00012918 in PyObject_Call (func=0x1223098, arg=0x1585578, kw=0x1585538) at Objects/abstract.c:2105
    #41 0x001d2668 in ext_do_call (func=0x1223098, pp_stack=0xbfff0fe4, flags=3, na=1, nk=0) at Python/ceval.c:4537
    #42 0x001c8d94 in PyEval_EvalFrameEx (f=0x158a038, throwflag=0) at Python/ceval.c:2858
    #43 0x001cda1c in PyEval_EvalCodeEx (_co=0x11e2f30, globals=0x11d50f8, locals=0x0, args=0x158550c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #44 0x0006a07c in function_call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/funcobject.c:633
    #45 0x00012918 in PyObject_Call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/abstract.c:2105
    #46 0x0003dec0 in method_call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/classobject.c:323
    #47 0x00012918 in PyObject_Call (func=0x11d8f78, arg=0x1589188, kw=0x0) at Objects/abstract.c:2105
    #48 0x000e3c68 in slot_tp_call (self=0x157dcb0, args=0x1589188, kwds=0x0) at Objects/typeobject.c:5360
    #49 0x00012918 in PyObject_Call (func=0x157dcb0, arg=0x1589188, kw=0x0) at Objects/abstract.c:2105
    #50 0x001d1ed4 in do_call (func=0x157dcb0, pp_stack=0xbfff1d20, na=1, nk=0) at Python/ceval.c:4442
    #51 0x001d0e64 in call_function (pp_stack=0xbfff1d20, oparg=1) at Python/ceval.c:4240
    #52 0x001c8954 in PyEval_EvalFrameEx (f=0x15884e8, throwflag=0) at Python/ceval.c:2818
    #53 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x15854cc, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #54 0x0006a07c in function_call (func=0x122d0f8, arg=0x15854b8, kw=0x1585478) at Objects/funcobject.c:633
    #55 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x15854b8, kw=0x1585478) at Objects/abstract.c:2105
    #56 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff2814, flags=3, na=1, nk=0) at Python/ceval.c:4537
    #57 0x001c8d94 in PyEval_EvalFrameEx (f=0x1493ab8, throwflag=0) at Python/ceval.c:2858
    #58 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x156ff0c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #59 0x0006a07c in function_call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/funcobject.c:633
    #60 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/abstract.c:2105
    #61 0x0003dec0 in method_call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/classobject.c:323
    #62 0x00012918 in PyObject_Call (func=0x1142a78, arg=0x15890e0, kw=0x0) at Objects/abstract.c:2105
    #63 0x000e3c68 in slot_tp_call (self=0x157dc40, args=0x15890e0, kwds=0x0) at Objects/typeobject.c:5360
    #64 0x00012918 in PyObject_Call (func=0x157dc40, arg=0x15890e0, kw=0x0) at Objects/abstract.c:2105
    #65 0x001d1ed4 in do_call (func=0x157dc40, pp_stack=0xbfff3550, na=1, nk=0) at Python/ceval.c:4442
    #66 0x001d0e64 in call_function (pp_stack=0xbfff3550, oparg=1) at Python/ceval.c:4240
    #67 0x001c8954 in PyEval_EvalFrameEx (f=0x1588358, throwflag=0) at Python/ceval.c:2818
    #68 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x156fe8c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #69 0x0006a07c in function_call (func=0x122d0f8, arg=0x156fe78, kw=0x1585438) at Objects/funcobject.c:633
    #70 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x156fe78, kw=0x1585438) at Objects/abstract.c:2105
    #71 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff4044, flags=3, na=1, nk=0) at Python/ceval.c:4537
    #72 0x001c8d94 in PyEval_EvalFrameEx (f=0x14937b8, throwflag=0) at Python/ceval.c:2858
    #73 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x156fe4c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #74 0x0006a07c in function_call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/funcobject.c:633
    #75 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/abstract.c:2105
    #76 0x0003dec0 in method_call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/classobject.c:323
    #77 0x00012918 in PyObject_Call (func=0x12150b8, arg=0x1589038, kw=0x0) at Objects/abstract.c:2105
    #78 0x000e3c68 in slot_tp_call (self=0x1485540, args=0x1589038, kwds=0x0) at Objects/typeobject.c:5360
    #79 0x00012918 in PyObject_Call (func=0x1485540, arg=0x1589038, kw=0x0) at Objects/abstract.c:2105
    #80 0x001d1ed4 in do_call (func=0x1485540, pp_stack=0xbfff4d80, na=1, nk=0) at Python/ceval.c:4442
    #81 0x001d0e64 in call_function (pp_stack=0xbfff4d80, oparg=1) at Python/ceval.c:4240
    #82 0x001c8954 in PyEval_EvalFrameEx (f=0x15881c8, throwflag=0) at Python/ceval.c:2818
    #83 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x156f70c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #84 0x0006a07c in function_call (func=0x122d0f8, arg=0x156f6f8, kw=0x15853f8) at Objects/funcobject.c:633
    #85 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x156f6f8, kw=0x15853f8) at Objects/abstract.c:2105
    #86 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff5874, flags=3, na=1, nk=0) at Python/ceval.c:4537
    #87 0x001c8d94 in PyEval_EvalFrameEx (f=0x14931b8, throwflag=0) at Python/ceval.c:2858
    #88 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x12f7dcc, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #89 0x0006a07c in function_call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/funcobject.c:633
    #90 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/abstract.c:2105
    #91 0x0003dec0 in method_call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/classobject.c:323
    #92 0x00012918 in PyObject_Call (func=0x1480878, arg=0x1575460, kw=0x0) at Objects/abstract.c:2105
    #93 0x000e3c68 in slot_tp_call (self=0x1581f18, args=0x1575460, kwds=0x0) at Objects/typeobject.c:5360
    #94 0x00012918 in PyObject_Call (func=0x1581f18, arg=0x1575460, kw=0x0) at Objects/abstract.c:2105
    #95 0x001d1ed4 in do_call (func=0x1581f18, pp_stack=0xbfff65b0, na=1, nk=0) at Python/ceval.c:4442
    #96 0x001d0e64 in call_function (pp_stack=0xbfff65b0, oparg=1) at Python/ceval.c:4240
    #97 0x001c8954 in PyEval_EvalFrameEx (f=0x1588038, throwflag=0) at Python/ceval.c:2818
    #98 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x12c440c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #99 0x0006a07c in function_call (func=0x122d0f8, arg=0x12c43f8, kw=0x15853b8) at Objects/funcobject.c:633
    #100 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x12c43f8, kw=0x15853b8) at Objects/abstract.c:2105
    #101 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff70a4, flags=3, na=1, nk=0) at Python/ceval.c:4537
    #102 0x001c8d94 in PyEval_EvalFrameEx (f=0x1493938, throwflag=0) at Python/ceval.c:2858
    #103 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x136124c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #104 0x0006a07c in function_call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/funcobject.c:633
    #105 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/abstract.c:2105
    #106 0x0003dec0 in method_call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/classobject.c:323
    #107 0x00012918 in PyObject_Call (func=0x1215078, arg=0x12c11f8, kw=0x0) at Objects/abstract.c:2105
    #108 0x000e3c68 in slot_tp_call (self=0x147da10, args=0x12c11f8, kwds=0x0) at Objects/typeobject.c:5360
    #109 0x00012918 in PyObject_Call (func=0x147da10, arg=0x12c11f8, kw=0x0) at Objects/abstract.c:2105
    #110 0x001d1ed4 in do_call (func=0x147da10, pp_stack=0xbfff7de0, na=1, nk=0) at Python/ceval.c:4442
    #111 0x001d0e64 in call_function (pp_stack=0xbfff7de0, oparg=1) at Python/ceval.c:4240
    #112 0x001c8954 in PyEval_EvalFrameEx (f=0x1484c78, throwflag=0) at Python/ceval.c:2818
    #113 0x001d12fc in fast_function (func=0x14795d8, pp_stack=0xbfff8760, n=2, na=2, nk=0) at Python/ceval.c:4310
    #114 0x001d0e44 in call_function (pp_stack=0xbfff8760, oparg=1) at Python/ceval.c:4238
    #115 0x001c8954 in PyEval_EvalFrameEx (f=0x126ce48, throwflag=0) at Python/ceval.c:2818
    #116 0x001d12fc in fast_function (func=0x1479938, pp_stack=0xbfff90e0, n=1, na=1, nk=0) at Python/ceval.c:4310
    #117 0x001d0e44 in call_function (pp_stack=0xbfff90e0, oparg=1) at Python/ceval.c:4238
    #118 0x001c8954 in PyEval_EvalFrameEx (f=0x126cb28, throwflag=0) at Python/ceval.c:2818
    #119 0x001cda1c in PyEval_EvalCodeEx (_co=0x12f1f98, globals=0x129ccf8, locals=0x0, args=0x15862f0, argcount=1, kws=0x15862f4, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #120 0x001d1440 in fast_function (func=0x1479998, pp_stack=0xbfff9b90, n=1, na=1, nk=0) at Python/ceval.c:4320
    #121 0x001d0e44 in call_function (pp_stack=0xbfff9b90, oparg=1) at Python/ceval.c:4238
    #122 0x001c8954 in PyEval_EvalFrameEx (f=0x15861a8, throwflag=0) at Python/ceval.c:2818
    #123 0x001cda1c in PyEval_EvalCodeEx (_co=0x7d9438, globals=0x101e6f8, locals=0x0, args=0x102bb6c, argcount=0, kws=0x102bb6c, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x100a6c8) at Python/ceval.c:3567
    #124 0x001d1440 in fast_function (func=0x1331f98, pp_stack=0xbfffa640, n=0, na=0, nk=0) at Python/ceval.c:4320
    #125 0x001d0e44 in call_function (pp_stack=0xbfffa640, oparg=0) at Python/ceval.c:4238
    #126 0x001c8954 in PyEval_EvalFrameEx (f=0x102b9e8, throwflag=0) at Python/ceval.c:2818
    #127 0x001cda1c in PyEval_EvalCodeEx (_co=0x7d94a0, globals=0x101e6f8, locals=0x0, args=0x662f84, argcount=5, kws=0x662f98, kwcount=1, defs=0x1278c0c, defcount=3, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #128 0x001d1440 in fast_function (func=0x147b5d8, pp_stack=0xbfffb0f0, n=7, na=5, nk=1) at Python/ceval.c:4320
    #129 0x001d0e44 in call_function (pp_stack=0xbfffb0f0, oparg=261) at Python/ceval.c:4238
    #130 0x001c8954 in PyEval_EvalFrameEx (f=0x662e00, throwflag=0) at Python/ceval.c:2818
    #131 0x001cda1c in PyEval_EvalCodeEx (_co=0x10327e0, globals=0x101e6f8, locals=0x0, args=0x894af8, argcount=5, kws=0x894b0c, kwcount=4, defs=0x12ae6dc, defcount=7, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #132 0x001d1440 in fast_function (func=0x147b578, pp_stack=0xbfffbba0, n=13, na=5, nk=4) at Python/ceval.c:4320
    #133 0x001d0e44 in call_function (pp_stack=0xbfffbba0, oparg=1029) at Python/ceval.c:4238
    #134 0x001c8954 in PyEval_EvalFrameEx (f=0x894820, throwflag=0) at Python/ceval.c:2818
    #135 0x001cda1c in PyEval_EvalCodeEx (_co=0x10323d0, globals=0x101e6f8, locals=0x0, args=0x4ba504, argcount=0, kws=0x4ba504, kwcount=0, defs=0x1314afc, defcount=23, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #136 0x001d1440 in fast_function (func=0x12c00f8, pp_stack=0xbfffc650, n=0, na=0, nk=0) at Python/ceval.c:4320
    #137 0x001d0e44 in call_function (pp_stack=0xbfffc650, oparg=0) at Python/ceval.c:4238
    #138 0x001c8954 in PyEval_EvalFrameEx (f=0x4ba3b8, throwflag=0) at Python/ceval.c:2818
    #139 0x001d12fc in fast_function (func=0x1331cf8, pp_stack=0xbfffcfd0, n=0, na=0, nk=0) at Python/ceval.c:4310
    #140 0x001d0e44 in call_function (pp_stack=0xbfffcfd0, oparg=0) at Python/ceval.c:4238
    #141 0x001c8954 in PyEval_EvalFrameEx (f=0x63a1c8, throwflag=0) at Python/ceval.c:2818
    #142 0x001cda1c in PyEval_EvalCodeEx (_co=0x1013298, globals=0x49fb38, locals=0x49fb38, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #143 0x001bb274 in PyEval_EvalCode (co=0x1013298, globals=0x49fb38, locals=0x49fb38) at Python/ceval.c:770
    #144 0x001b2d84 in builtin_exec (self=0x454178, args=0x78c978) at Python/bltinmodule.c:859
    #145 0x000a3c00 in PyCFunction_Call (func=0x4546f8, arg=0x78c978, kw=0x0) at Objects/methodobject.c:93
    #146 0x001d0bfc in call_function (pp_stack=0xbfffdb40, oparg=2) at Python/ceval.c:4213
    #147 0x001c8954 in PyEval_EvalFrameEx (f=0x6f4418, throwflag=0) at Python/ceval.c:2818
    #148 0x001cda1c in PyEval_EvalCodeEx (_co=0x100e090, globals=0x7bfb38, locals=0x0, args=0x10381a4, argcount=7, kws=0x10381c0, kwcount=0, defs=0x101016c, defcount=5, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #149 0x001d1440 in fast_function (func=0x100b278, pp_stack=0xbfffe5f0, n=7, na=7, nk=0) at Python/ceval.c:4320
    #150 0x001d0e44 in call_function (pp_stack=0xbfffe5f0, oparg=7) at Python/ceval.c:4238
    #151 0x001c8954 in PyEval_EvalFrameEx (f=0x1038038, throwflag=0) at Python/ceval.c:2818
    #152 0x001cda1c in PyEval_EvalCodeEx (_co=0x100e298, globals=0x7bfb38, locals=0x0, args=0x49f90c, argcount=2, kws=0x0, kwcount=0, defs=0x100aef4, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567
    #153 0x0006a07c in function_call (func=0x1036578, arg=0x49f8f8, kw=0x0) at Objects/funcobject.c:633
    #154 0x00012918 in PyObject_Call (func=0x1036578, arg=0x49f8f8, kw=0x0) at Objects/abstract.c:2105
    #155 0x0024529c in RunModule (modname=0x501b28, set_argv0=1) at Modules/main.c:224
    #156 0x00246b24 in Py_Main (argc=6, argv=0x501638) at Modules/main.c:714
    #157 0x00001fd0 in main (argc=6, argv=0xbfffeb38) at python.c:64
    (gdb)

    @ned-deily ned-deily added the type-crash A hard crash of the interpreter, possibly with a core dump label Jul 21, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2013

    New changeset 026593cbc006 by Victor Stinner in branch 'default':
    Issue bpo-18519, bpo-18408: Fix sqlite authorizer callback
    http://hg.python.org/cpython/rev/026593cbc006

    @vstinner
    Copy link
    Member

    It's not a crash, but an assertion that I added recently: it means that a previous Python exception is not handled correctly.

    The problem is that a first call to _authorizer_callback() raised a Python exception and returned SQLITE_DENY, but sqlite called _authorizer_callback() again (with the Python exception set).

    According to the doc: "SQLITE_DENY to cause the entire SQL statement to be rejected with an error":
    http://www.sqlite.org/c3ref/set_authorizer.html

    So I don't expect _authorizer_callback() to be called again if the previous call returned SQLITE_DENY. Whatever, this issue should be fixed by the changeset 026593cbc006.

    @bitdancer
    Copy link
    Member

    Do you understand why it was called again with the exception set? I'm worried that there might be a change in behavior here that the tests aren't catching.

    @vstinner
    Copy link
    Member

    Before my change, the authorizer callback was called even if an exception
    was raised. This is wrong, it is not how python works.

    You can try with python 3.3 and an authorizer raising an exception and then
    increment an attribute. If I understood correctly, the attribute will be
    incremented but you will get the exception in the caller.

    @bitdancer
    Copy link
    Member

    Raised by what? I thought the callback *was* the thing raising the
    exception? Are you sure you don't just need to clear the exception
    if the callback function raises one?

    @vstinner
    Copy link
    Member

    Raised by what?

    The test raising the assertion error is a Python authorizer callback which returns a Python int (2**32) larger than a C int (> INT_MAX) and so an OverflowError is raised in the C authorizer callback.

    Are you sure you don't just need to clear the exception
    if the callback function raises one?

    I read the code one more time, and I saw this:

                if (_enable_callback_tracebacks) {
                    PyErr_Print();
                } else {
                    PyErr_Clear();
                }

    So it is expected that the C authorizer callback clears the error.

    Here is a new patch which implement the same behaviour on _PyLong_AsInt() failure.

    @vstinner vstinner reopened this Jul 22, 2013
    @bitdancer
    Copy link
    Member

    OK, this makes much more sense to me now :)

    I take it the overflow error is the only one the C code could ever raise? If so, the patch looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 26, 2013

    New changeset f7a0a4e0ada4 by Victor Stinner in branch 'default':
    Issue bpo-18519: the Python authorizer callback of sqlite3 must not raise Python exceptions
    http://hg.python.org/cpython/rev/f7a0a4e0ada4

    @vstinner
    Copy link
    Member

    I take it the overflow error is the only one the C code
    could ever raise? If so, the patch looks good to me.

    Yes, _PyLong_AsInt() was the last function raising Python exception (without clearing it).

    Thanks for your help on fixing this function

    @ned-deily
    Copy link
    Member Author

    The changes for this issue appear to have changed the behavior of test_sqlite. Prior to 5643e873f06e on OS X 10.4 Tiger with the system libsqlite (3.1.3), all test cases of test_sqlite pass. As of current tip on the same platform, there are now two failures in test_sqlite:

    $ ./python -m test -v test_sqlite
    == CPython 3.4.0a0 (default:c7d9a2159c6c, Jul 30 2013, 14:20:52) [GCC 4.0.1 (Apple Computer, Inc. build 5370)]
    ==   Darwin-8.11.0-Power_Macintosh-powerpc-32bit big-endian
    ==   /Volumes/cache/py/main4/3x/unix/source/build/test_python_4328
    Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
    [1/1] test_sqlite
    test_sqlite: testing with version '2.6.0', sqlite_version '3.1.3'
    [...]

    ======================================================================
    FAIL: CheckAggrExceptionInFinalize (sqlite3.test.userfunctions.AggregateTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Volumes/cache/py/main4/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 336, in CheckAggrExceptionInFinalize
        self.fail("should have raised an OperationalError")
    AssertionError: should have raised an OperationalError

    ======================================================================
    FAIL: CheckAggrNoFinalize (sqlite3.test.userfunctions.AggregateTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Volumes/cache/py/main4/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 309, in CheckAggrNoFinalize
        self.fail("should have raised an OperationalError")
    AssertionError: should have raised an OperationalError

    Ran 232 tests in 2.988s

    FAILED (failures=2, skipped=1)
    test test_sqlite failed

    @ned-deily ned-deily reopened this Jul 30, 2013
    @bitdancer
    Copy link
    Member

    Heh, that's the kind of behavior change I was worried about :(.

    @vstinner
    Copy link
    Member

    vstinner commented Aug 1, 2013

    ned> The changes for this issue appear to have changed the behavior of test_sqlite.
    David> Heh, that's the kind of behavior change I was worried about :(

    I don't understand why the test is failing, nor why it is only failing on one specific buildbot. Does it mean that 5/0 does not raise an exception on this specific buildbot?

    I don't understand the relation between my changesets and this failure.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 1, 2013

    New changeset c73f4dced6aa by Victor Stinner in branch 'default':
    Issue bpo-18519: Fix test_sqlite on old versions of libsqlite3
    http://hg.python.org/cpython/rev/c73f4dced6aa

    @vstinner
    Copy link
    Member

    vstinner commented Aug 2, 2013

    I don't understand the relation between my changesets and this failure.

    Ok, I found the reason in the definition of the
    _sqlite3_result_error() function. This function behave differently on
    old sqlite versions: it raises a new exception. The issue should now
    be fixed, can you please try on your Tiger box?

    @ned-deily
    Copy link
    Member Author

    c73f4dced6aa appears to fix the problem on 10.4 Tiger. Thanks!

    @vstinner
    Copy link
    Member

    vstinner commented Aug 2, 2013

    There is no more known bug, i'm closing this issue.

    @vstinner vstinner closed this as completed Aug 2, 2013
    @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-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants