The data in your dump does not seem to support your conclusion.  If you treat 
the first four bytes as a stand-alone word, you do indeed get a word of 0 and a 
long of 15.  But the next two longs are 2 and 8, not the 8 and 2 you are 
expecting.

If you treat all the data as longs, you get values of 0, 15, 2, and 8 but not 
in the normal order of a big endian machine.  For whatever reason, each long 
seems to be ordered as low order word followed by high order word.  

Or perhaps each long only contains a word.  Could it have something to do with 
whether you are in 32 or 64 bit mode.  In 32 bit mode, a long is only 4 bytes 
while in 64 bit mode it is 8.

> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Ze'ev Atlas
> Sent: Wednesday, February 18, 2015 6:28 AM
> To: [email protected]
> Subject: A possible bug in the IBM Runtimne C library
> 
>  Hi all
> I suspect (and can prove that there is a bug in the regexec function.  I have 
> encountered this
> issue on two z/OS systems with two different z/OS level.  The proof is 
> repeatable and
> produce same wrong results any time.
> 
> To prove it I modified a sample C program from the IBM manual and added a 
> call for
> dumping memory (see below).  The documentation and the regex.h declare that 
> the
> regmatch_t construct should be a pair of doublewords (long) and it is 
> supposed to be an
> element in an array of as many as you need.  Iinstead of getting two pairs of 
> double words
> containing (0,15),(8,2), I get the first component  of the first element as 
> one word (int) of 0
> and the rest are indeed double words.  This seems like a bug in the runtime 
> library.Here is
> the dump (only the first two lines are relevant)
> 
> 19819478 | 00 00 00 00    00 00 00 00    00 00 00 0F    00 00 00 00 |         
>        
> 19819488 | 00 00 00 02    00 00 00 00    00 00 00 08    00 00 00 00 |         
>        
> 19819498 | 00 00 00 40    00 00 00 00    10 00 00 00    19 81 92 48 |         
>      ak
> 198194A8 | 00 00 00 00   99 80 01 6E   04 C6 3C 98   00 00 00 00 |     r  K F 
> q
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to