Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-01

Runtime Error 216 (oCrt).

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Arne Hanssen

I've installed FPC 1.9 on Linux and try to use the oCrt unit. It seems like my app crashes on this statement

  TitleWin^.FWrite(2,2,TextAttr,1,'Text');

When I try to compile and run the ocrt_demo program which is included with FPC, it seems to crash also on such a statement (its the FWrite method that fails other methods of pnWindow objects, like Show, are ok).

Is this a bug, and how can I fix this?

Vennlig hilsen / Best regards Arne Hanssen
Unknown author
to Arne Hanssen
Arne Hanssen wrote 11 lines
I've installed FPC 1.9 on Linux and try to use the oCrt unit. It seems like my app crashes on this statement TitleWin^.FWrite(2,2,TextAttr,1,'Text'); When I try to compile and run the ocrt_demo program which is included with FPC, it seems to crash also on such a statement (its the FWrite method that fails other methods of pnWindow objects, like Show, are ok). Is this a bug, and how can I fix this?

It is a bug. The value of 'sub' in line 875 of ocrt is nil, and this is not checked for. However, the values given to the newwin() statement on that line are total bogus, and they come from:

      getbegyx(win,y,x);
      getmaxyx(win,my,mx);

They are transnslated macros. (line 1312 of ncurses.pp). There are 2 possibilities:
- The fpc compiler generated wrong alignment code for the win_st struct.
- The win_st struct of ncurses has changed in newer versions of ncurses, and the ncurses unit doesn't have the right definition.

My guess is that it is the latter.

Michael.