Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? --+- Reporter: j.waldmann | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.6.1 Component: GHCi |Version: 7.4.1 Resolution: fixed| Keywords: Os: Linux| Architecture: x86_64 (amd64) Failure: None/Unknown | Difficulty: Unknown Testcase: ghci/scripts/T5975{a,b} | Blockedby: Blocking: |Related: --+- Changes (by pcapriotti): * status: patch = closed * testcase: = ghci/scripts/T5975{a,b} * resolution: = fixed * milestone: = 7.6.1 Comment: Pushed (the ticket number in the commit message is wrong): {{{ commit 0a532c6ba5df245aef4f2a127bd0e3ae40048334 Author: Paolo Capriotti p.caprio...@gmail.com Date: Wed Mar 28 16:11:34 2012 +0100 Do not re-encode correctly encoded inputs and arguments (#5795) }}} I added a testcase which generates a file with a utf-8 encoded name at runtime. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? --+- Reporter: j.waldmann | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.6.1 Component: GHCi |Version: 7.4.1 Resolution: fixed| Keywords: Os: Linux| Architecture: x86_64 (amd64) Failure: None/Unknown | Difficulty: Unknown Testcase: ghci/scripts/T5975{a,b} | Blockedby: Blocking: |Related: --+- Comment(by pcapriotti): Pushed the race condition fix as well, no need for a testcase, since `break011` catches this one nicely after the above fix (at least on my system). {{{ commit e8dbeed6f95f94ed7b6694a268e5227049546fed Author: Paolo Capriotti p.caprio...@gmail.com Date: Thu Mar 29 23:19:04 2012 +0100 Fix a race condition in the GHCi debugger exposed by testcase break011. }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? ---+ Reporter: j.waldmann | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi| Version: 7.4.1 Keywords: | Os: Linux Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | ---+ Comment(by simonmar): `5975.patch` looks fine - I think the previous encoding/decoding was to handle Unicode filenames before we got support for them in the IO library. We should have a test for this too, though I'm not sure whether it will work to add a file with non-ASCII chars to the repo, it might be safer to generate one when we run the test. Good catch on the race condition. I don't remember all the details here. It looks like exceptionFlag should be per-thread. But if your patch works around it and all the tests pass then I'm happy for it to go in. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? ---+ Reporter: j.waldmann | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi| Version: 7.4.1 Keywords: | Os: Linux Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | ---+ Comment(by pcapriotti): The patch for this issue does fix the problem, but uncovers a nasty race condition in the GHCi debugger. Here's the scenario: 1. -fbreak-on-exception is on 2. `runStmt` spawns a thread to evaluate a computation 3. the computation throws, and consequently stays blocked on its `breakMVar` 4. a module is loaded, which kills the thread from step 2, waking it up 5. a new computation is started, which can set exceptionFlag back to 1 before the previous thread terminates, interfering with the global state in an unpredictable way This is happening even before my patch for the encoding bug, but it was a lot harder to reproduce. The patch made the module loading code faster, so now it can be reproduced rather easily on the testcase break011. The solution seems to be to just wait in step 4 until the killed thread terminates, by taking its statusMVar. Patch attached. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? --+- Reporter: j.waldmann| Owner: Type: bug | Status: new Priority: normal| Component: GHCi Version: 7.4.1 | Keywords: Os: Linux | Architecture: x86_64 (amd64) Failure: None/Unknown | Testcase: Blockedby:| Blocking: Related:| --+- Comment(by j.waldmann): http://article.gmane.org/gmane.comp.lang.haskell.cafe/97474 I looks like GHC correctly decodes command line parameters and then truncates them to 8-bit. {{{ $ ghci ффф command line: Could not find module `DDD' fromEnum 'ф' `mod` 256 == fromEnum 'D' True }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #5975: ghci can't load file whose name contains non-ASCII chars?
#5975: ghci can't load file whose name contains non-ASCII chars? ---+ Reporter: j.waldmann | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi| Version: 7.4.1 Keywords: | Os: Linux Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | ---+ Changes (by pcapriotti): * status: new = patch * difficulty: = Unknown Comment: The attached patch fixes the problem. I'm not quite sure what the extra encoding/decoding step was for in the original code. As it stands, it just truncates input strings `Char` to `Word8`, so it breaks for non-ascii characters in utf-8 (say). -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5975#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs