-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converted pointer straddles multiple allocations #5
Comments
Investigating. |
if you bump up the payload size to 65536 bytes, you will have the pointer issues (the errors start to appear the larger the payload size grows).Regards,MarkDon‘t take life too seriously...no one gets out alive anyway....On 31. Oct 2023, at 16:35, Sandeep Bagchi ***@***.***> wrote:
Investigating.
Any reference code will be helpful.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
rum your example server with the pointer detector active, not just the test functions…you will get different errors when using ipv4 and ipv6…I tried with go 1.20.1.Regards,MarkDon‘t take life too seriously...no one gets out alive anyway....On 31. Oct 2023, at 16:38, Sandeep Bagchi ***@***.***> wrote:
`
package sctp_go
import (
"fmt"
"syscall"
"testing"
)
//go:generate go test -gcflags=all=-d=checkptr -timeout 30s -run ^TestPtr$ github.com/thebagchi/sctp-go
func TestPtr(t *testing.T) {
addr, err := MakeSCTPAddr("sctp4", "127.0.0.1/127.0.0.2/127.0.0.3:12345")
if nil != err {
fmt.Println("Error: ", err)
t.FailNow()
}
server, err := ListenSCTP(
"sctp4",
syscall.SOCK_STREAM,
addr,
&SCTPInitMsg{
NumOutStreams: 0xffff,
MaxInStreams: 0,
MaxAttempts: 0,
MaxInitTimeout: 0,
},
)
if nil != err {
fmt.Println("Error: ", err)
t.FailNow()
}
defer server.Close()
if local := server.Addr(); nil != local {
fmt.Println("Addr: ", local)
} else {
fmt.Println("Error: ", err)
t.FailNow()
}
}
`
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Payload size greater 65535. |
that would put the max at 4294967295 bytes so 65535 is well under that limit..sctp can be used to transport larger pieces of info (larger than uint32) as long as they are chunked correctly…the application is responsible for handling that though, not the protocol 😁Regards,MarkDon‘t take life too seriously...no one gets out alive anyway....On 31. Oct 2023, at 19:43, Sandeep Bagchi ***@***.***> wrote:
if you bump up the payload size to 65536 bytes
Payload size greater 65535.
I think payload cannot be greater than MAX_UINT32 as SCTP is message oriented.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@Desmoss900 kindly check with tag 1.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
when compiling with -d=checkptr to detect incorrect unsafe pointer allocations the lib fails with:
goroutine 1 [running]: runtime.throw({0x724b17?, 0x0?}) /usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0xc000159b88 sp=0xc000159b58 pc=0x43297d runtime.checkptrAlignment(0x7fd279f593c8?, 0xc000159bf8?, 0x1?) /usr/local/go/src/runtime/checkptr.go:26 +0x6c fp=0xc000159ba8 sp=0xc000159b88 pc=0x40642c sctp.FromSCTPGetAddrs(0xc000010558) sctp_addr.go:153 +0x15b fp=0xc000159c10 sp=0xc000159ba8 pc=0x680a9b sctp.(*SCTPListener).Addr(0xc0000223b8) sctp_listener.go:34 +0xc7 fp=0xc000159c78 sp=0xc000159c10 pc=0x681ba7
This error appears when both IPv4 and IPv6 are activated.
added the -d=checkprt flag after example server failing multiple times after a few test connecitons...
when using IPv4 (sctp4) only the following is reported:
checkptr: pointer arithmetic result points to invalid allocation
goroutine 1 [running]: runtime.throw({0x725910?, 0x40640d?}) /usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0xc000117b88 sp=0xc000117b58 pc=0x43297d runtime.checkptrArithmetic(0x7ff25e2f38a8?, {0xc000117c00, 0x1, 0x0?}) /usr/local/go/src/runtime/checkptr.go:69 +0xaa fp=0xc000117bb8 sp=0xc000117b88 pc=0x4065ca sctp.FromSCTPGetAddrs(0xc0000a8540) sctp_addr.go:160 +0xf4 fp=0xc000117c20 sp=0xc000117bb8 pc=0x680a34 sctp.(*SCTPListener).Addr(0xc0000b4388) sctp_listener.go:34 +0xc7 fp=0xc000117c88 sp=0xc000117c20 pc=0x681ba7
Any assistance would be appreciated.
The text was updated successfully, but these errors were encountered: