ptxas crash with testcase

ptxas CUDA_extentions_mat.ptx
with attached minimal test case crashes.
Btw. it would be nice if you could allow adding files with .ptx extension here…

ptxas is from CUDA 2.0 beta:
ptxas --version
ptxas: NVIDIA ® Ptx optimizing assembler
Copyright © 2005-2007 NVIDIA Corporation
Built on Sat_Apr__5_07:00:41_PDT_2008
Cuda compilation tools, release 1.1, V0.2.1221

gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47942369332000 (LWP 30372)]
0x000000000044317f in InitializeNodesToFloatingPoint ()
(gdb) bt
#0 0x000000000044317f in InitializeNodesToFloatingPoint ()
#1 0x0000000000442a22 in SetRefCount ()
#2 0x00000000004d983c in OriUpdateBvLive ()
#3 0x00000000004d935a in OriUpdateBvLive ()
#4 0x0000000000453686 in PropagateTest ()
#5 0x0000000000453723 in PropagateTest ()
#6 0x00000000004d9283 in OriUpdateBvLive ()
#7 0x000000000047469f in CopyDag ()
#8 0x00000000004691d0 in TransformAssignConstantsToRegisters ()
#9 0x0000000000455a9d in TransformExpandSqrtToRcpRsqrt ()
#10 0x000000000041e982 in stdStringEqual ()
#11 0x000000000040f959 in __gxx_personality_v0 () at …/…/…/…/libstdc+±v3/libsupc++/
#12 0x000000000041902d in __gxx_personality_v0 () at …/…/…/…/libstdc+±v3/libsupc++/
#13 0x000000000040f3b4 in __gxx_personality_v0 () at …/…/…/…/libstdc+±v3/libsupc++/
#14 0x00002b9a73b27ae4 in __libc_start_main () from /lib64/
#15 0x000000000040d3f9 in __gxx_personality_v0 () at …/…/…/…/libstdc+±v3/libsupc++/
#16 0x00007fff37f58ab8 in ?? ()
#17 0x0000000000000000 in ?? ()

The problem seems to exist with the older ptxas from CUDA 1.1, too.
I’d be happy about both a fixed version or a hint how I can avoid the problem.
CUDA_extentions_mat.txt (561 Bytes)

I’m able to replicate this, and have filed bug 426787. I’ll let you know if we’re able to find a workaround.

We believe that we’ve found a workaround, as the input program is incorrect? Shouldn’t __cudaparm__Z4AmulP6float2S0_7textureIS_Li2EL19cudaTextureReadMode0EEPiii_values;

be from .tex space?

Changing it to
.tex .u64 __cudaparm__Z4AmulP6float2S0_7textureIS_Li2EL19cudaTextureReadMode0EEPiii_values;
makes it work.

Was your ptx generated from a .cu file or did you write it manually?

Ah, I do not know enough about .ptx yet, so I did not notice

It was generated from a .cu file, but with as much code as possible removed.

I attached a minimal .cu file that leads to the same problem.

I admit none of the examples seem to pass textures as function parameters, maybe that is the problem? I only did it because doing it differently would require a few more changes to the code and I am lazy :)
test_cu.txt (117 Bytes)

The segfault will be fixed in the 2.0-final release. Both of your test examples attached here will result in the following output from ptxas:
ptxas CUDA_extentions_mat.ptx, line 9; error : State space mismatch between instruction and address in instruction ‘tex’

Thanks. If you haven’t done so, maybe you could add a sentence about it to the documentation? Currently I can only find “A texture reference is declared at file scope as a variable of type texture:” but no mention about where a texture reference can be used as function argument (it seems to work for host functions, not for global functions, and maybe, maybe not for device functions).