ABRT for Ruby
Vít Ondruch
vondruch at redhat.com
Tue Jul 10 08:29:47 UTC 2012
Hi Motohiro,
Thank you for your feedback.
Dne 9.7.2012 22:46, KOSAKI Motohiro napsal(a):
> On Mon, Jul 9, 2012 at 9:47 AM, Vít Ondruch <vondruch at redhat.com> wrote:
>> Hi,
>>
>> Updated ABRT gem version 0.0.2 is available at RubyGems.org if you like to
>> test it. I'd love to hear some feedback.
>>
>> There were done following changes:
>>
>> * Improved code base
>> * Better handling of some edge cases, such as call to Kernel#exit or Ctrl+C
>> event
>> * Test suite added
>> * Improved documentation
>>
>> I also prepared RPM for Fedora. Review is available at
>> https://bugzilla.redhat.com/show_bug.cgi?id=838568
>
>> def self.report(backtrace, io = abrt_socket)
>> io.write "PUT / HTTP/1.1\r\n\r\n"
>> io.write "PID=#{Process.pid}\0"
>> io.write "EXECUTABLE=#{$PROGRAM_NAME}\0"
> Hmm..
>
> If I understand correctly, EXECUTABLE key is used for looking up package name
> from abrt daemon. Then, It should be realfilename. See below abrt doc.
>
>
> abrt/doc/interpreted-languages:
>
>> EXECUTABLE
>> The file with the main entry point of the application. Might be a JAR
>> archive, a script file, a bytecode file, or the interpreter. It should
>> be a real file on the filesystem, so ABRT can check the origin of the
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
> However, PROGRAM_NAME can be changed from ruby scripting. e.g.
> $0 = "foobar"
You are right, you can change the $PROGRAM_NAME. I'll make several
points here
* Is there some more reliable way how to detect the script name?
* What is the use case and how widely is this practice used? Can we
ignore this case? Python handler ignores it if I am not mistaken (but we
should be better of course ;)
* ABRT ignores such failure and it just logs something like "Executable
'foo.rb' doesn't belong to any package" into /var/log/messages.
>
>
>> # TODO: Do we need specialized Ruby analyzer?
>> # io.write "ANALYZER=Ruby\0"
>> io.write "ANALYZER=Python\0"
>> io.write "BASENAME=rbhook\0"
>> io.write "REASON=#{backtrace.first}\0"
>> io.write "BACKTRACE=#{backtrace.join("\n")}\0"
> btw, I wrote a patch to redirect rb_bug() message to abrtd too.
> Is it interesting for you?
>
> https://github.com/kosaki/ruby/commit/6283017dc2747f306808ce530292dc51273746ec
I'll take a closer look later if you don't mind, but could you please
elaborate the patch a bit? I know you have risen some concerns
previously. What is advantage of your patch or how is it different? What
scenarios it should handle and what not?
Thank you.
Vit
More information about the ruby-sig
mailing list