Bug 1418296

Summary: Change user_string to user_string_warn
Product: [Fedora] Fedora Reporter: Lukas Zapletal <lzap>
Component: rubyAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: fche, mmorsi, mtasaka, s, strzibny, vanmeeuwen+fedora, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-25 08:38:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The patch none

Description Lukas Zapletal 2017-02-01 13:49:03 UTC
When systemtaping Ruby application (Satellite) we are hitting:

Full error: user string copy fault -14 at 0000000001a9e310 [man error::fault] near identifier 'user_string_n' at /usr/share/systemtap/tapset/uconversions.stp.

The solution was to change user_string to user_string_warn in libruby.stp file. For RH SCL this is located at:

    /opt/rh/rh-ruby22/root/usr/share/systemtap/tapset/libruby.so.2.2.stp

This will no longer exit session but continue working (with a warning message).

Comment 1 Lukas Zapletal 2017-02-01 13:49:55 UTC
Created attachment 1246650 [details]
The patch

Comment 2 Vít Ondruch 2017-02-03 13:57:14 UTC
(In reply to Lukas Zapletal from comment #0)
> This will no longer exit session but continue working (with a warning
> message).

Could you please elaborate what is the benefit/difference? I am afraid I don't fully understand the intention here ...

Comment 3 Lukas Zapletal 2017-02-24 14:31:16 UTC
Sure, is as easy as user_string exist systemtap script while user_string_warn just issues a warning. Basically it's impossible to use SystemTap on Ruby codebase with C extensions without this change.

Comment 4 Vít Ondruch 2017-02-27 11:01:02 UTC
(In reply to Lukas Zapletal from comment #3)
> Sure, is as easy as user_string exist systemtap script while
> user_string_warn just issues a warning. Basically it's impossible to use
> SystemTap on Ruby codebase with C extensions without this change.

But what is the reason for "Full error: user string copy fault -14 at 0000000001a9e310 [man error::fault] near identifier 'user_string_n' at /usr/share/systemtap/tapset/uconversions.stp."

Using the _warning variant looks just as an workaround of some underlying issue ...

Comment 5 Lukas Zapletal 2017-02-27 12:46:31 UTC
My understanding is that SystemTap can preempt into Ruby VM in any state, even in inconsistent, thus the error. Shell I ask someone from SystemTap to review this?

Comment 6 Vít Ondruch 2017-02-27 13:04:12 UTC
(In reply to Lukas Zapletal from comment #5)
> Shell I ask someone from SystemTap to review this?

That would be sweet ...

Comment 7 Fedora End Of Life 2017-02-28 11:09:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 8 Frank Ch. Eigler 2017-03-01 21:04:37 UTC
The change seems fine.  Or use user_string_quoted (which handles errors by going to hex addresses instead).

Comment 9 Lukas Zapletal 2017-05-25 07:42:43 UTC
Vit, that's the review, I asked Frank from SystemTap team :-) ^^^