-
Notifications
You must be signed in to change notification settings - Fork 38
validatesUniquenessOf triggers Segmentation Fault in a particular case #66
Comments
Thanks @Reve - do you have an example script that will demonstrate this? |
And this is called in a command. The script dies on save().
|
Thanks @Reve - can you post a full proof of issue (all the code necessary to duplicate)? It could just use SQLite locally and some initial command to create a table. |
I will try to see if I can isolate the issue and post a followup here. |
Now it's working after a few twisted restarts. I am not sure what caused it... Thank you very much for your time. |
No worries! Let me know if you run into any other issues. |
I think I finally isolated the issue. The error occurs if it's the first thing you invoke after the twisted server start. If I do a select from the DB before the save, it works. This is very strange and since it's deferred it's very hard to debug. I did find a solution to the problem by adding the code below before the save() function is called.
If this is the way you should validate things, I suggest that you add it to the documentation so future users will avoid this problem. Thank you again |
Thanks for debugging @Reve - I'll take a look. |
I found where the problem was. I was formating the Timestamp using the native Timestamp obtained by calling Registry.getDBAPIClass("Timestamp") and for some unknown reason it would throw a segmentation fault saying that it could not find Timestamp class/library. Strace output:
I was using psycopg2 version 2.0.14. I've updated to the latest 2.6.1 and the problem disappeared. I think it should be noted somewhere which should be the minimum requirements for the dependencies. Thank you very much once again. |
The seg fault is triggered when you try to validate the uniqueness of a random string ("xn--tan-test-20160307154100-6tc060eub.ro"). validatePresenceOf works well with the same string provided. By looking at the stack trace, I think the problem is related to the Inflector but I am not 100% sure.
I will attach the stack trace below:
Thank you
`(gdb) bt
#0 call_function (f=, throwflag=) at Python/ceval.c:3796
#1 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#2 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x1d18288, globals=, locals=, args=, argcount=1,
#3 0x0000003cda26ad9d in function_call (func=<function at remote 0x1d25848>, arg=
#4 0x0000003cda243c63 in PyObject_Call (func=<function at remote 0x1d25848>, arg=, kw=) at Objects/abstract.c:2492
#5 0x0000003cda2d4460 in ext_do_call (f=, throwflag=) at Python/ceval.c:4107
#6 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2493
#7 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7378, globals=, locals=, args=,
#8 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#9 call_function (f=, throwflag=) at Python/ceval.c:3815
#10 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#11 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x1d0d288, globals=, locals=, args=, argcount=1,
#12 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#13 call_function (f=, throwflag=) at Python/ceval.c:3815
#14 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#15 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x1d05c60, globals=, locals=, args=, argcount=1,
#16 0x0000003cda26ad9d in function_call (func=<function at remote 0x1d73320>, arg=(True,), kw={}) at Objects/funcobject.c:524
#17 0x0000003cda243c63 in PyObject_Call (func=<function at remote 0x1d73320>, arg=, kw=) at Objects/abstract.c:2492
#18 0x0000003cda2d4460 in ext_do_call (f=, throwflag=) at Python/ceval.c:4107
#19 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2493
#20 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7d50, globals=, locals=, args=,
#21 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#22 call_function (f=, throwflag=) at Python/ceval.c:3815
#23 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#24 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7c60, globals=, locals=, args=,
#25 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#26 call_function (f=, throwflag=) at Python/ceval.c:3815
#27 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#28 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7918, globals=, locals=, args=,
#29 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#30 call_function (f=, throwflag=) at Python/ceval.c:3815
#31 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#32 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f02583f0, globals=, locals=, args=,
#33 0x0000003cda26ad9d in function_call (func=<function at remote 0x7f01f0263410>, arg=
#34 0x0000003cda243c63 in PyObject_Call (func=<function at remote 0x7f01f0263410>, arg=, kw=) at Objects/abstract.c:2492
---Type to continue, or q to quit---
#35 0x0000003cda2d4460 in ext_do_call (f=, throwflag=) at Python/ceval.c:4107
#36 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2493
#37 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7d50, globals=, locals=, args=,
#38 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#39 call_function (f=, throwflag=) at Python/ceval.c:3815
#40 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#41 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7c60, globals=, locals=, args=,
#42 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#43 call_function (f=, throwflag=) at Python/ceval.c:3815
#44 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#45 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7918, globals=, locals=, args=,
#46 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#47 call_function (f=, throwflag=) at Python/ceval.c:3815
#48 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#49 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f02583f0, globals=, locals=, args=,
#50 0x0000003cda26ad9d in function_call (func=<function at remote 0x7f01f0263410>, arg=
#51 0x0000003cda243c63 in PyObject_Call (func=<function at remote 0x7f01f0263410>, arg=, kw=) at Objects/abstract.c:2492
#52 0x0000003cda2d4460 in ext_do_call (f=, throwflag=) at Python/ceval.c:4107
#53 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2493
#54 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7d50, globals=, locals=, args=,
#55 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#56 call_function (f=, throwflag=) at Python/ceval.c:3815
#57 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#58 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7c60, globals=, locals=, args=,
#59 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#60 call_function (f=, throwflag=) at Python/ceval.c:3815
#61 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#62 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f06e7918, globals=, locals=, args=,
#63 0x0000003cda26ad9d in function_call (func=<function at remote 0x7f01f0264c08>, arg=
#64 0x0000003cda243c63 in PyObject_Call (func=<function at remote 0x7f01f0264c08>, arg=, kw=) at Objects/abstract.c:2492
#65 0x0000003cda2d4460 in ext_do_call (f=, throwflag=) at Python/ceval.c:4107
#66 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2493
#67 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x16db7b0, globals=, locals=, args=, argcount=1,
#68 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#69 call_function (f=, throwflag=) at Python/ceval.c:3815
#70 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#71 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x16e0a80, globals=, locals=, args=, argcount=1,
#72 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
---Type to continue, or q to quit---
#73 call_function (f=, throwflag=) at Python/ceval.c:3815
#74 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#75 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x16e0990, globals=, locals=, args=, argcount=1,
#76 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#77 call_function (f=, throwflag=) at Python/ceval.c:3815
#78 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#79 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f273fcd8, globals=, locals=, args=,
#80 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#81 call_function (f=, throwflag=) at Python/ceval.c:3815
#82 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#83 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f2745030, globals=, locals=, args=,
#84 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#85 call_function (f=, throwflag=) at Python/ceval.c:3815
#86 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#87 0x0000003cda2d6b7f in fast_function (f=, throwflag=) at Python/ceval.c:3880
#88 call_function (f=, throwflag=) at Python/ceval.c:3815
#89 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#90 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f273ff30, globals=, locals=, args=,
#91 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#92 call_function (f=, throwflag=) at Python/ceval.c:3815
#93 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#94 0x0000003cda2d6b7f in fast_function (f=, throwflag=) at Python/ceval.c:3880
#95 call_function (f=, throwflag=) at Python/ceval.c:3815
#96 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#97 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f2745a08, globals=, locals=, args=,
#98 0x0000003cda2d5a94 in fast_function (f=, throwflag=) at Python/ceval.c:3890
#99 call_function (f=, throwflag=) at Python/ceval.c:3815
#100 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#101 0x0000003cda2d6b7f in fast_function (f=, throwflag=) at Python/ceval.c:3880
#102 call_function (f=, throwflag=) at Python/ceval.c:3815
#103 PyEval_EvalFrameEx (f=, throwflag=) at Python/ceval.c:2453
#104 0x0000003cda2d7647 in PyEval_EvalCodeEx (co=0x7f01f3e8a558, globals=, locals=, args=,
#105 0x0000003cda2d7722 in PyEval_EvalCode (co=, globals=, locals=) at Python/ceval.c:545
#106 0x0000003cda2f1b9c in run_mod (mod=, filename=, globals=
#107 0x0000003cda2f1c70 in PyRun_FileExFlags (fp=0x1097630, filename=0x7ffd72c495f3 "/usr/bin/twistd", start=, globals=
#108 0x0000003cda2f315c in PyRun_SimpleFileExFlags (fp=0x1097630, filename=0x7ffd72c495f3 "/usr/bin/twistd", closeit=1, flags=0x7ffd72c48520)
---Type to continue, or q to quit---
, argc=6, ubp_av=0x7ffd72c48648, init=, fini=,at Python/pythonrun.c:948
#109 0x0000003cda2ff892 in Py_Main (argc=, argv=) at Modules/main.c:618
#110 0x00000039cd21ed5d in __libc_start_main (main=0x400710
#111 0x0000000000400649 in _start ()`
The text was updated successfully, but these errors were encountered: