Bug 1496846 - Crash when using the same connection from two threads
Summary: Crash when using the same connection from two threads
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.1.8
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.7
: 4.1.9
Assignee: Juan Hernández
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-28 15:39 UTC by Juan Hernández
Modified: 2017-11-13 12:27 UTC (History)
3 users (show)

Fixed In Version: rubygem-ovirt-engine-sdk4-4.1.9
Clone Of:
Environment:
Last Closed: 2017-11-13 12:27:22 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+
ykaul: exception+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 82351 0 master MERGED Add support for multiple threads 2017-10-13 08:28:18 UTC
oVirt gerrit 82740 0 sdk_4.1 MERGED Add support for multiple threads 2017-10-13 08:52:55 UTC

Description Juan Hernández 2017-09-28 15:39:07 UTC
Description of problem:

Using the same connection from two threads causes a segmentation fault.

Version-Release number of selected component (if applicable):

4.1.8

How reproducible:

Always.

Steps to Reproduce:

Run the following program:

---8<---
#!/usr/bin/ruby
  
require 'ovirtsdk4'

# Create the connection to the server:
connection = OvirtSDK4::Connection.new(
  url: 'https://jenkins-vm-22.qa.lab.tlv.redhat.com/ovirt-engine/api',
  username: 'admin@internal',
  password: '123456'$q qp
  insecure: true,
  debug: true
)

events_service = connection.system_service.events_service

a = Thread.new do
  loop do
    events_service.list(max: 10)
  end
end

b = Thread.new do
  loop do
    events_service.list(max: 10)
  end
end

a.join
b.join

connection.close
--->8---

Actual results:

The program crashes with a segmentation fault.

Expected results:

The program should run without problems.

Additional info:

This happens because the way we use the underlying library, libcurl, doesn't support access by multiple threads.

Comment 1 Radim Hrazdil 2017-10-20 14:27:58 UTC
Verified that given program runs without crashing using SDK version 4.1.9.


Note You need to log in before you can comment on or make changes to this bug.