Project

General

Profile

Actions

Bug #4012

closed

Get segmentation fault when trying to call method from 3rd party's API

Added by thyrlian (Jing Li) over 13 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
[ruby-core:32999]

Description

=begin
I tried to call a method in an interface from 3rd party's API. The interface has been successfully found by ole_query_interface, while at next step of calling the method inside, I got a segmentation fault. And I think the parameters I passed into the method are correct.

This implementation is using HP Quality Center Open Test Architecture API.
Interface: ISupportCopyPaste
Public Method: CopyToClipBoard
Syntax (Visual Basic):
Public Function CopyToClipBoard( _
ByVal IDSFilter As String, _
Optional ByVal mode As Long = 0, _
Optional ByVal Path As String = "" _
) As String
Parameters:
IDSFilter
Either comma separated list of ID numbers or a TDFilter.Text that qualifies the items to be copied.
mode
Unused
Path
Use when copying a folder. The path of the folder.
Return Type:
The data copied to the clipboard.

Codes Snippet:
iscp = tstsf.ole_query_interface(iid_ISupportCopyPaste)
clipboard = iscp.CopyToClipBoard(copied_id)
# or replace above one with below
# clipboard = iscp.CopyToClipBoard(copied_id, 0, "")

Error info:
-- control frame ----------
c:0004 p:---- s:0025 b:0025 l:000024 d:000024 CFUNC :method_missing
c:0003 p:0612 s:0023 b:0023 l:00118c d:001980 EVAL qc.rb:76
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00118c d:00118c TOP

-- Ruby level backtrace information ----------------------------------------
qc.rb:76:in <main>' qc.rb:76:in method_missing'
=end


Files

qc.rb (3.13 KB) qc.rb code thyrlian (Jing Li), 11/02/2010 12:48 AM
Actions #1

Updated by luislavena (Luis Lavena) over 13 years ago

=begin
Hello,

Since I don't have HP installed tools (or will be without knowing exactly from where and which one to get)

Can you inspect that copied_id is what the type of object expected?

Also, as the example you provided, can remove the 0, "" optionals just for testing?

Thank you.
=end

Actions #2

Updated by thyrlian (Jing Li) over 13 years ago

=begin
Hi Luis,

Sorry for lack of information. The 'copied_id' is a Fixnum and here is 25511 for each running. Actually I've tried both the fixnum itself and to_s as the parameter, while the result is the same. And according to HP's spec, this should be alright.

As in my comments, remove the optional parameters 0, "" has the same error as with these parameters.

Thanks a lot.
=end

Actions #3

Updated by thyrlian (Jing Li) over 13 years ago

=begin
In the spec of parameter, it's said:
IDSFilter: Either comma separated list of ID numbers or a TDFilter.Text that qualifies the items to be copied.

So I also tried a bit TDFilter.Text type, it doesn't work either.

copied_id = tdcon.TestSetTreeManager.NodeByPath("#{path_1}\wk30\Component").FindTestSets("BAT_2010_0808").Item(1).TSTestFactory.Filter.Text

Here the copied_id is String and its value is "[Filter]".
=end

Updated by naruse (Yui NARUSE) almost 13 years ago

  • Status changed from Open to Assigned
  • Assignee set to suke (Masaki Suketa)
  • Target version set to 1.9.3

Updated by suke (Masaki Suketa) over 12 years ago

Sorry for being too late to reply.
I would like to know the value of iid_ISupportCopyPaste.
Could you tell me the value?

p iid_ISupportCopyPaste # I would to know the result of this line.
iscp = tstsf.ole_query_interface(iid_ISupportCopyPaste)
...

Updated by kosaki (Motohiro KOSAKI) over 12 years ago

  • Status changed from Assigned to Feedback
  • Target version changed from 1.9.3 to 1.9.4
Actions #7

Updated by naruse (Yui NARUSE) about 11 years ago

  • Target version changed from 1.9.4 to 2.6
Actions #8

Updated by naruse (Yui NARUSE) over 6 years ago

  • Target version deleted (2.6)
Actions #9

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0