Re: [GHC] #3605: Dll's freeze with -threaded

2010-10-21 Thread GHC
#3605: Dll's freeze with -threaded
+---
  Reporter:  NeilMitchell   |  Owner:  simonmar
  Type:  bug| Status:  closed  
  Priority:  high   |  Milestone:  7.0.1   
 Component:  Documentation  |Version:  6.12.1 RC1  
Resolution:  fixed  |   Keywords:  
  Testcase: |  Blockedby:  
Difficulty:  Unknown| Os:  Unknown/Multiple
  Blocking: |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown   |  
+---
Changes (by igloo):

  * status:  merge => closed
  * resolution:  => fixed


Comment:

 Both merged.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-10-20 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  simonmar
Type:  bug   |   Status:  merge   
Priority:  high  |Milestone:  7.0.1   
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by simonmar):

  * status:  patch => merge


Comment:

 Applied (with fixes to markup), thanks!

 {{{
 Sun Oct 10 03:07:09 PDT 2010  Neil Mitchell
   * Update the documentation on using DLL's from Windows, fixing several
 errors, in particular those relating to bug 3605

 Wed Oct 20 05:31:16 PDT 2010  Simon Marlow 
   * fix markup
 }}}

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-10-11 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  simonmar
Type:  bug   |   Status:  patch   
Priority:  high  |Milestone:  7.0.1   
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by simonmar):

  * owner:  NeilMitchell => simonmar


Comment:

 Thanks Neil, I'll integrate it.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-10-10 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  patch   
Priority:  high  |Milestone:  7.0.1   
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by NeilMitchell):

  * status:  new => patch


Comment:

 Patch has been attached. Unfortunately I haven't been able to actually
 build and look at the documentation - I spent ages building on mingw only
 to find the documentation doesn't build on mingw, and I'm still going
 through contortions to get it building on cygwin. As a result, this patch
 is likely to have syntax errors.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-10-09 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  7.0.1   
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--

Comment(by NeilMitchell):

 Ok, will do - I'll make sure it's attached tomorrow morning.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-10-06 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  7.0.1   
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--

Comment(by simonmar):

 Neil - if you have the patch for this but haven't been able to test it due
 to tool issues, then feel free to just attach it here and we'll try to
 incorporate it.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-07-31 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.14.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:| Testcase:  
   Blockedby:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Blocking:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by kfrdbs):

 * cc: kfr...@… (added)


-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-07-19 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.14.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--

Comment(by jod):

 * [http://www.javascr.com free css hosting]
  * [http://www.pharmacieenfrance.fr Pharmacie sur internet]
  * [http://www.farmaciaespanola.es Farmacia Española]
  * [http://med-assistant.info Cheap Generics online]
  * [http://med-assistant.info/FR/ Medicaments en ligne]

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-06-19 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.14.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by igloo):

  * milestone:  6.12.3 => 6.14.1


-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-03-28 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.12.3  
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by igloo):

  * milestone:  6.12.2 => 6.12.3


Comment:

 Just a doc improvement, and Neil says he won't have time to finish it in
 the 6.12.2 timeframe, so punting.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2010-03-24 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  NeilMitchell
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.12.2  
   Component:  Documentation |  Version:  6.12.1 RC1  
Keywords:|   Difficulty:  Unknown 
  Os:  Unknown/Multiple  | Testcase:  
Architecture:  Unknown/Multiple  |  Failure:  None/Unknown
-+--
Changes (by igloo):

  * owner:  => NeilMitchell


-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-12-15 Thread GHC
#3605: Dll's freeze with -threaded
+---
  Reporter:  NeilMitchell   |  Owner:  
  Type:  bug| Status:  new 
  Priority:  high   |  Milestone:  6.12.2  
 Component:  Documentation  |Version:  6.12.1 RC1  
Resolution: |   Keywords:  
Difficulty:  Unknown| Os:  Unknown/Multiple
  Testcase: |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown   |  
+---
Changes (by igloo):

  * milestone:  6.12.1 => 6.12.2

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-11-25 Thread GHC
#3605: Dll's freeze with -threaded
+---
  Reporter:  NeilMitchell   |  Owner:  
  Type:  bug| Status:  new 
  Priority:  high   |  Milestone:  6.12.1  
 Component:  Documentation  |Version:  6.12.1 RC1  
Resolution: |   Keywords:  
Difficulty:  Unknown| Os:  Unknown/Multiple
  Testcase: |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown   |  
+---
Comment (by duncan):

 Replying to [comment:9 NeilMitchell]:

 > I had a few questions:
 >
 > Is calling {{{hs_init}}} or {{{startupHaskell}}} preferred? I've gone
 with {{{hs_init}}} because that's in the FFI spec, but the current
 examples have both (which is just confusing).

 I would use {{{hs_init}}}. The other one is (or should be) deprecated.

 > Section 11.6.1 (which I left alone) says "it will rewrite occurrence of
 -lHSfoo on the command line to -lHSfoo.dll". It's really not clear if it's
 rewriting -l''foo'' to -l''foo''.dll, or -lHS''foo'' to -lHS''foo''.dll -
 and similarly for the HScool line. Italics to indicate meta variables is
 very handy.

 I would also check if this is actually true. I can't immediately see any
 evidence for it in the code.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-11-23 Thread GHC
#3605: Dll's freeze with -threaded
+---
  Reporter:  NeilMitchell   |  Owner:  
  Type:  bug| Status:  new 
  Priority:  high   |  Milestone:  6.12.1  
 Component:  Documentation  |Version:  6.12.1 RC1  
Resolution: |   Keywords:  
Difficulty:  Unknown| Os:  Unknown/Multiple
  Testcase: |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown   |  
+---
Changes (by NeilMitchell):

  * failure:  => None/Unknown

Comment:

 I've written revised documentation and put it on my blog:
 http://neilmitchell.blogspot.com/2009/11/haskell-dlls-on-windows.html

 After a short period of time I'll incorporate any comments, format it
 properly for the manual, and submit a patch.

 I had a few questions:

 Is calling {{{hs_init}}} or {{{startupHaskell}}} preferred? I've gone with
 {{{hs_init}}} because that's in the FFI spec, but the current examples
 have both (which is just confusing).

 Section 11.6.1 (which I left alone) says "it will rewrite occurrence of
 -lHSfoo on the command line to -lHSfoo.dll". It's really not clear if it's
 rewriting -l''foo'' to -l''foo''.dll, or -lHS''foo'' to -lHS''foo''.dll -
 and similarly for the HScool line. Italics to indicate meta variables is
 very handy.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-11-11 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.12.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by simonmar):

 Sounds great to me.  Thanks for offering to do this Neil!

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-11-10 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.12.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by NeilMitchell):

 I suggest the docs are rewritten to tell people never use DllMain, and
 just say that "calling either hs_init or hs_exit from DllMain may lead to
 program freezes - don't do it". That section also has two examples - one
 calling from C, and one from VBA. I suggest a complete rewrite showing how
 to create a single unified example DLL, then how to call it from both VBA
 and C++, never using DllMain in either case.

 If that sounds satisfactory, I'll make the changes to the docs and send a
 patch in.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-10-30 Thread GHC
#3605: Dll's freeze with -threaded
-+--
Reporter:  NeilMitchell  |Owner:  
Type:  bug   |   Status:  new 
Priority:  high  |Milestone:  6.12.1  
   Component:  Documentation |  Version:  6.12.1 RC1  
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by igloo):

  * priority:  normal => high
  * difficulty:  => Unknown
  * milestone:  => 6.12.1

Comment:

 Let's fix the docs for 6.12.1.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-10-22 Thread GHC
#3605: Dll's freeze with -threaded
--+-
 Reporter:  NeilMitchell  |  Owner:  
 Type:  bug   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  Compiler  |Version:  6.12.1 RC1  
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Comment (by augustss):

 Perhaps calling startupHaskell is from DllMain() is not allowed, but this
 is what the ghc documentation suggests that you do.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-10-22 Thread GHC
#3605: Dll's freeze with -threaded
--+-
 Reporter:  NeilMitchell  |  Owner:  
 Type:  bug   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  Compiler  |Version:  6.12.1 RC1  
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Comment (by duncan):

 My initial reaction is that calling `startupHaskell` from within `DllMain`
 is a tad dodgy. The [http://msdn.microsoft.com/en-
 us/library/ms682583(VS.85).aspx MSDN docs] say there are pretty severe
 limitations on what can be done in it. In particular no calls to
 LoadLibrary (or other functions that call LoadLibrary). This is because
 the `DllMain` is called with a loader lock. So this is one possibility
 that is consistent with the observed freeze.

 It also says:

 {{{
 Calling functions that require DLLs other than Kernel32.dll
 may result in problems that are difficult to diagnose. For
 example, calling User, Shell, and COM functions can cause
 access violation errors, because some functions load other
 system components.
 }}}

 So to determine if `startupHaskell` is safe would require a full audit of
 all the code it calls.

 Another approach would be to trace the library load and see what OS /
 library calls it is making.

 There are more reasons to suggest that `startupHaskell` cannot safely be
 run from within `DllMain`, the
 [http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx  MSDN Best
 Practices for Creating DLLs] document states that:

 {{{
 You should never perform the following tasks from within DllMain:
 }}}
 including:
 {{{
 Call CreateThread. Creating a thread can work if you do not
 synchronize with other threads, but it is risky.
 }}}

 Of course this is exactly what `startupHaskell` does, though only in the
 case of multiple capabilities.

 {{{
 Use the memory management function from the dynamic C
 Run-Time (CRT). If the CRT DLL is not initialized, calls
 to these functions can cause the process to crash.
 }}}

 I expect the rts does this too.

 Someone else should look this over but I suspect the thing to do is to
 change the user guide (section 11.6) to stop recommending calling
 `startupHaskell` inside `DllMain` and indeed to recommend never to do
 that.

-- 
Ticket URL: 
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] #3605: Dll's freeze with -threaded

2009-10-22 Thread GHC
#3605: Dll's freeze with -threaded
--+-
 Reporter:  NeilMitchell  |  Owner:  
 Type:  bug   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  Compiler  |Version:  6.12.1 RC1  
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Comment (by NeilMitchell):

 Please ignore HsDemo.2.hs, I clicked on the wrong file. Either HsDemo file
 will cause the freeze.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs