Bug #2063
closedCore dump on AIX
Description
=begin
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.
=end
Files