Bug 92081 - ASSERTION FAILED: isScalarType(type) in llvm_gen_backend.cpp line 196
Summary: ASSERTION FAILED: isScalarType(type) in llvm_gen_backend.cpp line 196
Status: RESOLVED WORKSFORME
Alias: None
Product: Beignet
Classification: Unclassified
Component: Beignet (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: rongyang
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 21:57 UTC by Frank Dittrich
Modified: 2016-01-04 16:31 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Frank Dittrich 2015-09-22 21:57:45 UTC
This is with beignet's latest git commit, commit f9094e59bbef31585bce9d301a0d319a38a11e13 (branch master) on a Fedora 22 system, but with a vanilla kernel:

$ uname -a
Linux f22b.localdomain 4.2.0-1.vanilla.mainline.knurd.1.fc22.x86_64 #1 SMP Tue Sep 1 06:35:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

CPU is Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz.

When I build the latest John the Ripper version https://github.com/magnumripper/JohnTheRipper/commit/fede4e119167e6f19af8b5b5e9c5f15b638307a9 

(bleeding-jumbo)src $ make -s distclean; ./configure && make -s clean && make -s

and then test the descrypt-opencl format, I get:

(bleeding-jumbo)src $ ../run/john --test --format=descrypt-opencl --verbosity=5
initUnicode(UNICODE, ASCII/ASCII)
ASCII -> ASCII -> ASCII
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... Options used: -I ../run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER 
ASSERTION FAILED: isScalarType(type)
  at file /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp, function gbe::ir::Type gbe::getType(gbe::ir::Context&, const llvm::Type*), line 196
Trace/breakpoint trap (core dumped)

(bleeding-jumbo)src $ gdb ../run/john
[...]
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Failed to release test userptr object! (9) i915 kernel driver may not be sane!
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... ASSERTION FAILED: isScalarType(type)
  at file /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp, function gbe::ir::Type gbe::getType(gbe::ir::Context&, const llvm::Type*), line 196
[New Thread 0x7fffebdc3700 (LWP 16649)]
[New Thread 0x7fffec5c4700 (LWP 16648)]
[New Thread 0x7fffecdc5700 (LWP 16647)]

Program received signal SIGTRAP, Trace/breakpoint trap.
gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /home/fd/git/beignet/backend/src/sys/assert.cpp:76
76	    _exit(-1);
Missing separate debuginfos, use: dnf debuginfo-install expat-2.1.0-10.fc22.x86_64 gmp-6.0.0-9.fc22.x86_64 keyutils-libs-1.5.9-4.fc22.x86_64 krb5-libs-1.13.2-5.fc22.x86_64 libcom_err-1.42.12-4.fc22.x86_64 libdrm-2.4.61-3.fc22.x86_64 libedit-3.1-12.20150325cvs.fc22.x86_64 libffi-3.1-7.fc22.x86_64 libgcc-5.1.1-4.fc22.x86_64 libgomp-5.1.1-4.fc22.x86_64 libicu-54.1-1.fc22.x86_64 libpciaccess-0.13.3-0.3.fc22.x86_64 libselinux-2.3-10.fc22.x86_64 libstdc++-5.1.1-4.fc22.x86_64 libX11-1.6.3-1.fc22.x86_64 libXau-1.0.8-4.fc22.x86_64 libxcb-1.11-8.fc22.x86_64 libXdamage-1.1.4-6.fc22.x86_64 libXext-1.3.3-2.fc22.x86_64 libXfixes-5.0.1-4.fc22.x86_64 libxshmfence-1.2-1.fc22.x86_64 libXxf86vm-1.1.4-1.fc22.x86_64 mesa-libGL-10.6.3-1.20150729.fc22.x86_64 mesa-libglapi-10.6.3-1.20150729.fc22.x86_64 ncurses-libs-5.9-18.20150214.fc22.x86_64 nss-softokn-freebl-3.20.0-1.0.fc22.x86_64 ocl-icd-2.2.3-1.git20141005.7cd0c2f.fc22.x86_64 openssl-libs-1.0.1k-12.fc22.x86_64 pcre-8.37-4.fc22.x86_64 zlib-1.2.8-7.fc22.x86_64
(gdb) bt
#0  gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /home/fd/git/beignet/backend/src/sys/assert.cpp:76
#1  0x00007fffeda1e783 in gbe::getType (type=type@entry=0x1ac7690, ctx=...) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:196
#2  0x00007fffeda38885 in gbe::GenWriter::emitUnalignedDQLoadStore (this=this@entry=0x1e43810, ptr=..., ptr@entry=..., llvmValues=llvmValues@entry=0x1e4b5a8, 
    addrSpace=addrSpace@entry=gbe::ir::MEM_PRIVATE, bti=..., bti@entry=..., isLoad=isLoad@entry=true, dwAligned=false, fixedBTI=true)
    at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:4337
#3  0x00007fffeda3a0ac in emitLoadOrStore<true, llvm::LoadInst> (I=..., this=0x1e43810) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:4447
#4  gbe::GenWriter::emitLoadInst (this=0x1e43810, I=...) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:4541
#5  0x00007fffeda5262c in visitLoadInst (I=..., this=0x1e43810) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:652
#6  visitLoad (I=..., this=0x1e43810) at /usr/include/llvm/IR/Instruction.def:133
#7  llvm::InstVisitor<gbe::GenWriter, void>::visit (this=this@entry=0x1e43810, I=...) at /usr/include/llvm/IR/Instruction.def:133
#8  0x00007fffeda4985b in gbe::GenWriter::emitBasicBlock (this=this@entry=0x1e43810, BB=BB@entry=0x1c76740) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:1807
#9  0x00007fffeda4b7f3 in gbe::GenWriter::emitFunction (this=this@entry=0x1e43810, F=...) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:2748
#10 0x00007fffeda52b2a in gbe::GenWriter::runOnFunction (this=0x1e43810, F=...) at /home/fd/git/beignet/backend/src/llvm/llvm_gen_backend.cpp:568
#11 0x00007fffee991b42 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/local/lib64/beignet//libgbe.so
#12 0x00007fffee7887be in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) () from /usr/local/lib64/beignet//libgbe.so
#13 0x00007fffee992286 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /usr/local/lib64/beignet//libgbe.so
#14 0x00007fffeda88f38 in gbe::llvmToGen (unit=..., fileName=fileName@entry=0x0, module=module@entry=0x1ac68d0, optLevel=optLevel@entry=1, strictMath=<optimized out>)
    at /home/fd/git/beignet/backend/src/llvm/llvm_to_gen.cpp:308
#15 0x00007fffeda064a1 in gbe::Program::buildFromLLVMFile (this=this@entry=0x17dcc30, fileName=fileName@entry=0x0, module=module@entry=0x1ac68d0, error="", optLevel=optLevel@entry=1)
    at /home/fd/git/beignet/backend/src/backend/program.cpp:124
#16 0x00007fffedb058a1 in gbe::genProgramNewFromLLVM (deviceID=1042, fileName=0x0, module=0x1ac68d0, llvm_ctx=0x17b1fe0, asm_file_name=<optimized out>, stringSize=1000, 
    err=0x1a91ee0 "", errSize=0x17fc4d0, optLevel=1) at /home/fd/git/beignet/backend/src/backend/gen_program.cpp:367
#17 0x00007fffeda17bd0 in gbe::programNewFromSource (deviceID=1042, source=<optimized out>, stringSize=1000, 
    options=0xff3180 <include> "-I /home/fd/git/JohnTheRipper/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER ", 
    err=0x1a91ee0 "", errSize=0x17fc4d0) at /home/fd/git/beignet/backend/src/backend/program.cpp:844
#18 0x00007ffff233548f in cl_program_build (p=p@entry=0x17fc440, options=<optimized out>) at /home/fd/git/beignet/src/cl_program.c:549
#19 0x00007ffff232d186 in clBuildProgram (program=0x17fc440, num_devices=<optimized out>, device_list=<optimized out>, options=<optimized out>, pfn_notify=0x0, user_data=0x0)
    at /home/fd/git/beignet/src/cl_api.c:947
#20 0x00007ffff70dcafb in clBuildProgram () from /lib64/libOpenCL.so.1
#21 0x00000000007143f2 in opencl_build (sequential_id=0, opts=opts@entry=0x0, save=save@entry=0, file_name=file_name@entry=0x0) at common-opencl.c:965
#22 0x00000000005af0cc in create_checking_kernel_set_args () at opencl_DES_bs_plug.c:456
#23 0x00000000005a7b6e in reset (db=<optimized out>) at opencl_DES_bs_b_plug.c:602
#24 0x00000000006c500b in fmt_self_test_body (db=0x0, salt_copy=0x1895a84, binary_copy=0x146cd64, format=0xb0d300 <fmt_opencl_DES>) at formats.c:398
#25 fmt_self_test (format=format@entry=0xb0d300 <fmt_opencl_DES>, db=db@entry=0x0) at formats.c:1483
#26 0x00000000006b9359 in benchmark_format (format=0xb0d300 <fmt_opencl_DES>, salts=256, results=0x7fffffffd520) at bench.c:239
#27 0x00000000006ba1d2 in benchmark_all () at bench.c:653
#28 0x00000000006ce1fd in john_run () at john.c:1491
#29 0x00000000006ced68 in main (argc=3, argv=0x7fffffffdfd8) at john.c:1880
Comment 1 rongyang 2015-11-27 04:01:22 UTC
I use latest commit of beignet and John the Ripper, this assert has gone.
But there is another assert, I have send a patch "[PATCH] GBE: fix a assert when structure argument's first field don't used.", can you try it?

Thanks
Comment 2 Frank Dittrich 2015-12-22 23:10:30 UTC
Sorry for the delay.
Now I repeated the test with latest beignet commit (032b606f8c5baa53e52b1f55c4f7c0bafdd6ff37), latest John the Ripper (bleeding-jumbo) commit (8d4470ff9f2357fc10c8e5769dbb164eb5118f40) and Linux kernel 4.4.0-0.rc6.git0.1.vanilla.knurd.1.fc22.x86_64.

I didn't find a git commit with a name matching your patch description.

Nevertheless, this time I ran into a different failed assertion:


$ ./john --test --format=descrypt-opencl --verbosity=5
initUnicode(UNICODE, ASCII/ASCII)
ASCII -> ASCII -> ASCII
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... Loaded 6 hashes with 4 different salts to test db from test vectors
Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER  $JOHN/kernels/DES_bs_hash_checking_kernel.cl
ASSERTION FAILED: it != allocatedBlocks.end()
  at file /home/fd/git/beignet/backend/src/backend/context.cpp, function void gbe::SimpleAllocator::splitBlock(int32_t, int32_t), line 293
Trace/breakpoint trap (core dumped)


(gdb) run --test --format=descrypt-opencl --verbosity=5
Starting program: /home/fd/git/JtR/run/john --test --format=descrypt-opencl --verbosity=5
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
initUnicode(UNICODE, ASCII/ASCII)
ASCII -> ASCII -> ASCII
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... Loaded 6 hashes with 4 different salts to test db from test vectors
Options used: -I /home/fd/git/JtR/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER  $JOHN/kernels/DES_bs_hash_checking_kernel.cl
ASSERTION FAILED: it != allocatedBlocks.end()
  at file /home/fd/git/beignet/backend/src/backend/context.cpp, function void gbe::SimpleAllocator::splitBlock(int32_t, int32_t), line 293

Program received signal SIGTRAP, Trace/breakpoint trap.
gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /home/fd/git/beignet/backend/src/sys/assert.cpp:76
76	    _exit(-1);
Missing separate debuginfos, use: dnf debuginfo-install libgcc-5.3.1-2.fc22.x86_64 libstdc++-5.3.1-2.fc22.x86_64
(gdb) bt
#0  gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /home/fd/git/beignet/backend/src/sys/assert.cpp:76
#1  0x00007fffed9ed54e in gbe::SimpleAllocator::splitBlock (this=0x5dbbad0, offset=0, subOffset=subOffset@entry=11) at /home/fd/git/beignet/backend/src/backend/context.cpp:293
#2  0x00007fffed9ed569 in gbe::Context::splitBlock (this=<optimized out>, offset=<optimized out>, subOffset=subOffset@entry=11)
    at /home/fd/git/beignet/backend/src/backend/context.cpp:378
#3  0x00007fffedadfe58 in allocateSpecialRegs (this=0x5dbcc70) at /home/fd/git/beignet/backend/src/backend/gen_reg_allocation.cpp:258
#4  allocate (selection=..., this=0x5dbcc70) at /home/fd/git/beignet/backend/src/backend/gen_reg_allocation.cpp:1256
#5  gbe::GenRegAllocator::allocate (this=<optimized out>, selection=...) at /home/fd/git/beignet/backend/src/backend/gen_reg_allocation.cpp:1340
#6  0x00007fffedb097c9 in gbe::GenContext::emitCode (this=0x5acbf00) at /home/fd/git/beignet/backend/src/backend/gen_context.cpp:3204
#7  0x00007fffed9ef06f in gbe::Context::compileKernel (this=this@entry=0x5acbf00) at /home/fd/git/beignet/backend/src/backend/context.cpp:360
#8  0x00007fffedb147db in gbe::GenProgram::compileKernel (this=<optimized out>, unit=..., name="DES_bs_cmp_high", relaxMath=<optimized out>, profiling=<optimized out>)
    at /home/fd/git/beignet/backend/src/backend/gen_program.cpp:194
#9  0x00007fffed9f3306 in gbe::Program::buildFromUnit (this=this@entry=0x53d2520, unit=..., error="") at /home/fd/git/beignet/backend/src/backend/program.cpp:174
#10 0x00007fffed9f3951 in gbe::Program::buildFromLLVMFile (this=this@entry=0x53d2520, fileName=fileName@entry=0x0, module=module@entry=0x52bbd80, error="", optLevel=optLevel@entry=1)
    at /home/fd/git/beignet/backend/src/backend/program.cpp:152
#11 0x00007fffedb14dff in gbe::genProgramNewFromLLVM (deviceID=1042, fileName=0x0, module=0x52bbd80, llvm_ctx=0x529e2f0, asm_file_name=<optimized out>, stringSize=1000, 
    err=0x520ac70 "", errSize=0x52b1ba0, optLevel=1, 
    options=0x52b57e0 "-I /home/fd/git/JtR/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER ")
    at /home/fd/git/beignet/backend/src/backend/gen_program.cpp:421
#12 0x00007fffeda05290 in gbe::programNewFromSource (deviceID=1042, source=<optimized out>, stringSize=1000, 
    options=0x52b57e0 "-I /home/fd/git/JtR/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER ", 
    err=0x520ac70 "", errSize=0x52b1ba0) at /home/fd/git/beignet/backend/src/backend/program.cpp:896
#13 0x00007ffff254f650 in cl_program_build (p=p@entry=0x52b1b10, 
    options=0x52b57e0 "-I /home/fd/git/JtR/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER ")
    at /home/fd/git/beignet/src/cl_program.c:576
#14 0x00007ffff2546f06 in clBuildProgram (program=0x52b1b10, num_devices=<optimized out>, device_list=<optimized out>, options=<optimized out>, pfn_notify=0x0, user_data=0x0)
    at /home/fd/git/beignet/src/cl_api.c:956
#15 0x00007ffff70dcafb in clBuildProgram (program=0x52b1b10, num_devices=num_devices@entry=0, device_list=device_list@entry=0x0, 
    options=options@entry=0x52b57e0 "-I /home/fd/git/JtR/run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER ", pfn_notify=pfn_notify@entry=0x0, user_data=user_data@entry=0x0) at ocl_icd_loader_gen.c:386
#16 0x00000000006f727d in opencl_build (sequential_id=sequential_id@entry=0, opts=opts@entry=0x0, save=save@entry=0, file_name=file_name@entry=0x0, 
    program=program@entry=0xeb7600 <program>, kernel_source_file=kernel_source_file@entry=0x7ecd78 "$JOHN/kernels/DES_bs_hash_checking_kernel.cl", 
    kernel_source=0x4ea2c10 "/*\n * This software is Copyright (c) 2015 Sayantan Datta <std2048 at gmail dot com>\n * and it is hereby released to the general public under the following terms:\n * Redistribution and use in source an"...) at common-opencl.c:991
#17 0x00000000006f7947 in opencl_build_kernel_opt (kernel_filename=kernel_filename@entry=0x7ecd78 "$JOHN/kernels/DES_bs_hash_checking_kernel.cl", sequential_id=sequential_id@entry=0, 
    opts=opts@entry=0x0) at common-opencl.c:1803
#18 0x00000000006f79bd in opencl_build_kernel (kernel_filename=kernel_filename@entry=0x7ecd78 "$JOHN/kernels/DES_bs_hash_checking_kernel.cl", sequential_id=0, opts=opts@entry=0x0, 
    warn=warn@entry=0) at common-opencl.c:1821
#19 0x00000000005ace85 in create_checking_kernel_set_args () at opencl_DES_bs_plug.c:463
#20 0x00000000005aaedc in reset (db=<optimized out>) at opencl_DES_bs_h_plug.c:707
#21 0x00000000006a8737 in fmt_self_test_body (full_lvl=<optimized out>, db=0x52bc4b0, salt_copy=0x52bc724, binary_copy=0x4e7beb4, format=0xaf2e60 <fmt_opencl_DES>) at formats.c:444
#22 fmt_self_test (format=format@entry=0xaf2e60 <fmt_opencl_DES>, db=db@entry=0x52bc4b0) at formats.c:1593
#23 0x000000000069c874 in benchmark_format (format=0xaf2e60 <fmt_opencl_DES>, salts=256, results=0x7fffffffd530, test_db=0x52bc4b0) at bench.c:255
#24 0x000000000069d732 in benchmark_all () at bench.c:687
#25 0x00000000006b1e8a in john_run () at john.c:1585
#26 0x00000000006b2b12 in main (argc=4, argv=0x7fffffffdfe8) at john.c:1970
Comment 3 Frank Dittrich 2015-12-23 00:02:10 UTC
When I get that ASSERTION FAILED error in backend/src/backend/context.cpp, function void gbe::SimpleAllocator::splitBlock(int32_t, int32_t), line 293, there's also a new dmesg line

[  266.175832] traps: john[2108] trap int3 ip:7f03be4cf968 sp:7fff67eb0360 error:0
Comment 4 rongyang 2015-12-23 10:47:48 UTC
I have push it, commit 473354643806806831c099e97cac952c48593e65, please try it again.
Comment 5 Frank Dittrich 2016-01-04 16:31:26 UTC
With john's latest bleeding-jumbo commit https://github.com/magnumripper/JohnTheRipper/commit/ca11872eaf094b0dbe90ba3f74fae5366d2b3125, Linux kernel 4.4.0-0.rc6.git1.1.vanilla.knurd.1.fc22.x86_64 and latest beignet commit f74980864a41daa5d644a033a16132768ce89296, this error disappeared.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.