[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2204.0. "VMS 5.3 crash on DwtGetNextSegment" by FREZEN::PROJECTS () Mon Feb 05 1990 13:52

My code crashes here due to the changes made in VMS 5.3 . The 5.3 release notes
state that compound strings are now stored in CDA format. I'm kind of lost here.
Do you see what I am doing wrong in this callback routine to a file selection 
widget?? The crash occurs on the call to dwtgetnextsegment (ACCESSVIO)

static void power_file_ok_cb (w, tag, power_cb_struct)
    Widget w;
    int *tag;
    DwtFileSelectionCallbackStruct* power_cb_struct;
{
    char                    *tmp_str;
    DwtCompStringContext    power_context;
    Boolean                 dummyb;
    unsigned long           dummyl;
    DwtRendMask             dummym;

    DwtInitGetSegment (&power_context, power_cb_struct->value);
    DwtGetNextSegment (&power_context, &tmp_str,&dummyl, &dummyb,
                      &dummyl, &dummym);
    strcpy (cur_filename, tmp_str); /*  and should be freed by application */
    switch (cur_operation)
    {
    case SAVE_MODE:
        save_values (cur_filename);
        break;
    case LOAD_MODE:
        load_values (cur_filename);
        break;
    default:
        printf ("Bad file OP mode\n");
        break;
    }
}
T.RTitleUserPersonal
Name
DateLines
2204.1Bug is Boolean passed to GetNextSegmentTLE::D_SMITHMon Feb 05 1990 14:034
Your fourth argument to DwtGetNextSegment (called dummyb) represents the
dir_r_to_l parameter.  It *must* be declared as an int and not a Boolean.

I (and others) have gotten bit by this one.
2204.2VMS 5.3 crash on DwtGetNextSegmentFREZEN::PROJECTSMon Feb 05 1990 14:3513
	I thank you for sharing the help.


	I am wondering why changes like this are not detailed in the release 
	notes. This could have affected the software delivery scheduled in my
	group in 5 days. I know nobody intends to leave us guessing on purpose
	... I just think it could be safe on the profile of the company if 
	problems, especially ones that cause a ripple effect, could be more 
	detailed.


	Thanks
2204.3PSW::WINALSKICareful with that VAX, EugeneMon Feb 05 1990 15:3812
RE: .2

There was no documentation of any change because whatever change was made didn't
affect the interface to the routine.  According to the DECwindows V1 (VMS V5.1)
documentation, the dir_r_to_l parameter should be declared:

	int *dir_r_to_l;

Thus, your program has always had a bug in it.  Nobody has ever guaranteed that
buggy programs will behave the same way, release to release.

--PSW
2204.4Common bugCLTVAX::dickDick Schoeller - Failed XperimentMon Feb 05 1990 16:394
Unfortunately, this is a bug that many applications are likely to have
because it arises from code copied from DECBURGER   8^{(.

Dick
2204.5QUARK::LIONELFree advice is worth every centMon Feb 05 1990 16:415
Re: .4

Huh?  There's no use of DwtGetNextSegment in DECBURGER.

			Steve
2204.6Screwed up my citations againCLTVAX::dickDick Schoeller - Failed XperimentTue Feb 06 1990 08:427
I may be wrong about DECburger.  I do know that I copied that code from
somewhere public and had the same bug.  Maybe one of the notes files
(DECWINDOWS, DECWINDOWS_PROGRAMMING or DW_EXAMPLES)?  I am also pretty sure that
it came from someone whom I was inclined to trust (sort of like the red and
white watch cursor   8^{).  In any case that bug has proliferated fairly widely.

Dick
2204.7TLE::D_SMITHTue Feb 06 1990 09:2610
On my system, searching DECW$EXAMPLES for GetNextSegment showed this incorrect
usage being used in a file called TESTCALLBACKS.C.

The comments in the file suggest 2 things:

    1.  It is part of NETED
    2.  It was generated by UI_GEN

The file is very old, but does show that this code used to work just fine and
was broken in DECwindows V2.
2204.8PSW::WINALSKICareful with that VAX, EugeneTue Feb 06 1990 18:1710
RE: .7

>The file is very old, but does show that this code used to work just fine and
>was broken in DECwindows V2.

I would say rather that the code has always been broken, but by bad luck it
never used to fail catastrophically.  It could never have returned the proper
result.

--PSW
2204.9QUARK::LIONELFree advice is worth every centWed Feb 07 1990 10:397
There have been many errors in the examples.  I have been correcting errors in
DECBURGER and HELLOWORLD as I find them, though my latest corrections didn't
make it into V5.3.  In many cases, it was just coincidence that the programs
worked at all.  As it stands, most of the examples have severe memory leaks
that have undoubtedly propogated to customer applications.

				Steve