×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Segmentation fault

Segmentation fault

Segmentation fault

(OP)
Dear All,

I need help. We Installed Red Hat Enterprise Linux 5 and the following Informix products:

Informix SE version 7.26 UC6R1
Informix 4gl Developer Version 7.32 UC4
Informix 4gl Runtime Version 7.32 UC4
Informix 4gl Compiler RT Version 7.32 UC3
Informix Sql Development Version 7.32 UC4
Informix Sql Runtime Version 7.32 UC4

We are compiling and executing alright but, it is failing to display some forms in the window or probably the cursor is not placed properly. Here is part program declaration and output from the executable:


---From Calling Main Module----------------

    COMMAND KEY (A, a) "Amendemployee"  "Amend Personal Details for Existing Employee"
      CALL RqestEmployee() RETURNING w_manno  ----This a call from the calling Module
      IF w_manno != " "
      THEN
        CALL AmendEmplyDetails(w_manno)
      END IF


-----Part Program ---------------
FUNCTION RqestEmployee()                     ------This is the function being called
  DEFINE w_manno        LIKE viewstaff.manno,
         w_surname      LIKE personnel.surname,
         r_name         LIKE personnel.surname,
         r_forename     LIKE personnel.other_names,
         r_title        LIKE personnel.title,
         w_cnt               SMALLINT
 
  OPEN WINDOW win_request AT 5, 2
    WITH 16 ROWS , 77 COLUMNS ATTRIBUTE (BORDER)
 
  OPEN FORM RqestEmp FROM  "/srs-prps/ppsys/phaseI/forms/RqestEmp"  -----This is the form being display
  DISPLAY FORM RqestEmp
 
  LET int_flag = FALSE
  LET w_manno = " "
  LET w_surname = " "
 
  LET GetInput = TRUE
  WHILE GetInput
    INPUT w_manno,                                
          w_surname
      WITHOUT DEFAULTS
     FROM manno,                                   -----Accepting input from the screen variable
          surname

    BEFORE  FIELD manno    
      PROMPT "      Select Either Man Number  OR Surname -  Press Return"
        ATTRIBUTE(BOLD) FOR CHAR Answer

    AFTER FIELD manno                                          
      IF  w_manno <> " "
      AND w_manno IS NOT NULL
      THEN
        SELECT COUNT(*)
          INTO w_cnt
          FROM personnel per,
               payrollstatus prs
         WHERE per.manno = prs.manno
           AND prs.manno = w_manno
 
        IF w_cnt != 1
        THEN
          PROMPT "No Personnel Record Exists With This Man Number ",
                 " -  Press Return"
            ATTRIBUTE(BOLD) FOR CHAR Answer
          NEXT FIELD manno
        END IF
      END IF
    END INPUT

-------.per form ---------------------------------------------------

DATABASE FORMONLY
SCREEN
{
                                                           Ref:RqestEmp
 
 
 
 
           Man No.[f01   ]         Surname [f02            ]
 
 
}
END
ATTRIBUTES
f01 = formonly.manno ,  REVERSE;                     -----The screen variable
f02 = formonly.surname, UPSHIFT,REVERSE;
END
INSTRUCTIONS
DELIMITERS " "


OUTPUT SCREEN

+-----------------------------------------------------------------------------+
|Transactions:   Amend  Insert  Overtime  eXit                                |
|Amend Payments & Deductions                                                  |
+-----------------------------------------------------------------------------+
|                                                           Ref:RqestEmp      |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|           Man No.                 Surname                  Segmentation fault
[ppsys@rhino bin]$                                                            |
|                                                                             | -- Window and Menu displayed
|                                                                             |
|                                                                             | -- Cursor should be in Mnno
|                                                                             |
|                                                                             | -- field but instead comes up
|                                                                             | -- with Segmentation fault
|                                                                             |
|                                                                             |
|                                                                             |
+-----------------------------------------------------------------------------+


Would anyone know why I am getting this segment fault ?

Your help is highly valued.

Thanking you in advance.


Regards



Felix Mwango Mutale

RE: Segmentation fault


The first thing I would check is the two PROMPT statements within the INPUT statement.  The INPUT statement is controlling input and then you are asking for input with PROMPTS.  While correct syntax, this could be where your issue lies.

 

RE: Segmentation fault

(OP)
Hello Sir,

Thanks for the reply. The truth, the same syntax works very well on SCO UNIX 5.05 and Informix 4gl version 7.20. I did'nt really think there would be such major differences in the coding structure except probably the kernels with linux or #unclude which I am not aware of.

I still value your help. It is the only thing remaining and the system will be up and running.

Thanks and regards.


Felix Mwango Mutale

RE: Segmentation fault

It seems like each Informix 4GL version has its own set of bugs and problems.

You might consider placing the two PROMPT statements in separate functions with their own window and then close the window when you return:

IF w_cnt != 1
THEN
    CALL my_prompt()
    .
    .

CODE

# untested
FUNCTION my_prompt()
DEFINE answer CHAR(1)

OPEN WINDOW m_wsu AT 4,6 WITH FORM "my_wsu"
 ATTRIBUTE(BORDER,FORM LINE 2, COMMENT LINE LAST-1,PROMPT LINE LAST,MESSAGE LINE LAST)

          PROMPT "No Personnel Record Exists With This Man Number ", " -  Press Return" FOR CHAR answer
CLOSE WINDOW m_wsu

END FUNCTION

You will probably have modify the ATTRIBUTE list to fit your own needs.


 

RE: Segmentation fault

(OP)
Hello All,

Does anyone in the group know the solution to the following:

INPUT statement in Informix Causes Segmentation fault ".

What should be done about it.


Thanks.


Felix Mwango Mutale

RE: Segmentation fault

I think Olded is right.

Personnaly my compiler (7.5) does not accept prompt inside input statements unless prompt gots its end statement.

CODE

# untested of course
 INPUT w_manno,                                
          w_surname
      WITHOUT DEFAULTS
     FROM manno,                                   -----Accepting input from the screen variable
          surname

    BEFORE  FIELD manno    
      PROMPT "      Select Either Man Number  OR Surname -  Press Return"
        ATTRIBUTE(BOLD) FOR CHAR Answer
      END PROMPT  -- here's a correction

    AFTER FIELD manno                                

I am not sure whether it will accept having "END PROMPT" just after the "PROMPT" line. In this case (and also for the user), you can add your Quit key treatment.

Anyway, having prompts inside inputs can be confusing for the end user..

RE: Segmentation fault

(OP)
Dear Sir,

Good Afternoon sir. I need help.

On UNIX environment we were printing on portrait and landscape with the following command line in Informix 4gl:

FUNCTION LandsPrint()
  LET cmdline = " "
  LET cmdline =  "lpr -c -n ", copies clipped, " -d", printer clipped,
                 " -olandscape -otl66 -oc -ovsi5 -o nb -o 12  ", w_reportname
  RUN cmdline
  Prompt "Report is being sent to Printer - Press Return" FOR Answer
  RETURN
END FUNCTION

FUNCTION LandsPrint2()
  LET cmdline = " "
  LET cmdline =  "lpr -c -n ", copies clipped, " -d", printer clipped,
                 " -olandscape -otl43 -oc -ovsi8 -o nb  ", w_reportname
  RUN cmdline
  Prompt "Report is being sent to Printer - Press Return" FOR Answer
  RETURN
END FUNCTION

How could I print in Informix for CentOS Enterprise Linux ?

Thanking you in advance.


Felix Mwango Mutale
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close