-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating index causes Segmentation fault #53
Comments
Is this a regression or is this the first time you're using this library? Also, what OS and GHC version? |
This is my setup:
|
I'm also interested to know if a recent change in the If you could modify the constraint for |
This is the first time trying the library. The OS is Ubuntu 16.04 and 18.04 The $ cat /proc/cpuinfo | grep flags
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
... I'll have a go at |
Pinning |
Actually I think stack lts-14.7 was already on |
Pinning to |
New problem; with
I'll revert back to 0.6.2.32 and try this again |
|
On the other machine, which actually has Here are the flags I used in the stack.yaml:
The The original problem still remains on the 16.04 machine, which has the following cpuinfo:
|
I am able to reproduce the problem in hw-json-simd HEAD, with this code added as {-# LANGUAGE OverloadedStrings #-}
import qualified HaskellWorks.Data.ByteString.Lazy as LBS
import HaskellWorks.Data.Json.Simd.Index.Standard
main :: IO ()
main = do
-- let res = makeStandardJsonIbBps "{}"
let res = makeStandardJsonIbBps . LBS.resegmentPadded 512 $ "{}"
case res of
Right chunks -> do
putStrLn $ "Chunks:"
let triggerBug = True
if triggerBug then putStrLn $ show (length chunks) else pure ()
err ->
putStrLn $ "No chunks: " ++ show err $ ./project.sh test
Build profile: -w ghc-8.0.2 -O2
In order, the following will be built (use -v for more details):
- hw-json-simd-0.1.0.2 (test:hw-json-simd-test) (file test/Spec.hs changed)
Preprocessing test suite 'hw-json-simd-test' for hw-json-simd-0.1.0.2..
Building test suite 'hw-json-simd-test' for hw-json-simd-0.1.0.2..
[2 of 2] Compiling Main ( test/Spec.hs, /home/chrberen/github/hw-json-simd/dist-newstyle/build/x86_64-linux/ghc-8.0.2/hw-json-simd-0.1.0.2/t/hw-json-simd-test/opt/build/hw-json-simd-test/hw-json-simd-test-tmp/Main.o )
Linking /home/chrberen/github/hw-json-simd/dist-newstyle/build/x86_64-linux/ghc-8.0.2/hw-json-simd-0.1.0.2/t/hw-json-simd-test/opt/build/hw-json-simd-test/hw-json-simd-test ...
Running 1 test suites...
Test suite hw-json-simd-test: RUNNING...
Test suite hw-json-simd-test: FAIL
Test suite logged to:
/home/chrberen/github/hw-json-simd/dist-newstyle/build/x86_64-linux/ghc-8.0.2/hw-json-simd-0.1.0.2/t/hw-json-simd-test/opt/test/hw-json-simd-0.1.0.2-hw-json-simd-test.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Tests failed for test:hw-json-simd-test from hw-json-simd-0.1.0.2. Disabling the computation of Not doing the |
The ergonomics of figuring out why something fails is not so good :( |
Is there an EC2 instance or where this happens? |
Try this:
|
Both invocations of a.out segfaults on the machines in question (They are not available in EC2)
|
The previous gdb backtrace was for the Backtrace for the
|
Assembly, if this is of any use:
|
I suspect this is a memory alignment problem. |
Here is some evidence suggesting alignment of the
There seems to be a pattern between the |
The |
Thanks so much for your PR. There's one remaining thing that worries me, and that is I don't have a means to regression test any future code changes given that this seems to be either compiler or architecture specific. |
Just to clarify, the a.out segfaults were fixed by aligning the buffers, but |
Good point. I'm guessing that it's possible to do that by adding a wrapper around |
|
After installing with:
$ cabal new-install hw-json-simd
, running the example causes a segmentation fault.The same happens with
--method standard
(and larger json input than this ;)This is an attempt at stripping down a problem I had with using
fromByteStringViaSimd
fromhw-json
where it also segfaults. The same code usingfromByteStringViaBlanking
works fine.The
fromByteStringViaSimd
problem was tested on two different x86 machines (one without bmi2 support)Looking at the code, the
fromByteStringViaSimd
seems to attempt to safeguard on the CPU capabilities, maybe it is not working as intended?I also tried to pass diverse flags (via stack.yaml) to enable
sse42
,bmi2
andavx2
for various packages in thehw-
ecosystem, without luck :(The text was updated successfully, but these errors were encountered: