segmentation fault with Python interface (Bug #3895)


Added by Pieter Eendebak over 10 years ago. Updated almost 10 years ago.


Status:Done Start date:2014-09-05
Priority:Normal Due date:
Assignee:Maksim Shabunin % Done:

0%

Category:highgui-gui
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Linux
Difficulty: HW Platform:x64
Pull request:https://github.com/Itseez/opencv/pull/3994

Description

The segmentation fault happens when calling imshow. The error related to the gtk package.
A minimal example:

  1. Minimal example

import time
import numpy as np

import cv2
import gtk # no crash without gtk

print('%s' % cv2.__version__)

im=(np.random.rand( 400, 600)*100).astype(np.uint8)
#cv2.namedWindow('Image')

print('at cv2.imshow...')
cv2.imshow('Image', im) # segmentation fault
print('done ...' ); time.sleep(20);


Related issues

related to Bug #927: namedWindow seems to modify locale settings Done

History

Updated by Dmitry Retinskiy over 10 years ago

  • Category set to highgui-gui

Updated by Maksim Shabunin almost 10 years ago

  • Target version changed from 3.0-alpha to 3.0

Updated by Maksim Shabunin almost 10 years ago

Calling gtk_disable_setlocale causes this crash. Without this call it works fine.

  • Status changed from New to Open
  • Assignee set to Maksim Shabunin

Updated by Maksim Shabunin almost 10 years ago

  • Pull request set to https://github.com/Itseez/opencv/pull/3994

Updated by Maksim Shabunin almost 10 years ago

Fixed in https://github.com/Itseez/opencv/pull/3994 by removing gtk_disable_setlocale and placing

setlocale(LC_NUMERIC,"C");
after gtk initialization.

  • Status changed from Open to Done

Also available in: Atom PDF