ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:25479] [Bug #2063] Core dump on AIX
@ 2009-09-08 15:09 Perry Smith
  0 siblings, 0 replies; only message in thread
From: Perry Smith @ 2009-09-08 15:09 UTC (permalink / raw
  To: ruby-core

Bug #2063: Core dump on AIX
http://redmine.ruby-lang.org/issues/show/2063

Author: Perry Smith
Status: Open, Priority: Normal
ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [powerpc-aix5.3.0.0]

The aix_loaderror routine has many problems.  First, if loadquery fails, messages has not been initialized.  So the next if statement coredumps:

        for(i = 0; message[i] && *message[i]; i++) {

message[i] is set to trash and *message[i] can cause a SEGV.

Second, the messages returned are no long in  the same format as the documentation.  The easiest way to see this is to dump them out.  They can optionally start with (xxx.  Then there is the error code (as before), then what appears to be a count of parameters, followed by a list.  The code below is valid for the case of a single undefined symbol.

The message text is placed inside the buffer which is passed as well as the pointers to the messages.  So, it needs to be bigger than just the size of 8 pointers.

The code inside the for (j loop often uses i where it should use j.

All this just to get a message that is not printed out anyway which I feel should be changed but thats another matter.

I'm using ruby 1.9.1-p243, gcc 4.4.1, on AIX 5.3 gold.

diff is attached.


----------------------------------------
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-08 15:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 15:09 [ruby-core:25479] [Bug #2063] Core dump on AIX Perry Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).