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

imshow segfaults #13

Closed
sdvillal opened this issue Apr 12, 2018 · 10 comments
Closed

imshow segfaults #13

sdvillal opened this issue Apr 12, 2018 · 10 comments
Assignees

Comments

@sdvillal
Copy link

Happens in 3.4 both upstream and loopbio package. I have not tried with old versions and it might well be a problem local to my machine. Damn it anyway.

import cv2
import numpy as np
cv2.imshow('image', np.zeros((256, 256, 3), dtype=np.uint8))
cv2.waitKey(0)
@sdvillal sdvillal self-assigned this Apr 12, 2018
@nzjrs
Copy link

nzjrs commented Apr 12, 2018 via email

@nzjrs
Copy link

nzjrs commented Apr 12, 2018

BTW, it certainly works in my machine with 3.3.0 (the last one in our channel IIRC)

Can you please at least add bview /path/to/some.mp4 to your smoketest? Its important that this environment is also functional for day-to-day use by me, working on bview/vision stuff

@sdvillal
Copy link
Author

I have the feeling and the hope that it is something particular to my system. It also segfaults with 3.3. Could you run the test with this minimal environment and confirm it works for you?

name: jpegs-benchmark-noturbo

channels:
  - conda-forge
  - defaults

dependencies:
  - conda-forge::python=3.6
  - conda-forge::opencv=3.4.1  # compiled against libjpeg 9

(you can switch to 3.3, it does not change anything to me)

@nzjrs
Copy link

nzjrs commented Apr 12, 2018 via email

@sdvillal
Copy link
Author

use 2.7 if you dislike it that much ;-) it also segfaults here

coredump bt

           PID: 28058 (python)
           UID: 1000 (santi)
           GID: 100 (users)
        Signal: 11 (SEGV)
     Timestamp: Thu 2018-04-12 14:46:31 CEST (5min ago)
  Command Line: python segtest.py
    Executable: /home/santi/miniconda/envs/jpegs-benchmark-noturbo/bin/python3.6
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (santi)
       Boot ID: c4520f861f4d4c5f83495dba07977918
    Machine ID: 2199614708f047619029525a0e6e0490
      Hostname: snowy
       Storage: /var/lib/systemd/coredump/core.python.1000.c4520f861f4d4c5f83495dba07977918.28058.1523537191000000.lz4
       Message: Process 28058 (python) of user 1000 dumped core.
                
                Stack trace of thread 28058:
                #0  0x0000000000037cd0 n/a (n/a)

GNU gdb (GDB) 8.1
Copyright (C) 2018 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-pc-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 /home/santi/miniconda/envs/jpegs-benchmark-noturbo/bin/python3.6...done.

warning: core file may not match specified executable file.
[New LWP 28058]
[New LWP 28059]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `python segtest.py'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000037cd0 in ?? ()
[Current thread is 1 (Thread 0x7fd430441740 (LWP 28058))]
(gdb) bt
#0  0x0000000000037cd0 in ?? ()
#1  0x00007fd43027847a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#2  0x00007fd430278586 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#3  0x00007fd43027ca5e in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#4  0x00007fd42ef2db64 in _dl_catch_error () from /usr/lib/libc.so.6
#5  0x00007fd43027c27a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#6  0x00007fd42f90ae86 in ?? () from /usr/lib/libdl.so.2
#7  0x00007fd42ef2db64 in _dl_catch_error () from /usr/lib/libc.so.6
#8  0x00007fd42f90b587 in ?? () from /usr/lib/libdl.so.2
#9  0x00007fd42f90af22 in dlopen () from /usr/lib/libdl.so.2
#10 0x00007fd41d8b4750 in ?? () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Core.so.5
#11 0x00007fd41d8ac8eb in QLibrary::load() () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Core.so.5
#12 0x00007fd41d8acdb8 in QLibrary::resolve(char const*) () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Core.so.5
#13 0x00007fd41d8af858 in QLibrary::resolve(QString const&, int, char const*) () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Core.so.5
#14 0x00007fd41e3d3a3f in ?? () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#15 0x00007fd41e3d05ba in ?? () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#16 0x00007fd41e35959d in QStyleFactory::create(QString const&) () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#17 0x00007fd41e2f16f4 in QApplication::style() () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#18 0x00007fd41e2f1955 in QApplicationPrivate::initialize() () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#19 0x00007fd41e2f19a4 in QApplicationPrivate::init() () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../.././libQt5Widgets.so.5
#20 0x00007fd42566bca8 in GuiReceiver::GuiReceiver() () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../../libopencv_highgui.so.3.3
#21 0x00007fd425679075 in cvShowImage () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../../libopencv_highgui.so.3.3
#22 0x00007fd4256636f3 in cv::imshow(cv::String const&, cv::_InputArray const&) () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/../../libopencv_highgui.so.3.3
#23 0x00007fd42e6d5a55 in pyopencv_cv_imshow(_object*, _object*, _object*) () from /home/santi/miniconda/envs/jpegs-benchmark-noturbo/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so
#24 0x00007fd42fdf807d in _PyCFunction_FastCallDict (func_obj=func_obj@entry=0x7fd40dc4ed80, args=args@entry=0x217c728, nargs=<optimized out>, kwargs=kwargs@entry=0x0) at Objects/methodobject.c:231
#25 0x00007fd42fdf8305 in _PyCFunction_FastCallKeywords (func=func@entry=0x7fd40dc4ed80, stack=stack@entry=0x217c728, nargs=<optimized out>, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:294
#26 0x00007fd42fe9141a in call_function (pp_stack=pp_stack@entry=0x7fff861f9240, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at Python/ceval.c:4824
#27 0x00007fd42fe95dc6 in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322
#28 0x00007fd42fe9101e in _PyEval_EvalCodeWithName (_co=_co@entry=0x7fd42ed70930, globals=globals@entry=0x7fd42edb12d0, locals=locals@entry=0x7fd42edb12d0, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, 
    closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0) at Python/ceval.c:4153
#29 0x00007fd42fe9164d in PyEval_EvalCodeEx (_co=_co@entry=0x7fd42ed70930, globals=globals@entry=0x7fd42edb12d0, locals=locals@entry=0x7fd42edb12d0, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0) at Python/ceval.c:4174
#30 0x00007fd42fe9169b in PyEval_EvalCode (co=co@entry=0x7fd42ed70930, globals=globals@entry=0x7fd42edb12d0, locals=locals@entry=0x7fd42edb12d0) at Python/ceval.c:730
#31 0x00007fd42fecd092 in run_mod (arena=0x7fd42edce198, flags=0x7fff861f9550, locals=0x7fd42edb12d0, globals=0x7fd42edb12d0, filename=0x7fd42eba22f0, mod=0x21d4c00) at Python/pythonrun.c:1025
#32 PyRun_FileExFlags (fp=fp@entry=0x21bd590, filename_str=filename_str@entry=0x7fd42ed19f50 "segtest.py", start=start@entry=257, globals=globals@entry=0x7fd42edb12d0, locals=locals@entry=0x7fd42edb12d0, closeit=closeit@entry=1, flags=flags@entry=0x7fff861f9550) at Python/pythonrun.c:978
#33 0x00007fd42fecd1f7 in PyRun_SimpleFileExFlags (fp=fp@entry=0x21bd590, filename=<optimized out>, closeit=closeit@entry=1, flags=flags@entry=0x7fff861f9550) at Python/pythonrun.c:420
#34 0x00007fd42fecd693 in PyRun_AnyFileExFlags (fp=fp@entry=0x21bd590, filename=<optimized out>, closeit=closeit@entry=1, flags=flags@entry=0x7fff861f9550) at Python/pythonrun.c:81
#35 0x00007fd42fee96cd in run_file (p_cf=0x7fff861f9550, filename=0x2100440 L"segtest.py", fp=0x21bd590) at Modules/main.c:340
#36 Py_Main (argc=argc@entry=2, argv=argv@entry=0x20fd260) at Modules/main.c:810
#37 0x0000000000400bbc in main (argc=2, argv=<optimized out>) at ./Programs/python.c:69

@nzjrs
Copy link

nzjrs commented Apr 12, 2018 via email

@sdvillal
Copy link
Author

Good! so it is my system... well, will fix it at a later time. Thanks for looking at it.

@nzjrs
Copy link

nzjrs commented Apr 12, 2018

you should strace (fopen syscalls) which library it tries to open with QLibrary::load()

@nzjrs
Copy link

nzjrs commented Apr 12, 2018

strace -e trace=open myprogram or, TIL, https://en.wikipedia.org/wiki/Ltrace

@sdvillal
Copy link
Author

QT_STYLE_OVERRIDE=gtk2 python segtest.py => joy

BTW, I use LD_DEBUG first these days, as I came to master it in my hiding turbo adventures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants