Ticket #1487 (new bug)

Opened 6 years ago

Last modified 4 months ago

unix package: test needed for getLoginName

Reported by: simonmar Owned by: adrien
Priority: lowest Milestone: 7.6.2
Component: libraries/unix Version: 6.6.1
Keywords: Cc: adrien@…
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I disabled the test for getLoginName in unix/tests/user001 because getLoginName cannot be called unless stdin is a terminal, which it isn't during an unattended build. Perhaps we can test this by setting up a pseudoterminal first, but that requires the pty patches which aren't in yet.

Change History

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to Not GHC

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

Changed 2 years ago by igloo

  • failure set to None/Unknown
  • milestone changed from Not GHC to 7.4.1

Changed 16 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1

Changed 10 months ago by adrien

Hello,

What are the pty patches? are they in now? If not, is there a related ticket that needs to be solved first?

Changed 10 months ago by adrien

  • cc adrien@… added
  • owner set to adrien

Changed 10 months ago by simonmar

The pty patches have been in for some time.

Changed 10 months ago by adrien

Thank you. I realize now I should have read the commit logs of the unix lib before naively asking, I may have found the answer there.

It can take me some time to fix this, as I need to become familiar with the code and the workflow, but I think this is a good place to start.

Changed 8 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

Changed 5 months ago by adrien

Hello,

Strangely, the issue doesn't seem to occur anymore. I am using ghc 7.7.20121207 on Arch Linux 64 bits (cloned it today).

After uncommenting the line for getLoginName, I: - loaded it in ghci, and run main: ok - compiled user001.hs and run it locally: ok - ran the testsuite without modifying user001.stdout, to check I edited the right file: got a difference with user001.stdout, what I expected - added the line 'getLoginName: OK' after getGroups, ran the test suite: ok

I did the same for getUserEntryForName, no error.

I cannot reproduce the bug. Is there another to test it, or shall we conclude that the bug disappeared?

Kind regards, Adrien

Changed 5 months ago by igloo

It still fails for me:

$ make CLEANUP=1 TEST=user001
[...]
=====> user001(normal) 5 of 28 [0, 0, 0]
cd . && '/home/ian/ghc/git/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o user001 user001.hs  -package unix  >user001.comp.stderr 2>&1
cd . && ./user001    </dev/null >user001.run.stdout 2>user001.run.stderr
Actual stdout output differs from expected:
--- ./user001.stdout    2011-04-01 14:32:07.000000000 +0100
+++ ./user001.run.stdout        2012-12-08 17:05:06.000000000 +0000
@@ -3,6 +3,7 @@
 getEffectiveUserID: OK
 getEffectiveGroupID: OK
 getGroups: OK
+getLoginName: ERROR: getLoginName: illegal operation (Inappropriate ioctl for device)
 getEffectiveUserName: OK
 getGroupEntryForID: OK
 getGroupEntryForName: OK
*** unexpected failure for user001(normal)
[...]

Changed 5 months ago by adrien

Thanks for the feedback.

It eludes me why it works on my linux and not yours. On which platform did you run the test? I can install it in a virtual machine and see if I can reproduce it. I am not of great help if I can't reproduce it.

I could then try to use getlogin_r, maybe the problem is in the code and not in the test. Or strace the test and get more info on the error.

Changed 5 months ago by igloo

I used Debian amd64/Linux.

Changed 5 months ago by adrien

Thanks. I installed Debian 6.0.6 amd64 in a virtual machine and I can reproduce it.

Changed 4 months ago by morabbin

  • failure changed from None/Unknown to Incorrect result at runtime
  • os changed from Unknown/Multiple to Linux
Note: See TracTickets for help on using tickets.