Access Violation on Windows/MSystem #4

Open
opened 2023-10-30 14:01:31 +01:00 by yauhsien · 2 comments

I checked pcre-heavy standalone after pcre-light in the same way.
And the dependent package pcre-light was put in the working directory C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\.

Results observed:

  • PCRE-Light got tested well,
  • but PCRE-Heavy was not able to run/test due to some magical Access Violation.

Do you have any idea?

PS C:\Users\yauhsien> ghcup run -- stack --system-ghc unpack pcre-heavy
...
PS C:\Users\yauhsien> cd pcre-heavy-1.0.0.3
PS C:\Users\yauhsien\pcre-heavy-1.0.0.3> ghcup run -- stack --system-ghc init
...
PS C:\Users\yauhsien\pcre-heavy-1.0.0.3> ghcup run -- stack --system-ghc ghci
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\hstools\ghcup\cache\ghcup-0.0.7.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1'
[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.10.1.0'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1'
[ Info  ] verifying digest of: gs.exe
Configuring GHCi with the following packages: pcre-heavy.
GHCi, version 9.4.7: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Text.Regex.PCRE.Heavy ( C:\\Users\yauhsien\pcre-heavy-1.0.0.3\library\Text\Regex\PCRE\Heavy.hs, interpreted )
Ok, one module loaded.
Loaded GHCi configuration from C:\\Users\\yauhsien\\AppData\\Local\\stack\\ghci-script\\d304e762\\ghci-script
ghci> :show imports
import Text.Regex.PCRE.Heavy
:module +*Text.Regex.PCRE.Heavy -- added automatically
ghci> :set -XQuasiQuotes
ghci> :showi language
base language is: Haskell2010
with the following modifiers:
  -XExtendedDefaultRules
  -XNoMonomorphismRestriction
  -XQuasiQuotes
ghci> :set -XFlexibleContexts
ghci> "hello,world" =~ [re|^hello|]

Access violation in generated code when executing data at 0x7ff6a97c74e8

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x636b8fd940 0x7ff6a97c74e8 C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\libHSpcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf.a(#1:Light.o)+0x4d8
                 (pcrezmlightzm0zi4zi1zi2zmJw3i2ouFpx8J91ZZsmt8xHf_TextziRegexziPCREziLight_zdtrModule2_bytes+0xbed)
 * 0x636b8fd948 0x7ff6a98d03a1 C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\libHSpcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf.a(#1:Light.o)+0x391
                 (pcrezmlightzm0zi4zi1zi2zmJw3i2ouFpx8J91ZZsmt8xHf_TextziRegexziPCREziLight_zdwcompileM_info+0x46f)
 * 0x636b8fd950 0x181956a85b0
 * 0x636b8fd958 0x7ef40d1a3118

[ Error ] [GHCup-00841] Process "stack" with arguments ["--system-ghc",
[ ...   ]                                 "ghci"] failed with exit code 11.
PS C:\Users\yauhsien\pcre-light-0.4.1.2> ghcup run -- stack --system-ghc test
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\hstools\ghcup\cache\ghcup-0.0.7.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1'
[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.10.1.0'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1'
[ Info  ] verifying digest of: gs.exe
pcre-light-0.4.1.2: unregistering (missing dependencies: HUnit)
call-stack> configure
call-stack> Configuring call-stack-0.4.0...
call-stack> build
call-stack> Preprocessing library for call-stack-0.4.0..
call-stack> Building library for call-stack-0.4.0..
call-stack> [1 of 3] Compiling Data.SrcLoc
call-stack> [2 of 3] Compiling Data.CallStack
call-stack> [3 of 3] Compiling Paths_call_stack
call-stack> copy/register
call-stack> Installing library in C:\sr\snapshots\cb3b319d\lib\x86_64-windows-ghc-9.4.7\call-stack-0.4.0-Hc6gY95xqVh8RYzjDkIMB2
call-stack> Registering library for call-stack-0.4.0..
HUnit     > configure
HUnit     > Configuring HUnit-1.6.2.0...
HUnit     > build
HUnit     > Preprocessing library for HUnit-1.6.2.0..
HUnit     > Building library for HUnit-1.6.2.0..
HUnit     > [1 of 6] Compiling Paths_HUnit
HUnit     > [2 of 6] Compiling Test.HUnit.Lang
HUnit     > [3 of 6] Compiling Test.HUnit.Base
HUnit     > [4 of 6] Compiling Test.HUnit.Terminal
HUnit     > [5 of 6] Compiling Test.HUnit.Text
HUnit     > [6 of 6] Compiling Test.HUnit
HUnit     > copy/register
HUnit     > Installing library in C:\sr\snapshots\cb3b319d\lib\x86_64-windows-ghc-9.4.7\HUnit-1.6.2.0-BUKImNRq4Qd26C8LnFF2Q9
HUnit     > Registering library for HUnit-1.6.2.0..
pcre-light> configure (lib + test)
Configuring pcre-light-0.4.1.2...
pcre-light> build (lib + test)
Preprocessing library for pcre-light-0.4.1.2..
Building library for pcre-light-0.4.1.2..
Preprocessing test suite 'unit' for pcre-light-0.4.1.2..
Building test suite 'unit' for pcre-light-0.4.1.2..
[2 of 2] Linking .stack-work\\dist\\22605e11\\build\\unit\\unit.exe [Library changed]
pcre-light> copy/register
Installing library in C:\Users\yauhsien\pcre-light-0.4.1.2\.stack-work\install\c249d7d4\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Hh1jQ73N8DVGuop1qj7qnc
Registering library for pcre-light-0.4.1.2..
pcre-light> test (suite: unit)

Cases: 572  Tried: 572  Errors: 0  Failures: 0



pcre-light> Test suite unit passed
Completed 4 action(s).
I checked pcre-heavy standalone after pcre-light in the same way. And the dependent package `pcre-light` was put in the working directory `C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\`. Results observed: - PCRE-Light got tested well, - but PCRE-Heavy was not able to run/test due to some magical Access Violation. Do you have any idea? ``` PS C:\Users\yauhsien> ghcup run -- stack --system-ghc unpack pcre-heavy ... PS C:\Users\yauhsien> cd pcre-heavy-1.0.0.3 PS C:\Users\yauhsien\pcre-heavy-1.0.0.3> ghcup run -- stack --system-ghc init ... PS C:\Users\yauhsien\pcre-heavy-1.0.0.3> ghcup run -- stack --system-ghc ghci [ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\hstools\ghcup\cache\ghcup-0.0.7.yaml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 [ Warn ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1' [ Warn ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.10.1.0' [ Warn ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1' [ Info ] verifying digest of: gs.exe Configuring GHCi with the following packages: pcre-heavy. GHCi, version 9.4.7: https://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Text.Regex.PCRE.Heavy ( C:\\Users\yauhsien\pcre-heavy-1.0.0.3\library\Text\Regex\PCRE\Heavy.hs, interpreted ) Ok, one module loaded. Loaded GHCi configuration from C:\\Users\\yauhsien\\AppData\\Local\\stack\\ghci-script\\d304e762\\ghci-script ghci> :show imports import Text.Regex.PCRE.Heavy :module +*Text.Regex.PCRE.Heavy -- added automatically ghci> :set -XQuasiQuotes ghci> :showi language base language is: Haskell2010 with the following modifiers: -XExtendedDefaultRules -XNoMonomorphismRestriction -XQuasiQuotes ghci> :set -XFlexibleContexts ghci> "hello,world" =~ [re|^hello|] Access violation in generated code when executing data at 0x7ff6a97c74e8 Attempting to reconstruct a stack trace... Frame Code address * 0x636b8fd940 0x7ff6a97c74e8 C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\libHSpcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf.a(#1:Light.o)+0x4d8 (pcrezmlightzm0zi4zi1zi2zmJw3i2ouFpx8J91ZZsmt8xHf_TextziRegexziPCREziLight_zdtrModule2_bytes+0xbed) * 0x636b8fd948 0x7ff6a98d03a1 C:\sr\snapshots\4b89ac78\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf\libHSpcre-light-0.4.1.2-Jw3i2ouFpx8J91Zsmt8xHf.a(#1:Light.o)+0x391 (pcrezmlightzm0zi4zi1zi2zmJw3i2ouFpx8J91ZZsmt8xHf_TextziRegexziPCREziLight_zdwcompileM_info+0x46f) * 0x636b8fd950 0x181956a85b0 * 0x636b8fd958 0x7ef40d1a3118 [ Error ] [GHCup-00841] Process "stack" with arguments ["--system-ghc", [ ... ] "ghci"] failed with exit code 11. ``` ``` PS C:\Users\yauhsien\pcre-light-0.4.1.2> ghcup run -- stack --system-ghc test [ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\hstools\ghcup\cache\ghcup-0.0.7.yaml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 [ Warn ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1' [ Warn ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.10.1.0' [ Warn ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1' [ Info ] verifying digest of: gs.exe pcre-light-0.4.1.2: unregistering (missing dependencies: HUnit) call-stack> configure call-stack> Configuring call-stack-0.4.0... call-stack> build call-stack> Preprocessing library for call-stack-0.4.0.. call-stack> Building library for call-stack-0.4.0.. call-stack> [1 of 3] Compiling Data.SrcLoc call-stack> [2 of 3] Compiling Data.CallStack call-stack> [3 of 3] Compiling Paths_call_stack call-stack> copy/register call-stack> Installing library in C:\sr\snapshots\cb3b319d\lib\x86_64-windows-ghc-9.4.7\call-stack-0.4.0-Hc6gY95xqVh8RYzjDkIMB2 call-stack> Registering library for call-stack-0.4.0.. HUnit > configure HUnit > Configuring HUnit-1.6.2.0... HUnit > build HUnit > Preprocessing library for HUnit-1.6.2.0.. HUnit > Building library for HUnit-1.6.2.0.. HUnit > [1 of 6] Compiling Paths_HUnit HUnit > [2 of 6] Compiling Test.HUnit.Lang HUnit > [3 of 6] Compiling Test.HUnit.Base HUnit > [4 of 6] Compiling Test.HUnit.Terminal HUnit > [5 of 6] Compiling Test.HUnit.Text HUnit > [6 of 6] Compiling Test.HUnit HUnit > copy/register HUnit > Installing library in C:\sr\snapshots\cb3b319d\lib\x86_64-windows-ghc-9.4.7\HUnit-1.6.2.0-BUKImNRq4Qd26C8LnFF2Q9 HUnit > Registering library for HUnit-1.6.2.0.. pcre-light> configure (lib + test) Configuring pcre-light-0.4.1.2... pcre-light> build (lib + test) Preprocessing library for pcre-light-0.4.1.2.. Building library for pcre-light-0.4.1.2.. Preprocessing test suite 'unit' for pcre-light-0.4.1.2.. Building test suite 'unit' for pcre-light-0.4.1.2.. [2 of 2] Linking .stack-work\\dist\\22605e11\\build\\unit\\unit.exe [Library changed] pcre-light> copy/register Installing library in C:\Users\yauhsien\pcre-light-0.4.1.2\.stack-work\install\c249d7d4\lib\x86_64-windows-ghc-9.4.7\pcre-light-0.4.1.2-Hh1jQ73N8DVGuop1qj7qnc Registering library for pcre-light-0.4.1.2.. pcre-light> test (suite: unit) Cases: 572 Tried: 572 Errors: 0 Failures: 0 pcre-light> Test suite unit passed Completed 4 action(s). ```
Owner

I guess calling out to pcre at compile time (quasiquote) is busted somehow on windows? Interesting.

New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1

Yeah, that – Does this happen on latest ghc?

I guess calling out to pcre at compile time (quasiquote) is busted somehow on windows? Interesting. > New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1 Yeah, that – Does this happen on latest ghc?
Author

Same situation, by using ghc 9.6.3, the one but latest version of ghc by now.

I cannot figure out how to use ghc 9.8.1 while the latest version of Stack is nightly-2023-10-30 with ghc 9.6.3.

Same situation, by using `ghc 9.6.3`, the one but latest version of ghc by now. I cannot figure out how to use `ghc 9.8.1` while the latest version of Stack is `nightly-2023-10-30` with `ghc 9.6.3`.
Sign in to join this conversation.
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
valpackett/pcre-heavy#4
No description provided.