Skip to content

Bug: runtime error: invalid memory address or nil pointer dereference #1

Description

@felipemfp

Sometimes I'm experiencing a panic using this library:

graphql_1          | time="2019-02-05T18:10:21Z" level=info msg="waiting for receiving a message from Redis" connID=ecf0cc09-1d9e-4950-96e2-d817b673133b method=readRedis subscription=1
graphql_1          | time="2019-02-05T18:11:21Z" level=warning msg="Closing connection" prefix="graphqlws/connection/ecf0cc09-1d9e-4950-96e2-d817b673133b" reason="websocket: close 1006 (abnormal closure): unexpected EOF"
graphql_1          | time="2019-02-05T18:11:21Z" level=info msg="subscription received. Ignoring..." connID=ecf0cc09-1d9e-4950-96e2-d817b673133b method=readRedis subscription=1
graphql_1          | time="2019-02-05T18:11:21Z" level=info msg="waiting for receiving a message from Redis" connID=ecf0cc09-1d9e-4950-96e2-d817b673133b method=readRedis subscription=1
graphql_1          | time="2019-02-05T18:11:21Z" level=error msg="error receiving a Redis message" connID=ecf0cc09-1d9e-4950-96e2-d817b673133b error="redigo: connection closed" method=readRedis subscription=1
graphql_1          | time="2019-02-05T18:11:21Z" level=info msg="exiting readRedis" connID=ecf0cc09-1d9e-4950-96e2-d817b673133b method=readRedis subscription=1
graphql_1          | time="2019-02-05T18:11:21Z" level=info msg="Created connection" prefix="graphqlws/connection/6aee5919-181e-4f60-8739-b27d122e837e"
graphql_1          | panic: runtime error: invalid memory address or nil pointer dereference
graphql_1          | [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x939772]
graphql_1          | 
graphql_1          | goroutine 3264 [running]:
graphql_1          | chatbot/vendor/github.com/lab259/graphqlws-redis.(*redisConnection).ID(0x0, 0xc42045c480, 0xc42045c420)
graphql_1          | 	/lab259/chatbot/src/chatbot/vendor/github.com/lab259/graphqlws-redis/connection.go:24 +0x22
graphql_1          | chatbot/vendor/github.com/lab259/graphqlws.NewHandler.func2.1(0xd765a0, 0x0, 0xc420288510, 0x1, 0xc42045c420, 0xc42045c420, 0x0, 0x0)
graphql_1          | 	/lab259/chatbot/src/chatbot/vendor/github.com/lab259/graphqlws/handler.go:69 +0x19d
graphql_1          | chatbot/vendor/github.com/lab259/graphqlws-redis.(*redisConnectionFactory).Create.func3(0xd765e0, 0xc42018e1c0, 0xc420288510, 0x1, 0xc42045c420, 0x0, 0x0, 0xc420922800)
graphql_1          | 	/lab259/chatbot/src/chatbot/vendor/github.com/lab259/graphqlws-redis/connection.go:164 +0x6f
graphql_1          | chatbot/vendor/github.com/lab259/graphqlws.(*connection).readLoop(0xc42018e1c0)
graphql_1          | 	/lab259/chatbot/src/chatbot/vendor/github.com/lab259/graphqlws/connections.go:397 +0x563
graphql_1          | created by chatbot/vendor/github.com/lab259/graphqlws.NewConnection
graphql_1          | 	/lab259/chatbot/src/chatbot/vendor/github.com/lab259/graphqlws/connections.go:168 +0x1dc
graphql_1          | make: *** [Makefile:99: run] Error 2

See more: runtime-error-invalid-memory-address.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions