Guest User

Untitled

a guest
Oct 15th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.03 KB | None | 0 0
  1. <abort_> Hi
  2. <abort_> I'm trying to fill a bug report to the project
  3. <abort_> but I can't even register on the bugtracking system
  4. <abort_> because you have to send first an email somewhere, I already did that
  5. <abort_> but in the meantime perhaps someone can help me with my problem:
  6. <abort_> I'm trying to compile some stuff with emscripten to webassembly
  7. <abort_> emscripten uses LLVM as a backedn to generate WASM
  8. <abort_> nad links stuff with wasm-ld
  9. <abort_> but I'm seeing this error on several different projects now:
  10. <abort_> wasm-ld: /b/s/w/ir/cache/builder/emscripten-releases/llvm-project/llvm/include/llvm/Support/Casting.h:264: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = lld::wasm::FunctionSymbol, Y = const lld::wasm::Symbol]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
  11. <abort_> Stack dump:
  12. <abort_> 0. Program arguments: /src/emsdk/emsdk/upstream/bin/wasm-ld -o libf2c.bc --allow-undefined --lto-O0 f77vers.o i77vers.o -L/src/emsdk/emsdk/upstream/emscripten/system/local/lib s_rnge.o -L/src/emsdk/emsdk/upstream/emscripten/system/lib abort_.o -L/src/emsdk/emsdk/.emscripten_cache/wasm-obj exit_.o getarg_.o iargc_.o getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o ctype.o derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o pow_ci.o
  13. <abort_> pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o d_cnjg.o d_cos.o d_cosh.o
  14. <abort_> d_dim.o d_exp.o d_imag.o d_int.o d_lg10.o d_log.o d_mod.o d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o d_sqrt.o d_tan.o d_tanh.o i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_len_trim.o i_mod.o i_nint.o i_sign.o lbitbits.o lbitshft.o i_ceiling.o h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o ef1asc_.o ef1cmc_.o f77_aloc.o s_cat.o s_cmp.o s_copy.o backspac.o
  15. <abort_> close.o dfe.o dolio.o due.o endfile.o err.o fmt.o fmtlib.o ftell_.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o dtime_.o etime_.o --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export main
  16. <abort_> --export malloc --export free --export setThrew --export __errno_location --export fflush -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024 --relocatable
  17. <abort_> #0 0x00007f1dcc7cb0b4 PrintStackTraceSignalHandler(void*) (/src/emsdk/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x7000b4)
  18. <abort_> #1 0x00007f1dcc7c8e3e llvm::sys::RunSignalHandlers() (/src/emsdk/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x6fde3e)
  19. <abort_> #2 0x00007f1dcc7cb368 SignalHandler(int) (/src/emsdk/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x700368)
  20. <abort_> #3 0x00007f1dcf7528e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x128e0)
  21. <abort_> #4 0x00007f1dcbc12f3b raise (/lib/x86_64-linux-gnu/libc.so.6+0x35f3b)
  22. <abort_> #5 0x00007f1dcbc142f1 abort (/lib/x86_64-linux-gnu/libc.so.6+0x372f1)
  23. <abort_> #6 0x00007f1dcbc0ba8a (/lib/x86_64-linux-gnu/libc.so.6+0x2ea8a)
  24. <abort_> #7 0x00007f1dcbc0bb02 (/lib/x86_64-linux-gnu/libc.so.6+0x2eb02)
  25. <abort_> #8 0x00000000006e19f0 lld::wasm::GlobalSection::writeBody() (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6e19f0)
  26. <abort_> #9 0x00000000006d22aa lld::wasm::SyntheticSection::finalizeContents() (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6d22aa)
  27. <abort_> #10 0x00000000006cc638 (anonymous namespace)::Writer::run() (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6cc638)
  28. <abort_> #11 0x00000000006c51a1 lld::wasm::writeResult() (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6c51a1)
  29. <abort_> #12 0x00000000006a79bd (anonymous namespace)::LinkerDriver::link(llvm::ArrayRef<char const*>) (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6a79bd)
  30. <abort_> #13 0x00000000006a24d8 lld::wasm::link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&) (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x6a24d8)
  31. <abort_> #14 0x000000000041f45b main (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x41f45b)
  32. <abort_> #15 0x00007f1dcbbffb17 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x22b17)
  33. <abort_> #16 0x000000000041efe9 _start (/src/emsdk/emsdk/upstream/bin/wasm-ld+0x41efe9)
  34. <LebedevRI> yeah, maybe don't actually paste the entire backtrace into irc
  35. <AaronBallman> please do not put large pastes into the chat like that, use something like pastebin
  36. <abort_> sorry
  37. <AaronBallman> it happens :-)
  38. <abort_> I'm building llvm to see if I can debug the issue
  39. <abort_> but I have no clue about what it could be
  40. <LebedevRI> best to follow the guidelines stated on how to receive account
  41. <abort_> yes they tell you to send an email to request an account to some address
  42. <abort_> I already did that
  43. <jrtc27> else if (auto *f = cast<DefinedFunction>(sym))
  44. <jrtc27> change that to a dyn_cast, obviously broken
  45. <jrtc27> well, maybe the code does expect it to be one of the two, but it's written in a very misleading way if so
  46. <abort_> I'm not an expert in C++ and much less in cryptic c++ templates
  47. <abort_> :(
  48. <abort_> this is the code in Casting.h:264
  49. <abort_> only fouur lines)
  50. <abort_> template <class X, class Y>
  51. <abort_> inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  52. <abort_> assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");
  53. <abort_> return cast_convert_val<X, Y*,
  54. <abort_> typename simplify_type<Y*>::SimpleType>::doit(Val);
  55. <abort_> }
  56. <LebedevRI> you want to look at lld::wasm::GlobalSection::writeBody()
  57. <jrtc27> I mean lld/wasm/SyntheticSections.cpp's GlobalSection::writeBody
  58. <abort_> yes I also opened that
  59. <abort_> ok
  60. <jrtc27> "cast" is a "do the cast and abort if wrong", "dyn_cast" is a "do the cast and return null if wrong"
  61. <abort_> lets see
  62. <jrtc27> so checking the result of "cast" for null is a code smell
  63. <jrtc27> given your --allow-undefined I suspect that there's an UndefinedFunction or something in gotSymbols
  64. <jrtc27> but I don't know wasm linking, only ELF
  65. <abort_> I'll try to change that line
  66. <abort_> just to see what happens
  67. <abort_> the issue appears with very different codebases
  68. <abort_> I have seen it with sqlite, with lz4 and now with this (libf2c)
  69. <abort_> its a fortran to c transpiler
  70. <abort_> well, the "runtime"/support library
  71. <abort_> that's why I'm guessing it's a problem with llvm and not with my build setup
  72. <abort_> also it didn't happen in the previous versions
  73. <abort_> yup
  74. <abort_> that line was added in a very recent commit
  75. <abort_> It looks like the guy wrongly wrote "cast" instead of "dyn_cast" as you said
  76. <abort_> because in the previous line he does use dyn_cast
  77. <abort_> :DDD
  78. <abort_> thanks a lot guys
Advertisement
Add Comment
Please, Sign In to add comment