Skip to content

Instantly share code, notes, and snippets.

View marten-seemann's full-sized avatar

Marten Seemann marten-seemann

View GitHub Profile
@marten-seemann
marten-seemann / main.c
Created June 23, 2024 14:46
macOS Dual Stack UDP Socket Bug
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <pthread.h>
void *send_udp_packet(void *arg) {
int sock;
package udp_test
import (
"crypto/rand"
"log"
"net"
"testing"
"time"
"github.com/stretchr/testify/require"
package main
import (
"context"
"crypto/tls"
"fmt"
"io"
"log"
"net/http"
"time"
package main
import (
"encoding/binary"
"log"
"net"
"syscall"
"golang.org/x/sys/unix"
)
This file has been truncated, but you can view the full file.
2022-05-15T14:03:40.2349968Z === RUN TestDialExistingConnection
2022-05-15T14:03:40.2350193Z ==================
2022-05-15T14:03:40.2350401Z WARNING: DATA RACE
2022-05-15T14:03:40.2350644Z Read at 0x00c00018f000 by goroutine 59:
2022-05-15T14:03:40.2350892Z reflect.Value.Uint()
2022-05-15T14:03:40.2351337Z /opt/hostedtoolcache/go/1.17.9/x64/src/reflect/value.go:2305 +0x1849
2022-05-15T14:03:40.2351789Z github.com/davecgh/go-spew/spew.(*dumpState).dump()
2022-05-15T14:03:40.2352408Z /home/runner/go/pkg/mod/github.com/davecgh/go-spew@v1.1.1/spew/dump.go:324 +0x1770
2022-05-15T14:03:40.2352873Z github.com/davecgh/go-spew/spew.(*dumpState).dump()
2022-05-15T14:03:40.2353503Z /home/runner/go/pkg/mod/github.com/davecgh/go-spew@v1.1.1/spew/dump.go:421 +0x1fe4
@marten-seemann
marten-seemann / linger_test.go
Last active December 18, 2021 13:20
OSX Linger failure
package linger_test
import (
"fmt"
"io"
"math/rand"
"net"
"testing"
"time"
package main
import (
"fmt"
"log"
"net"
)
func main() {
log.Fatal(run())
package main
import (
"encoding/binary"
"fmt"
"log"
"net"
"syscall"
"time"
)
@marten-seemann
marten-seemann / main.go
Created June 10, 2020 05:09
UDP Reuseport
package main
import (
"encoding/binary"
"fmt"
"log"
"net"
"strings"
"time"
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"