View Issue Details

IDProjectCategoryView StatusLast Update
0010758FPCTextmode IDEpublic2011-11-30 21:49
ReporterleetncAssigned ToMarco van de Voort 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version2.4.4 
Summary0010758: fp txt ide User Screen fails to initialize
Descriptionfp-2.2.0 Slackware 12.0 Linux kernel 2.6.21.5

Symptoms:
Running a program from the fp ide does not display any output on the the User Screen. Selecting User Screen from the Debug menu by scrolling down to "User Screen" and hitting return does not display the User Screen.

Observations:
Source File '/fpc-2.2.0/ide/fpusrscr.pas' - In "TLinuxScreen" section, "constructor TLinuxScreen.Init", line 805, there is the statement:

"if (Copy(ThisTTY, 1, 8) = '/dev/tty') and (ThisTTY[9]<>'p') then"

ThisTTY function returns "/dev/vc/1".

ThisTTY never returns '/dev/tty1' because the device entry '/dev/tty1' is only a symbolic link to device '/dev/vc/1'
The symbolic link appears to be a feature related to "udev".
ThisTTY sort of runs through the symbolic link without noticing it.

Suggested Change:
Simplest possible accommodation may be a change in the 'if statement' to :

"if ((Copy(ThisTTY, 1, 8) = '/dev/tty') and (ThisTTY[9]<>'p')) OR (Copy(ThisTTY,1,8)='/dev/vc/') then"

I do not see any reason why this change would interfere with the FreeBSD console case, but had no way to verify that.

Just coincidence that the Copy char count is the same in both instances.

Subsequent statement with FName = '/dev/vcsa1' apparently works because it is a symbolic link to device '/dev/vcc/a1'

"1" in the device names above is used as an example and is what shows up on my particular system.
Additional InformationIn the IDE, ALT-F5 also fails to display the User Screen, but that involves a different issue with the Linux kernel 2.6.21.5 apparently not surrendering the ALT-Function keys to application programs ( as root or user). I think.

I used a trial & error approach to flush out the User Screen problem. Would be advisable to run it by your Linux kernel and/or udev guru's.
TagsNo tags attached.
Fixed in Revision16631
FPCOldBugId0
FPCTarget-
Attached Files

Activities

leetnc

2008-02-03 14:13

reporter   ~0017585

Ah....I should have put this in the "FPC" project. Can you transfer it, or do I need to resubmit ???

Florian

2008-02-03 14:20

administrator   ~0017586

Moved.

leetnc

2008-02-29 02:46

reporter   ~0018018

There appears to be an additional wrinkle when using a user virtual terminal.
Symptoms: The User Screen overwrites the IDE screen.
Analysis: In ~/ide/fpusrscr.pas source code, in 'constructor TLinuxScreen.Init;', where FName = '/dev/vcsa/x'
TTYFd:= fpOpen(FName, &666, O_RdWr);
always returns a '-1' due to the standard udev permissions for /dev/vcc/a* .
Brute force work-around: As root, chmod 666 /dev/vcc/a*
or edit /etc/udev/rules.d/50-udev.rules to make the permissions at boot:
original:
KERNEL=="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK+="%k", GROUP="tty"
to:
KERNEL=="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK+="%k", GROUP="tty", MODE="666"
Other: Maybe there is an underlying incompatibility between grab_vcsa and udev ?

Marco van de Voort

2008-02-29 09:30

manager   ~0018021

FreeBSD terminals are typically /dev/ttyv<n> and very different from linux consoles.

Marco van de Voort

2010-12-22 22:21

manager   ~0044508

Extra check added, since while reviewing again considered that it wouldn't hurt.

Added remark about vcsa permissions to the wiki

Issue History

Date Modified Username Field Change
2008-02-03 13:42 leetnc New Issue
2008-02-03 14:13 leetnc Note Added: 0017585
2008-02-03 14:20 Florian Project fpGUI => FPC
2008-02-03 14:20 Florian Note Added: 0017586
2008-02-29 02:46 leetnc Note Added: 0018018
2008-02-29 09:30 Marco van de Voort Note Added: 0018021
2008-03-25 16:49 Jonas Maebe FPCOldBugId => 0
2008-03-25 16:49 Jonas Maebe FPCTarget => -
2008-03-25 16:49 Jonas Maebe Category => IDE
2010-12-22 22:21 Marco van de Voort Fixed in Revision => 16616
2010-12-22 22:21 Marco van de Voort Status new => resolved
2010-12-22 22:21 Marco van de Voort Fixed in Version => 2.5.1
2010-12-22 22:21 Marco van de Voort Resolution open => fixed
2010-12-22 22:21 Marco van de Voort Assigned To => Marco van de Voort
2010-12-22 22:21 Marco van de Voort Note Added: 0044508
2011-05-01 19:22 Marco van de Voort Fixed in Revision 16616 => 16631
2011-05-01 19:22 Marco van de Voort Status resolved => closed
2011-05-01 19:22 Marco van de Voort Fixed in Version 2.5.1 => 2.4.4
2011-05-02 17:38 Marco van de Voort Status closed => resolved
2011-11-30 21:49 Marco van de Voort Status resolved => closed