Crystal: "Invalid memory access" exception when building with debug flag (using 0.25)

Created on 15 Jun 2018  Â·  10Comments  Â·  Source: crystal-lang/crystal

After I updated Mint to use 0.25, I got the following error when compiling with the debug flag enabled -d:

➜  mint git:(crystal-next) ✗ crystal build src/mint.cr -o mint -p -d
Invalid memory access (signal 11) at address 0x1c     
[0x7f6a7b488446] ???
[0x7f6a7ab6887a] ???
[0x7f6a7c8d0da9] ???
cc: error: _main.o: No such file or directory         
cc: error: S-lice40U-I-nt841.o: No such file or directory
cc: error: P-ointer40U-I-nt841.o: No such file or directory
cc: error: A-rgumentE-rror.o: No such file or directory
cc: error: C-allS-tack.o: No such file or directory
cc: error: A-rray40P-ointer40V-oid4141.o: No such file or directory
cc: error: P-ointer40P-ointer40V-oid4141.o: No such file or directory
cc: error: E-xception.o: No such file or directory
cc: error: P-ointer40L-ibU-nwind5858E-xception41.o: No such file or directory
cc: error: U-I-nt64.o: No such file or directory
cc: error: U-I-nt8.o: No such file or directory
cc: error: D-ir.o: No such file or directory
cc: error: C-rystal5858S-ystem5858D-ir.o: No such file or directory
cc: error: E-rrno.o: No such file or directory
cc: error: S-tring5858B-uilder.o: No such file or directory
cc: error: S-tring.o: No such file or directory
cc: error: G-C-.o: No such file or directory
cc: error: S-lice40T-41.o: No such file or directory
cc: error: I-O-5858E-ncoder.o: No such file or directory
cc: error: I-conv.o: No such file or directory
cc: error: M-ath.o: No such file or directory
cc: error: I-nt32.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432102441.o: No such file or directory
cc: error: I-ndexE-rror.o: No such file or directory
cc: error: C-har.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432441.o: No such file or directory
cc: error: I-nvalidB-yteS-equenceE-rror.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt8443212941.o: No such file or directory
cc: error: D-ivisionB-yZ-eroE-rror.o: No such file or directory
cc: error: A-rray40S-tring41.o: No such file or directory
cc: error: P-ointer40S-tring41.o: No such file or directory
cc: error: P-ointer40V-oid41.o: No such file or directory
cc: error: P-roc40I-nt324432N-il41.o: No such file or directory
cc: error: S-taticA-rray40I-nt8443225641.o: No such file or directory
cc: error: P-ointer40I-nt841.o: No such file or directory
cc: error: F-iber.o: No such file or directory
cc: error: T-hread.o: No such file or directory
cc: error: S-et40T-hread41.o: No such file or directory
cc: error: H-ash40T-hread4432N-il41.o: No such file or directory
cc: error: P-ointer40H-ash58-5c8fd5776cf345ec94b91bf7a5f7e50f.o: No such file or directory
cc: error: A-rray40I-nt3241.o: No such file or directory
cc: error: P-ointer40I-nt3241.o: No such file or directory
cc: error: C-rystal5858H-asher.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt644432241.o: No such file or directory
cc: error: P-ointer40U-I-nt6441.o: No such file or directory
cc: error: H-ash5858E-ntry40T-hread4432N-il41.o: No such file or directory
cc: error: N-il.o: No such file or directory
cc: error: D-eque40F-iber41.o: No such file or directory
cc: error: P-ointer40F-iber41.o: No such file or directory
cc: error: E-vent5858B-ase.o: No such file or directory
cc: error: F-ile5858P-ermissions.o: No such file or directory
cc: error: A-rray40T-uple40U-I-nt644432I-nt164432I-nt164141.o: No such file or directory
cc: error: P-ointer40T-uple40U-I-nt644432I-nt164432I-nt164141.o: No such file or directory
cc: error: A-rray40F-loat585-7322d6c8fe1296c88edebdcd115c89ad.o: No such file or directory
cc: error: P-ointer40F-loat5-36d63b0ae213f3427e187530ef6f5ab5.o: No such file or directory
cc: error: F-loat5858P-rinter5858C-achedP-owers5858P-ower.o: No such file or directory
cc: error: R-andom5858S-ecure.o: No such file or directory
cc: error: C-rystal5858S-ystem5858R-andom.o: No such file or directory
cc: error: T-ime5858S-pan.o: No such file or directory
cc: error: I-nt64.o: No such file or directory
cc: error: S-cheduler.o: No such file or directory
cc: error: E-vent5858E-vent.o: No such file or directory
cc: error: L-ibC-5858T-imeval.o: No such file or directory
cc: error: I-O-5858F-ileD-escriptor.o: No such file or directory
cc: error: C-rystal5858S-ystem5858F-ileD-escriptor.o: No such file or directory
cc: error: I-O-5858F-ileD-escriptor43.o: No such file or directory
cc: error: I-O-5858E-rror.o: No such file or directory
cc: error: L-ibE-vent25858E-ventF-lags.o: No such file or directory
cc: error: I-O-5858T-imeout.o: No such file or directory
cc: error: R-ange40B-4432E-41.o: No such file or directory
cc: error: R-ange40I-nt324432I-nt3241.o: No such file or directory
cc: error: E-xception43.o: No such file or directory
cc: error: E-N-V-.o: No such file or directory
cc: error: F-ile.o: No such file or directory
cc: error: C-rystal5858S-ystem5858F-ile.o: No such file or directory
cc: error: C-har5858R-eader.o: No such file or directory
cc: error: U-I-nt32.o: No such file or directory
cc: error: F-ile43.o: No such file or directory
cc: error: D-ebug5858E-L-F-.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858E-rror.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858E-ndianness.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858O-S-A-B-I-.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432409641.o: No such file or directory
cc: error: I-O-5858E-O-F-E-rror.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858I-dent.o: No such file or directory
cc: error: U-I-nt16.o: No such file or directory
cc: error: I-O-5858B-yteF-ormat5858B-igE-ndian.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432241.o: No such file or directory
cc: error: I-O-5858B-yteF-ormat5858L-ittleE-ndian.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858K-lass.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432841.o: No such file or directory
cc: error: A-rray40D-ebug5858E-L-F-5858S-ectionH-eader41.o: No such file or directory
cc: error: P-ointer40D-ebug5858E-L-F-5858S-ectionH-eader41.o: No such file or directory
cc: error: I-O-5858S-eek.o: No such file or directory
cc: error: D-ebug5858E-L-F-5858S-ectionH-eader.o: No such file or directory
cc: error: I-O-5858D-ecoder.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-ineN-umbers.o: No such file or directory
cc: error: A-rray40A-rray40D-d5580c0e9cb0bd8af7e90c96221706e1.o: No such file or directory
cc: error: P-ointer40A-rray4-6533bdad81433bcf155b99ac74756686.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-ineN-umbers5858S-equence.o: No such file or directory
cc: error: A-rray40T-uple40S-5992430a1a7ef1627717adfb71332538.o: No such file or directory
cc: error: P-ointer40T-uple4-13415771527eed75ea796bf4f3711255.o: No such file or directory
cc: error: A-rray40U-I-nt841.o: No such file or directory
cc: error: I-nt8.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432141.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-ineN-umbers5858R-egister.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-ineN-umbers5858R-ow.o: No such file or directory
cc: error: A-rray40D-ebug585-1d195a7f864d2d3790ebeadd84b7a4df.o: No such file or directory
cc: error: P-ointer40D-ebug5-a50eac5c43900f6bca76f68ff8c8549d.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-N-E-.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858L-N-S-.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858S-trings.o: No such file or directory
cc: error: A-rray40T-uple40U-997f9e533f193da5e605a2014e7947d9.o: No such file or directory
cc: error: P-ointer40T-uple4-aa2454898accd295538d997a0365d41d.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858I-nfo.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858A-bbrev.o: No such file or directory
cc: error: A-rray40D-ebug5858D-W-A-R-F-5858A-bbrev41.o: No such file or directory
cc: error: P-ointer40D-ebug5858D-W-A-R-F-5858A-bbrev41.o: No such file or directory
cc: error: A-rray40D-ebug585-b448de41619185732a02b2b0c778beb9.o: No such file or directory
cc: error: P-ointer40D-ebug5-038cd8f166075bfacc819464bf65667a.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858A-bbrev5858A-ttribute.o: No such file or directory
cc: error: A-rray40T-uple40D-2934b2835f929d23ac3adb7e5b7b0afe.o: No such file or directory
cc: error: P-ointer40T-uple4-6ff119ef58145d1144587389190a4e25.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858F-O-R-M-.o: No such file or directory
cc: error: U-nicode.o: No such file or directory
cc: error: U-nicode5858C-aseO-ptions.o: No such file or directory
cc: error: A-rray40T-uple40I-nt324432I-nt324432I-nt324141.o: No such file or directory
cc: error: P-ointer40T-uple40I-nt324432I-nt324432I-nt324141.o: No such file or directory
cc: error: H-ash40I-nt324432-c36c7b59ada9577e04b34b7156d26117.o: No such file or directory
cc: error: P-ointer40H-ash58-20170b0dcbfcdda132d3c3911ed0b4b4.o: No such file or directory
cc: error: H-ash5858E-ntry40-ea883736b6a497e8c0f2d29083b2162a.o: No such file or directory
cc: error: A-rray40T-uple40I-nt324432I-nt324141.o: No such file or directory
cc: error: P-ointer40T-uple40I-nt324432I-nt324141.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858T-A-G-.o: No such file or directory
cc: error: D-ebug5858D-W-A-R-F-5858A-T-.o: No such file or directory
cc: error: B-ool.o: No such file or directory
cc: error: T-ypeC-astE-rror.o: No such file or directory
cc: error: S-tring5858T-oU-64I-nfo.o: No such file or directory
cc: error: P-roc40F-iber4432-6eb246a0a45118d3c5507cc830b14a70.o: No such file or directory
cc: error: C-rystal5858S-ystem5858F-ileI-nfo.o: No such file or directory
cc: error: F-ile5858T-ype.o: No such file or directory
cc: error: P-ointer40P-ointer40U-I-nt84141.o: No such file or directory
cc: error: S-ignal.o: No such file or directory
cc: error: A-tomic40I-nt3241.o: No such file or directory
cc: error: C-rystal5858S-ignal.o: No such file or directory
cc: error: I-O-.o: No such file or directory
cc: error: S-taticA-rray40I-nt324432241.o: No such file or directory
cc: error: H-ash40S-ignal4432P-roc40S-ignal4432N-il4141.o: No such file or directory
cc: error: P-ointer40H-ash58-ac8d12c9042874d67c1e049ddde35350.o: No such file or directory
cc: error: C-rystal.o: No such file or directory
cc: error: C-rystal5858S-ignalC-hildH-andler.o: No such file or directory
cc: error: M-utex.o: No such file or directory
cc: error: H-ash40I-nt324432C-hannel5858B-uffered40I-nt324141.o: No such file or directory
cc: error: P-ointer40H-ash58-095509ed59997c43e011528a6c377785.o: No such file or directory
cc: error: H-ash5858E-ntry40-368e077722ae36e1511b439a12173e84.o: No such file or directory
cc: error: C-hannel5858B-uffered40I-nt3241.o: No such file or directory
cc: error: C-hannel5858C-losedE-rror.o: No such file or directory
cc: error: D-eque40I-nt3241.o: No such file or directory
cc: error: H-ash40I-nt324432I-nt3241.o: No such file or directory
cc: error: P-ointer40H-ash58-9b78843f20928b25581d76c59bcb4bdd.o: No such file or directory
cc: error: H-ash5858E-ntry40I-nt324432I-nt3241.o: No such file or directory
cc: error: H-ash5858E-ntry40-37a9b13947932e73bc9389d755897071.o: No such file or directory
cc: error: R-andom5858P-C-G-32.o: No such file or directory
cc: error: R-ange40U-I-nt644432U-I-nt6441.o: No such file or directory
cc: error: H-ash40S-tring4432T-ime5858L-ocation41.o: No such file or directory
cc: error: P-ointer40H-ash58-e79adbc146f0b9a7e6fc8ba71f02abe8.o: No such file or directory
cc: error: A-rray40T-ime5858L-ocation5858Z-one41.o: No such file or directory
cc: error: P-ointer40T-ime5858L-ocation5858Z-one41.o: No such file or directory
cc: error: T-ime5858L-ocation5858Z-one.o: No such file or directory
cc: error: T-ime5858L-ocatio-c92d7ae948ed8f4d38520c6d460d1469.o: No such file or directory
cc: error: T-ime5858L-ocation.o: No such file or directory
cc: error: A-rray40T-ime5858L-ocation5858Z-oneT-ransition41.o: No such file or directory
cc: error: P-ointer40T-ime5858L-ocation5858Z-oneT-ransition41.o: No such file or directory
cc: error: H-ash5858E-ntry40S-tring4432T-ime5858L-ocation41.o: No such file or directory
cc: error: H-ash40S-tring443-d0ef6a484ca24b5e9e1cd150630d96a3.o: No such file or directory
cc: error: P-ointer40H-ash58-a3b9fda8e5bbd4ef99434d586a219a98.o: No such file or directory
cc: error: H-ash40U-I-nt324432S-ymbol41.o: No such file or directory
cc: error: P-ointer40H-ash58-02cd513a5424ff695b5edac7dfac5c29.o: No such file or directory
cc: error: H-ash5858E-ntry40U-I-nt324432S-ymbol41.o: No such file or directory
cc: error: H-ash40S-ymbol4432U-I-nt3241.o: No such file or directory
cc: error: P-ointer40H-ash58-1af04825ec9091dd5257e4f2d015e54e.o: No such file or directory
cc: error: S-ymbol.o: No such file or directory
cc: error: H-ash5858E-ntry40S-ymbol4432U-I-nt3241.o: No such file or directory
cc: error: L-ogger5858S-everity.o: No such file or directory
cc: error: I-O-43.o: No such file or directory
cc: error: Z-lib5858W-riter.o: No such file or directory
cc: error: H-T-T-P-5858S-erver5858R-esponse5858O-utput.o: No such file or directory
cc: error: H-T-T-P-5858H-eaders.o: No such file or directory
cc: error: H-T-T-P-5858H-eaders5858K-ey.o: No such file or directory
cc: error: H-ash40H-T-T-P-58-41c1f5416a58e3dc1fda537ff9025bc1.o: No such file or directory
cc: error: P-ointer40H-ash58-dd9a6e4d9abdd280a27441daa00f6c79.o: No such file or directory
cc: error: H-ash5858E-ntry40-d0d0f6cf0294ca93e95889559764778b.o: No such file or directory
cc: error: H-T-T-P-5858S-erver5858R-esponse.o: No such file or directory
cc: error: H-T-T-P-5858C-ookies.o: No such file or directory
cc: error: H-ash40S-tring4432H-T-T-P-5858C-ookie41.o: No such file or directory
cc: error: P-ointer40H-ash58-7f71784838e8b236fae65568b2cec8a7.o: No such file or directory
cc: error: A-rray40H-T-T-P-5858C-ookie41.o: No such file or directory
cc: error: P-ointer40H-T-T-P-5858C-ookie41.o: No such file or directory
cc: error: H-T-T-P-5858C-ookie.o: No such file or directory
cc: error: U-R-I-.o: No such file or directory
cc: error: T-uple40C-har4432C-har4432C-har4432C-har41.o: No such file or directory
cc: error: H-T-T-P-.o: No such file or directory
cc: error: T-ime5858F-ormat5858H-T-T-P-_D-A-T-E-.o: No such file or directory
cc: error: T-ime.o: No such file or directory
cc: error: T-ime5858L-ocation5858Z-oneT-ransition.o: No such file or directory
cc: error: T-ime5858F-ormat5858F-ormatter.o: No such file or directory
cc: error: T-uple40I-nt32443-ae04c9525469ed0d0491c8672a000146.o: No such file or directory
cc: error: O-penS-S-L-5858S-S-L-5858S-ocket43.o: No such file or directory
cc: error: O-penS-S-L-5858S-S-L-5858E-rror.o: No such file or directory
cc: error: L-ibS-S-L-5858S-S-L-E-rror.o: No such file or directory
cc: error: F-late5858W-riter.o: No such file or directory
cc: error: S-taticA-rray40U-I-nt84432819241.o: No such file or directory
cc: error: Z-lib5858R-eader.o: No such file or directory
cc: error: H-T-T-P-5858W-ebS-4cb2ca367ffc5472ff9cc10ba3782e30.o: No such file or directory
cc: error: H-T-T-P-5858W-ebS-ocket5858P-rotocol.o: No such file or directory
cc: error: S-ocket43.o: No such file or directory
cc: error: F-ile5858P-R-eader.o: No such file or directory
cc: error: I-O-5858S-tapled.o: No such file or directory
cc: error: I-O-5858M-emory.o: No such file or directory
cc: error: H-T-T-P-5858C-hunkedC-ontent.o: No such file or directory
cc: error: H-T-T-P-5858U-nknownL-engthC-ontent.o: No such file or directory
cc: error: O-penS-S-L-5858D-igestI-O-.o: No such file or directory
cc: error: O-penS-S-L-5858D-igestI-O-5858D-igestM-ode.o: No such file or directory
cc: error: O-penS-S-L-5858D-igest.o: No such file or directory
cc: error: B-akedF-ileS-ystem5858B-akedF-ile.o: No such file or directory
cc: error: G-zip5858W-riter.o: No such file or directory
cc: error: L-ibZ-5858Z-S-tream.o: No such file or directory
cc: error: L-ibZ-5858E-rror.o: No such file or directory
cc: error: F-late5858E-rror.o: No such file or directory
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/gdot/Projects/mint-lang/mint/mint'  -rdynamic  `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -L/home/gdot/Projects/mint-lang/mint/lib/duktape/src/.build/lib -L/home/gdot/Projects/mint-lang/mint/lib/duktape/src/.build/include -lduktape -lm -lz -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

The failing code can be found at crystal-next branch https://github.com/mint-lang/mint/tree/crystal-next

Additional notes:

  • I've tried to compile with all the cache files (~/.cache/crystal) removed, and I got the same error.
  • Without the debug flag -d it compiles fine.
  • In 0.24.2 there was no error.

Steps to reproduce:

  • clone the repository and checkout the branch
  • shards deps
  • crystal build src/mint.cr -o mint -p -d

Crystal Info:

Crystal 0.25.0 [7fb783f7a] (2018-06-11)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu
bug compiler

Most helpful comment

The debug flag is only really useful when using gdb or lldb, or something else that wants to know details about every variable in the crystal program. For stacktraces and the like, the default is to emit line number information, which is useful for stacktraces.

This is definitely a bug still. Looks like the compiler was built in release mode and stripped here though, so I'll see if I can reproduce it myself:

Invalid memory access (signal 11) at address 0x1c     
[0x7f6a7b488446] ???
[0x7f6a7ab6887a] ???
[0x7f6a7c8d0da9] ???

All 10 comments

Out of curiosity, why do you use the debug flag?

No special reason, I just thought it might give more information if something fails and there is an exception.

The debug flag is only really useful when using gdb or lldb, or something else that wants to know details about every variable in the crystal program. For stacktraces and the like, the default is to emit line number information, which is useful for stacktraces.

This is definitely a bug still. Looks like the compiler was built in release mode and stripped here though, so I'll see if I can reproduce it myself:

Invalid memory access (signal 11) at address 0x1c     
[0x7f6a7b488446] ???
[0x7f6a7ab6887a] ???
[0x7f6a7c8d0da9] ???

I was going to ask the same: what are using passing -d for? lldb and gdb support is really poor at the moment (I think you can just see the value of primitive values, and maybe not even that), so there's absolutely no use for the -d flag yet.

Thank you both, I'll stop using -d then :smile:

Here's the full error with a non-release compiler (and seemingly LLVM with assertions?):

$ /data/programming/crystal-lang/crystal/master/bin/crystal build src/mint.cr -o mint -p -d
Using compiled compiler at `.build/crystal'
Module validation failed: conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_835, metadata !1910, metadata !DIExpression()), !dbg !1909
!1892 = !DILocalVariable(name: "self", arg: 1, scope: !1890, file: !1891, line: 6, type: !1893)
!1910 = !DILocalVariable(name: "__temp_835", arg: 1, scope: !1890, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"TreeTemplate::Tagger"** %t1, metadata !8975, metadata !DIExpression()), !dbg !8974
!8889 = !DILocalVariable(name: "self", arg: 1, scope: !8887, file: !8888, line: 27, type: !8890)
!8975 = !DILocalVariable(name: "t", arg: 1, scope: !8887, file: !8888, line: 27, type: !8976)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"TreeTemplate::Tagger"* %__temp_2150, metadata !9009, metadata !DIExpression()), !dbg !9007
!9008 = !DILocalVariable(name: "self", arg: 1, scope: !9005, file: !8888, line: 30, type: !8890)
!9009 = !DILocalVariable(name: "__temp_2150", arg: 1, scope: !9005, file: !8888, line: 30, type: !8976)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"TreeTemplate::Tagger"* %__temp_2151, metadata !9016, metadata !DIExpression()), !dbg !9013
!9015 = !DILocalVariable(name: "self", arg: 1, scope: !9012, file: !8888, line: 31, type: !8890)
!9016 = !DILocalVariable(name: "__temp_2151", arg: 1, scope: !9012, file: !8888, line: 31, type: !8976)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"TreeTemplate::Tagger"* %__temp_2159, metadata !9047, metadata !DIExpression()), !dbg !9045
!9046 = !DILocalVariable(name: "self", arg: 1, scope: !9043, file: !8888, line: 62, type: !8890)
!9047 = !DILocalVariable(name: "__temp_2159", arg: 1, scope: !9043, file: !8888, line: 62, type: !8976)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_2260, metadata !9133, metadata !DIExpression()), !dbg !9132
!9129 = !DILocalVariable(name: "self", arg: 1, scope: !9128, file: !1891, line: 6, type: !9130)
!9133 = !DILocalVariable(name: "__temp_2260", arg: 1, scope: !9128, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_2923, metadata !9203, metadata !DIExpression()), !dbg !9202
!9199 = !DILocalVariable(name: "self", arg: 1, scope: !9198, file: !1891, line: 6, type: !9200)
!9203 = !DILocalVariable(name: "__temp_2923", arg: 1, scope: !9198, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_3068, metadata !9429, metadata !DIExpression()), !dbg !9428
!9425 = !DILocalVariable(name: "self", arg: 1, scope: !9424, file: !1891, line: 6, type: !9426)
!9429 = !DILocalVariable(name: "__temp_3068", arg: 1, scope: !9424, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_3084, metadata !9439, metadata !DIExpression()), !dbg !9438
!9435 = !DILocalVariable(name: "self", arg: 1, scope: !9434, file: !1891, line: 6, type: !9436)
!9439 = !DILocalVariable(name: "__temp_3084", arg: 1, scope: !9434, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_3107, metadata !9449, metadata !DIExpression()), !dbg !9448
!9445 = !DILocalVariable(name: "self", arg: 1, scope: !9444, file: !1891, line: 6, type: !9446)
!9449 = !DILocalVariable(name: "__temp_3107", arg: 1, scope: !9444, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::Server::Context"* %__temp_3115, metadata !9608, metadata !DIExpression()), !dbg !9607
!9606 = !DILocalVariable(name: "self", arg: 1, scope: !9605, file: !9455, line: 104, type: !9469)
!9608 = !DILocalVariable(name: "__temp_3115", arg: 1, scope: !9605, file: !9455, line: 104, type: !9609)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::Server::Context"* %env, metadata !9692, metadata !DIExpression()), !dbg !9689
!9690 = !DILocalVariable(name: "self", arg: 1, scope: !9688, file: !9455, line: 108, type: !9469)
!9692 = !DILocalVariable(name: "env", arg: 1, scope: !9688, file: !9455, line: 108, type: !9609)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::Server::Context"* %env, metadata !9752, metadata !DIExpression()), !dbg !9751
!9750 = !DILocalVariable(name: "self", arg: 1, scope: !9749, file: !9455, line: 142, type: !9469)
!9752 = !DILocalVariable(name: "env", arg: 1, scope: !9749, file: !9455, line: 142, type: !9609)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::WebSocket"** %socket1, metadata !9771, metadata !DIExpression()), !dbg !9770
!9769 = !DILocalVariable(name: "self", arg: 1, scope: !9768, file: !9455, line: 147, type: !9469)
!9771 = !DILocalVariable(name: "socket", arg: 1, scope: !9768, file: !9455, line: 147, type: !9481)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_3790, metadata !10108, metadata !DIExpression()), !dbg !10107
!10104 = !DILocalVariable(name: "self", arg: 1, scope: !10103, file: !1891, line: 6, type: !10105)
!10108 = !DILocalVariable(name: "__temp_3790", arg: 1, scope: !10103, file: !1891, line: 6, type: !14)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::Server::Context"* %__temp_3793, metadata !10141, metadata !DIExpression()), !dbg !10140
!10115 = !DILocalVariable(name: "self", arg: 1, scope: !10113, file: !10114, line: 221, type: !10116)
!10141 = !DILocalVariable(name: "__temp_3793", arg: 1, scope: !10113, file: !10114, line: 221, type: !9609)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::Server::Context"* %__temp_3795, metadata !10152, metadata !DIExpression()), !dbg !10151
!10150 = !DILocalVariable(name: "self", arg: 1, scope: !10149, file: !10114, line: 231, type: !10116)
!10152 = !DILocalVariable(name: "__temp_3795", arg: 1, scope: !10149, file: !10114, line: 231, type: !9609)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %"HTTP::WebSocket"* %socket, metadata !10156, metadata !DIExpression()), !dbg !10155
!10154 = !DILocalVariable(name: "self", arg: 1, scope: !10153, file: !10114, line: 235, type: !10116)
!10156 = !DILocalVariable(name: "socket", arg: 1, scope: !10153, file: !10114, line: 235, type: !9481)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata %String* %message, metadata !10167, metadata !DIExpression()), !dbg !10162
!10163 = !DILocalVariable(name: "self", arg: 1, scope: !10161, file: !10114, line: 238, type: !10116)
!10167 = !DILocalVariable(name: "message", arg: 1, scope: !10161, file: !10114, line: 238, type: !1154)
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32 %__temp_3836, metadata !10234, metadata !DIExpression()), !dbg !10233
!10230 = !DILocalVariable(name: "self", arg: 1, scope: !10229, file: !1891, line: 6, type: !10231)
!10234 = !DILocalVariable(name: "__temp_3836", arg: 1, scope: !10229, file: !1891, line: 6, type: !14)

/data/programming/crystal-lang/crystal/master/src/llvm/module.cr:78:9 in 'verify'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:343:9 in 'finish'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:67:7 in 'codegen'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:63:5 in 'codegen:debug:single_module'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/compiler.cr:22:7 in 'codegen'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/compiler.cr:145:16 in 'compile'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:264:7 in 'compile'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:262:5 in 'compile'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:164:5 in 'build'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:69:7 in 'run'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:48:5 in 'run'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal/command.cr:47:3 in 'run'
/data/programming/crystal-lang/crystal/master/src/compiler/crystal.cr:8:1 in '__crystal_main'
/data/programming/crystal-lang/crystal/master/src/crystal/main.cr:104:5 in 'main_user_code'
/data/programming/crystal-lang/crystal/master/src/crystal/main.cr:93:7 in 'main'
/data/programming/crystal-lang/crystal/master/src/crystal/main.cr:133:3 in 'main'
__libc_start_main
_start
???

From #6271 , a short sample code to reproduce. #6271 will be closed.

require "option_parser"

class Foo
  getter args : Array(String)
  getter help : Bool = false

  def initialize(args = ARGV)
    @args = args
  end

  def parse
    OptionParser.parse(@args) do |parser|
      parser.on("-h", "--help", "Show this help") { @help = true }
    end
  end
end

pp Foo.new.parse

I get the same error on my project at https://github.com/LinCAS-lang/LinCAS when I compile it (no debug flag is used).
It just gives me as a message

Invalid memory access (signal 11) at address 0x7fff9d800d58
[0x55580ef9c0b6] ???
[0x55580e67b8ca] ???
[0x5558103e4a19] ???

and nothing more.
I have currently installed the version 0.25.1. I guess it's a bug which belongs to the 0.25.x versions, since with the previous ones everything worked fine.

P.S. I got the same error on Travis CI

@max-codeware if no debug flag is used, it's another bug. Please try to reduce your code and create another issue.

@asterite done in issue #6349

Was this page helpful?
0 / 5 - 0 ratings

Related issues

will picture will  Â·  3Comments

relonger picture relonger  Â·  3Comments

lgphp picture lgphp  Â·  3Comments

Sija picture Sija  Â·  3Comments

asterite picture asterite  Â·  3Comments