pzbitskiy / tealang

Tealang - high level language for Algorand ASC1 and TEAL
GNU Affero General Public License v3.0
37 stars 8 forks source link

Not mentioned in documentation? #6

Closed runvnc closed 3 years ago

runvnc commented 3 years ago

Hello, I tried this out on a simple test program. Had to change something in a shell script from sh to bash and maybe one other thing (remove an extra \n) and could not get the TEAL code output to work without a segfault, but other than that it seemed to work so far for outputting the binary.

If this works, it's like 10 times better than PyTeal in my opinion. Is there a reason I didn't see it mentioned a lot of places in the docs?

Because I have no idea when the LLVM stuff is coming out but until then I am hoping I can get by with TEAL v2 and Tealang.

pzbitskiy commented 3 years ago

Hello Jason,

Would you mind sharing a program (or a subset) in order to recreate and debug the segfault?

On Jun 25, 2021, at 14:27, Jason Livesay @.***> wrote:

 Hello, I tried this out on a simple test program. Had to change something in a shell script from sh to bash and maybe one other thing (remove an extra \n) and could not get the TEAL code output to work without a segfault, but other than that it seemed to work so far.

If this works, it's like 10 times better than PyTeal in my opinion. Is there a reason I didn't see it mentioned a lot of places in the docs?

Because I have no idea when the LLVM stuff is coming out but until then I am hoping I can get by with TEAL v2 and Tealang.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

runvnc commented 3 years ago

It was with all programs. I figured it out actually. I am guessing it may be because my version of Go is different? I tried with the version on master and also tag v2.7.1-beta. The problem goes away when I add something like if op != nil { before it tries to access op.Program.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xc9410e]

goroutine 1 [running]:
main.glob..func2(0x17049c0, 0xc000130660, 0x1, 0x6)
        /home/runvnc/tealang/main.go:128 +0x26e
github.com/spf13/cobra.(*Command).execute(0x17049c0, 0xc000132010, 0x6, 0x6, 0x17049c0, 0xc000132010)
        /home/runvnc/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x17049c0, 0x17564e0, 0xeae86e, 0x6)
        /home/runvnc/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runvnc/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
main.main()
        /home/runvnc/tealang/main.go:194 +0x346
runvnc commented 3 years ago

Maybe I should have used the v2 tag. For some reason I still get surprised when master is broken.. even though master always has problems on my own project, since that's the daily dev version.

pzbitskiy commented 3 years ago

Yeah, I updated it yesterday to compile against go-algorand master. I’ll check and add some cli tests.

On Jun 25, 2021, at 20:15, Jason Livesay @.***> wrote:

 Maybe I should have used the v2 tag. For some reason I still get surprised when master is broken.. even though master always has problems on my own project, since that's the daily dev version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

pzbitskiy commented 3 years ago

Fixed misplaced *logic.OpStream dereference + unit test