openpaperwork / pyinsane

Python library to access and use image scanners (Linux/Windows/etc) (Sane/WIA) -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/pyinsane
63 stars 24 forks source link

Segfault when running tests #24

Closed fmitha closed 7 years ago

fmitha commented 8 years ago
git clone https://github.com/plietar/pyinsane pyinsanetest
cd pyinsanetest
git rev-parse HEAD
75f49f316d20b588610441239bb9fc4c64411e25
gdb --args python ./run_tests.py
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...Reading symbols from /usr/lib/debug//usr/bin/python2.7...done.
done.
(gdb) r
Starting program: /usr/bin/python ./run_tests.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff596c700 (LWP 11939)]
=== RawAPI: ===
test_init (tests.tests_rawapi.TestSaneInit) ... ok
test_get_devices (tests.tests_rawapi.TestSaneGetDevices) ... [New Thread 0x7fffeffff700 (LWP 11940)]
[New Thread 0x7fffe59bb700 (LWP 11941)]
ok
test_open_invalid (tests.tests_rawapi.TestSaneOpen) ... ok
test_open_valid (tests.tests_rawapi.TestSaneOpen) ... ok
test_get_option_descriptor_0 (tests.tests_rawapi.TestSaneGetOptionDescriptor) ... FAIL
test_get_option_descriptor_out_of_bounds (tests.tests_rawapi.TestSaneGetOptionDescriptor) ... ok
test_get_option_value (tests.tests_rawapi.TestSaneControlOption) ... ok
test_set_option_value (tests.tests_rawapi.TestSaneControlOption) ... 
Program received signal SIGSEGV, Segmentation fault.
subtype_dealloc.lto_priv () at ../Objects/typeobject.c:1015
1015    ../Objects/typeobject.c: No such file or directory.
jflesch commented 8 years ago

Hm, you mentioned you do all your builds in a VM ? Can you tell me exactly what kind of VM (arch, VM type, linux distrib (sid, testing, etc)) please ? It would allow me to reproduce the issue, making it much easier to debug.

fmitha commented 8 years ago

No, this is not in a VM. And where did I mention a VM? It's in my regular machine, which is Debian jessie 8.3. It's just a regular AMD64 machine. I can give you the hardware specs if that is relevant.

jflesch commented 8 years ago

My bad, I mixed up things with a comment from @piletar (your avatar are both green on my side ... :)

jflesch commented 8 years ago

By the way, I don't see the stacktrace (command 'bt') in the output ? Am I missing something ?

fmitha commented 8 years ago

By the way, I don't see the stacktrace (command 'bt') in the output ? Am I missing something ?

My bad.

gdb --args python ./run_tests.py
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...Reading symbols from /usr/lib/debug//usr/bin/python2.7...done.
done.
(gdb) r
Starting program: /usr/bin/python ./run_tests.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff59ac700 (LWP 10421)]
=== RawAPI: ===
test_init (tests.tests_rawapi.TestSaneInit) ... ok
test_get_devices (tests.tests_rawapi.TestSaneGetDevices) ... [New Thread 0x7fffeffff700 (LWP 10422)]
[New Thread 0x7fffe59bb700 (LWP 10423)]
ok
test_open_invalid (tests.tests_rawapi.TestSaneOpen) ... ok
test_open_valid (tests.tests_rawapi.TestSaneOpen) ... ok
test_get_option_descriptor_0 (tests.tests_rawapi.TestSaneGetOptionDescriptor) ... FAIL
test_get_option_descriptor_out_of_bounds (tests.tests_rawapi.TestSaneGetOptionDescriptor) ... ok
test_get_option_value (tests.tests_rawapi.TestSaneControlOption) ... ok
test_set_option_value (tests.tests_rawapi.TestSaneControlOption) ... 
Program received signal SIGSEGV, Segmentation fault.
subtype_dealloc.lto_priv () at ../Objects/typeobject.c:1015
1015    ../Objects/typeobject.c: No such file or directory.
(gdb) bt
#0  subtype_dealloc.lto_priv () at ../Objects/typeobject.c:1015
#1  0x00000000004dd330 in frame_dealloc.lto_priv () at ../Objects/frameobject.c:460
#2  0x00000000004ca5ae in fast_function (nk=<optimized out>, na=<optimized out>, n=<optimized out>, pp_stack=<optimized out>, func=<optimized out>)
    at ../Python/ceval.c:4121
#3  call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4054
#4  PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#5  0x00000000004ca592 in fast_function (nk=<optimized out>, na=<optimized out>, n=<optimized out>, pp_stack=<optimized out>, func=<optimized out>)
    at ../Python/ceval.c:4119
#6  call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4054
#7  PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#8  0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
    at ../Python/ceval.c:3265
#9  function_call.lto_priv () at ../Objects/funcobject.c:526
#10 0x00000000004cc36b in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#11 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4346
#12 PyEval_EvalFrameEx () at ../Python/ceval.c:2718
#13 0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
    at ../Python/ceval.c:3265
#14 function_call.lto_priv () at ../Objects/funcobject.c:526
#15 0x00000000005045d8 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#16 instancemethod_call.lto_priv () at ../Objects/classobject.c:2602
#17 0x000000000057058c in PyObject_Call (kw=0x0, 
    arg=(<TextTestResult(_original_stdout=<file at remote 0x7ffff7f97150>, dots=False, skipped=[], _mirrorOutput=False, stream=<_WritelnDecorator(stream=<file at remote 0x7ffff7f971e0>) at remote 0x7ffff5aa0ad0>, testsRun=8, buffer=False, _original_stderr=<file at remote 0x7ffff7f971e0>, showAll=True, _stdout_buffer=None, _stderr_buffer=None, _moduleSetUpFailed=False, expectedFailures=[], errors=[], descriptions=True, _previousTestClass=<type at remote 0xa69d30>, unexpectedSuccesses=[], failures=[(<TestSaneGetOptionDescriptor(dev_handle=<c_void_p at remote 0x7ffff66368c0>, _testMethodName='test_get_option_descriptor_0', _resultForDoCleanups=<...>, _cleanups=[], _type_equality_funcs={<type at remote 0x93b080>: 'assertSetEqual', <type at remote 0x93a0c0>: 'assertSetEqual', <type at remote 0x93aec0>: 'assertMultiLineEqual', <type at remote 0x93c900>: 'assertDictEqual', <type at remote 0x93c740>: 'assertTupleEqual', <type at remote 0x93d340>: 'assertListEqual'}, _testMethodDoc=None) at remote 0x7ffff5aa0d10>, 'Traceback ...(truncated), 
    func=<instancemethod at remote 0x7ffff6ce9230>) at ../Objects/abstract.c:2529
#18 slot_tp_call.lto_priv () at ../Objects/typeobject.c:5432
#19 0x00000000004caaa1 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#20 do_call (nk=<optimized out>, na=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4251
#21 call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4056
#22 PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#23 0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at ../Python/ceval.c:3265
#24 function_call.lto_priv () at ../Objects/funcobject.c:526
#25 0x00000000004cc36b in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#26 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4346
#27 PyEval_EvalFrameEx () at ../Python/ceval.c:2718
#28 0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
    at ../Python/ceval.c:3265
#29 function_call.lto_priv () at ../Objects/funcobject.c:526
#30 0x00000000005045d8 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#31 instancemethod_call.lto_priv () at ../Objects/classobject.c:2602
#32 0x000000000057058c in PyObject_Call (kw=0x0, 
    arg=(<TextTestResult(_original_stdout=<file at remote 0x7ffff7f97150>, dots=False, skipped=[], _mirrorOutput=False, stream=<_WritelnDecorator(stream=<file at remote 0x7ffff7f971e0>) at remote 0x7ffff5aa0ad0>, testsRun=8, buffer=False, _original_stderr=<file at remote 0x7ffff7f971e0>, showAll=True, _stdout_buffer=None, _stderr_buffer=None, _moduleSetUpFailed=False, expectedFailures=[], errors=[], descriptions=True, _previousTestClass=<type at remote 0xa69d30>, unexpectedSuccesses=[], failures=[(<TestSaneGetOptionDescriptor(dev_handle=<c_void_p at remote 0x7ffff66368c0>, _testMethodName='test_get_option_descriptor_0', _resultForDoCleanups=<...>, _cleanups=[], _type_equality_funcs={<type at remote 0x93b080>: 'assertSetEqual', <type at remote 0x93a0c0>: 'assertSetEqual', <type at remote 0x93aec0>: 'assertMultiLineEqual', <type at remote 0x93c900>: 'assertDictEqual', <type at remote 0x93c740>: 'assertTupleEqual', <type at remote 0x93d340>: 'assertListEqual'}, _testMethodDoc=None) at remote 0x7ffff5aa0d10>, 'Traceback ...(truncated), 
    func=<instancemethod at remote 0x7ffff6ce91e0>) at ../Objects/abstract.c:2529
#33 slot_tp_call.lto_priv () at ../Objects/typeobject.c:5432
#34 0x00000000004caaa1 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#35 do_call (nk=<optimized out>, na=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4251
#36 call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4056
#37 PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#38 0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
    at ../Python/ceval.c:3265
#39 function_call.lto_priv () at ../Objects/funcobject.c:526
#40 0x00000000004cc36b in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#41 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4346
#42 PyEval_EvalFrameEx () at ../Python/ceval.c:2718
#43 0x00000000004e5fe8 in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=<optimized out>, kwcount=<optimized out>, 
    kws=<optimized out>, argcount=<optimized out>, args=<optimized out>, locals=<optimized out>, globals=<optimized out>, co=<optimized out>)
    at ../Python/ceval.c:3265
#44 function_call.lto_priv () at ../Objects/funcobject.c:526
#45 0x00000000005045d8 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#46 instancemethod_call.lto_priv () at ../Objects/classobject.c:2602
#47 0x000000000057058c in PyObject_Call (kw=0x0, 
---Type <return> to continue, or q <return> to quit---
    arg=(<TextTestResult(_original_stdout=<file at remote 0x7ffff7f97150>, dots=False, skipped=[], _mirrorOutput=False, stream=<_WritelnDecorator(stream=<file at remote 0x7ffff7f971e0>) at remote 0x7ffff5aa0ad0>, testsRun=8, buffer=False, _original_stderr=<file at remote 0x7ffff7f971e0>, showAll=True, _stdout_buffer=None, _stderr_buffer=None, _moduleSetUpFailed=False, expectedFailures=[], errors=[], descriptions=True, _previousTestClass=<type at remote 0xa69d30>, unexpectedSuccesses=[], failures=[(<TestSaneGetOptionDescriptor(dev_handle=<c_void_p at remote 0x7ffff66368c0>, _testMethodName='test_get_option_descriptor_0', _resultForDoCleanups=<...>, _cleanups=[], _type_equality_funcs={<type at remote 0x93b080>: 'assertSetEqual', <type at remote 0x93a0c0>: 'assertSetEqual', <type at remote 0x93aec0>: 'assertMultiLineEqual', <type at remote 0x93c900>: 'assertDictEqual', <type at remote 0x93c740>: 'assertTupleEqual', <type at remote 0x93d340>: 'assertListEqual'}, _testMethodDoc=None) at remote 0x7ffff5aa0d10>, 'Traceback ...(truncated), 
    func=<instancemethod at remote 0x7ffff7ee4280>) at ../Objects/abstract.c:2529
#48 slot_tp_call.lto_priv () at ../Objects/typeobject.c:5432
#49 0x00000000004caaa1 in PyObject_Call (kw=<optimized out>, arg=<optimized out>, func=<optimized out>) at ../Objects/abstract.c:2529
#50 do_call (nk=<optimized out>, na=<optimized out>, pp_stack=<optimized out>, func=<optimized out>) at ../Python/ceval.c:4251
#51 call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4056
#52 PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#53 0x00000000004ca592 in fast_function (nk=<optimized out>, na=<optimized out>, n=<optimized out>, pp_stack=<optimized out>, func=<optimized out>)
    at ../Python/ceval.c:4119
#54 call_function (oparg=<optimized out>, pp_stack=<optimized out>) at ../Python/ceval.c:4054
#55 PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#56 0x00000000004c87a1 in PyEval_EvalCodeEx () at ../Python/ceval.c:3265
#57 0x00000000005030ef in PyEval_EvalCode (
    locals={'tests_abstract': <module at remote 0x7ffff6d1ca98>, 'tests_rawapi': <module at remote 0x7ffff6d13718>, 'test_set': ['rawapi', 'abstract', 'abstract_th'], '__builtins__': <module at remote 0x7ffff7f75b08>, '__file__': './run_tests.py', 'abstract': <module at remote 0x7ffff6cc4280>, '__package__': None, 'sys': <module at remote 0x7ffff7f75bb0>, '__name__': '__main__', 'unittest': <module at remote 0x7ffff7ea0ef8>, '__doc__': None, 'abstract_th': <module at remote 0x7ffff6632750>}, 
    globals={'tests_abstract': <module at remote 0x7ffff6d1ca98>, 'tests_rawapi': <module at remote 0x7ffff6d13718>, 'test_set': ['rawapi', 'abstract', 'abstract_th'], '__builtins__': <module at remote 0x7ffff7f75b08>, '__file__': './run_tests.py', 'abstract': <module at remote 0x7ffff6cc4280>, '__package__': None, 'sys': <module at remote 0x7ffff7f75bb0>, '__name__': '__main__', 'unittest': <module at remote 0x7ffff7ea0ef8>, '__doc__': None, 'abstract_th': <module at remote 0x7ffff6632750>}, co=0x7ffff7ee2a30) at ../Python/ceval.c:667
#58 run_mod.lto_priv () at ../Python/pythonrun.c:1371
#59 0x00000000004f8c72 in PyRun_FileExFlags () at ../Python/pythonrun.c:1357
#60 0x00000000004f7d77 in PyRun_SimpleFileExFlags () at ../Python/pythonrun.c:949
#61 0x00000000004982f2 in Py_Main () at ../Modules/main.c:640
#62 0x00007ffff6f12b45 in __libc_start_main (main=0x497d80 <main>, argc=2, argv=0x7fffffffdea8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffde98) at libc-start.c:287
#63 0x0000000000497ca0 in _start ()
jflesch commented 7 years ago

I'm sorry, I totally forgot about this ticket :( Anyway, there has been a lot of changes on Pyinsane (the API isn't even the same anymore). You may want to try with the latest version

jflesch commented 7 years ago

I'm closing this ticket. If you still have problems with the latest version of Pyinsane, please comment, and I'll reopen it.