Jump to content


Photo
- - - - -

Unusual Request


17 replies to this topic

#1 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 23 January 2007 - 08:52 PM

Do any of you have any (simple) code, that will cause in an Update function - even better if it's a Task function - a (i) coredump?; (ii) cause TASK_ERROR function to be executed?

Or have any ideas how to make it happen?

I've tried: SEL-ONLY in B4Rd logic (I would've sworn that used to "work" to coredump), LSCALL(1) in a 1-1 Update, LSCALL(2) where LU 2 does not exist, LSCALL(2) in the DefLg of LU2. This last one errors out nicely, but it did not execute Task_Error.

Purpose: to be able to more effectively code and test error-/exception-handling, particular when involving 3rd party coders in making API/Task calls in.

Oh, and also a related question: are any of you aware of a "replicatable on demand" scenario, where Bus & Tasks returns no errors, but Task_Error function was executed?

Thanks
Rick

Edited by Rick Young, 23 January 2007 - 08:55 PM.


#2 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 24 January 2007 - 07:32 AM

Hi,

Core dumps are easy :o

Create an update with 1 LU and no files in it. In Default Logic put this in...

PAGE_BREAK()

Rob.

#3 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 24 January 2007 - 01:43 PM

I guess they fixed that too :o

Tried on 5.1.7 on both HP-UX and RedHat platforms - no issues.

-Rick

#4 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 24 January 2007 - 03:37 PM

Ok, this is a sure one then...

Create a ProISAM file with a key length of 127, and physically create it (which will create the file with a 250byte page length)

Then write an update to just add and add into this file, in a loop (just PIC(#X,'99999999999') into the key)

Once the file gets to 32MB, it will core dump...

Rob.

#5 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 24 January 2007 - 05:35 PM

Dunno if this will still work either Rick but I used to use it reliably :o

CONV(1e40)
Nothing's as simple as you think

#6 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 24 January 2007 - 05:53 PM

Thanks Rob - I'll give that a burl, but I'll probably set a smaller page size and make it blow up sooner :o (edit: except you can't get smaller than 250...)

I thought maybe I could also try vi'ing and changing a .pro file, but I guess I didn't break it enough.


Richard - it didn't fail for me. I assumed that I needed $I = CONV(1e40). Out of curiousity, I umsg'd $I, and the result was 1e40. So then I tried $I = '1e40' #I = CONV(#I) UMSG(CONV(#I),-1) which also showed 1e40...

-Rick

Edited by Rick Young, 24 January 2007 - 05:57 PM.


#7 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 24 January 2007 - 06:19 PM

well

It seems that on a customer's site, as soon as you start to even think about approaching the 32MB (or whatever) limit, the file goes corrupt - but if I try to make one go on purpose, the U function quite happily sits there erroring ad infinitum ad nauseum that there's an error writing the file, but it won't corrupt it, and the function won't coredump out.


I thought that this was going to be an easy exercise, but I think I'm just going to have to do the "reactive programing" if/when various exceptions occur during testing and of course, production.

Thanks for all your time guys
Rick

#8 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 24 January 2007 - 07:49 PM

What OS is the kernel on, *nix or Windows XP?

Rob.

#9 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 24 January 2007 - 07:55 PM

I'm onsite, and doing some of this testing on a HP-UX 11i box - and some of it on a Linux box in the office. same kernel release in each case.

-Rick

#10 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 24 January 2007 - 09:18 PM

Shoot, I'm sure I used to know more than one way to do this, must be getting old.

Just for the hell of it then, try $i = CONV(1e45) in case it's 'near the edge'.

The only other thing ISTR might have worked is #X = 0 CALL #X
Could be worth a try.
Nothing's as simple as you think

#11 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 24 January 2007 - 09:35 PM

No luck there either - I had tried earlier (and didn't mention) 1e80 ...

Maybe ProIV have made things more bulletproof by ignoring "stupid code" instead of leaving it to coredump :o

I know when I was just learning ProIV, I could do it without even trying /deadpan.

#12 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 25 January 2007 - 12:09 PM

OK, I remembered one other, more amusing, thing I once saw cause a core dump.
Probably that won't happen any more either but hey..

SESSION.MODE = 'DUMP'

:-"

I guess it goes without saying but the 'correct' way to achieve what you want is to write a 1-line C external subroutine and link it with the kernel so you can just say LINK('COREDUMP') for example. I guess you would have done that if it was easy :)
Nothing's as simple as you think

#13 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 25 January 2007 - 12:12 PM

Ha ha...

SESSION.MODE = 'DUMP'

That core dumps our kernel straight away :-"

Rob.

#14 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 25 January 2007 - 01:35 PM

*sigh

On the HP box I get:
UPDATE IN PROGRESS - PLEASE WAIT767 - WARNING: %1 UNSUPPORTED PROPERTY - %2, OBJECT %3, LOGIC %4, %5
On the Linux box, it does a nice segmentation fault :-"

Thanks much - at least that gives one place to test with.

Unfortunately Richard, I'm just an uneducated dummy who learned ProIV on the job over the years - so that's a negative on the C routine...hmm on the other hand, maybe that would make me the ideal candidate to write a C routine that crashes :)



-Rick

#15 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 368 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 25 January 2007 - 05:08 PM

Do any of you have any (simple) code, that will cause in an Update function - even better if it's a Task function - a (i) coredump?; (ii) cause TASK_ERROR function to be executed?

Or have any ideas how to make it happen?



UMSG(@CURFLDNAME) might
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users