Skip to content
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

SEGFAULT on query using var as func #1195

Closed
TBotV63 opened this issue Jul 14, 2017 · 1 comment
Closed

SEGFAULT on query using var as func #1195

TBotV63 opened this issue Jul 14, 2017 · 1 comment

Comments

@TBotV63
Copy link

TBotV63 commented Jul 14, 2017

Version

Dgraph version   : v0.7.7
Commit SHA-1     : 6d934ae
Commit timestamp : 2017-06-29 16:24:30 +1000
Branch           : HEAD

I am on arch and I installed dgraph with the script from get.dgraph.io

Schema:

mutation {
  schema {
    ipaddr: string @index(fulltext) .
    sid: int @index(int) .
    network: uid @reverse .
  }
}

When I execute the following query (from the local http gui) the server segfaults:

{
    user(func: eq(steamid, <steamid>), first: 1) { _uid_, N AS network }
    addr(func: eq(ipaddr, <ip>), first: 1) { _uid_ }
    netw(func: var(N)) {
        name
        _uid_
    }
}

It appears to have something to do with my (attempted) use of var while fiddling around with dgraph.

-debugmode Log:

Starting commit routine.
2017/07/15 00:40:20 worker.go:90: Worker listening at address: [::]:12345
2017/07/15 00:40:20 main.go:1088: grpc server started.
2017/07/15 00:40:20 main.go:1089: http server started.
2017/07/15 00:40:20 main.go:1090: Server listening on port 8080
Node with GroupID: 0, ID: 1
Node with GroupID: 1, ID: 1
Found hardstate: {Data:[] Metadata:{ConfState:{Nodes:[] XXX_unrecognized:[]} Index:0 Term:0 XXX_unrecognized:[]} XXX_unrecognized:[]}
Found Snapshot: {Data:[9 1 0 0 0 0 0 0 0 16 1 26 15 108 111 99 97 108 104 111 115 116 58 49 50 51 52 53] Metadata:{ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:6 Term:5 XXX_unrecognized:[]} XXX_unrecognized:[]}
Group 0 found 23 entries
Found hardstate: {Data:[9 1 0 0 0 0 0 0 0 16 1 26 15 108 111 99 97 108 104 111 115 116 58 49 50 51 52 53] Metadata:{ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:6 Term:5 XXX_unrecognized:[]} XXX_unrecognized:[]}
Restarting node for group: 0
Group 1 found 0 entries
Restarting node for group: 1
raft2017/07/15 00:40:20 INFO: 1 became follower at term 5
raft2017/07/15 00:40:20 INFO: 1 became follower at term 5
raft2017/07/15 00:40:20 INFO: newRaft 1 [peers: [], term: 5, commit: 23, applied: 0, lastindex: 23, lastterm: 5]
raft2017/07/15 00:40:20 INFO: newRaft 1 [peers: [1], term: 5, commit: 6, applied: 6, lastindex: 6, lastterm: 5]
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: true dead: false
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:23}
----------------------------
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:23}]
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: false dead: false
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:4}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:9}
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: false dead: false
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: true dead: false
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:23}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:4}]
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
----------------------------
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: false dead: false
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:7}
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:13}
----------------------------
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: false dead: false
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}
----------------------------
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:3}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:6}
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: true dead: false
----------------------------
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:16}
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: false dead: false
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:21}
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: false dead: false
----------------------------
2017/07/15 00:40:20 draft.go:459: group: 0 Addr: "localhost:12345" leader: false dead: false
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: true dead: false
2017/07/15 00:40:20 draft.go:459: group: 1 Addr: "localhost:12345" leader: true dead: false
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:7}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:4}]
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:5}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:15}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:12}
----------------------------
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:18}
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:11}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:22}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:10}
----------------------------
----------------------------
====== APPLYING MEMBERSHIP UPDATE: {NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:17}
----------------------------
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:7}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:5}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:7}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:3}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:6}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:9}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:16}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:21}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:20}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:21}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:15}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:21}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:12}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:21}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:18}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:13}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:18}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:11}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:18}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:11}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:22}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:10}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:11}]
Group: 0. List: [{NodeId:1 Addr:localhost:12345 Leader:true RaftIdx:17}]
Group: 1. List: [{NodeId:1 Addr:localhost:12345 Leader:false RaftIdx:10}]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xc0028f]

goroutine 52 [running]:
github.com/dgraph-io/dgraph/algo.IntersectWith(0xc420220bc0, 0x0, 0xc420220bc0)
        /home/travis/gopath/src/github.com/dgraph-io/dgraph/algo/uidlist.go:44 +0x2f
github.com/dgraph-io/dgraph/query.ProcessGraph(0x173ef40, 0xc4202a5140, 0xc420087b00, 0x0, 0xc42048c300)
        /home/travis/gopath/src/github.com/dgraph-io/dgraph/query/query.go:1620 +0x2c41
created by github.com/dgraph-io/dgraph/query.ProcessQuery
        /home/travis/gopath/src/github.com/dgraph-io/dgraph/query/query.go:1254 +0x729
@TBotV63 TBotV63 changed the title SEGFAULT on query SEGFAULT on query using var as func Jul 14, 2017
@TBotV63
Copy link
Author

TBotV63 commented Jul 15, 2017

Duh, updating fixed it.

@TBotV63 TBotV63 closed this as completed Jul 15, 2017
jarifibrahim pushed a commit that referenced this issue Mar 16, 2020
Important changes
```
 - Changes to overlap check in compaction.
 - Remove 'this entry should've been caught' log.
 - Changes to write stalling on levels 0 and 1.
 - Compression is disabled by default in Badger.
 - Bloom filter caching in a separate ristretto cache.
 - Compression/Encryption in background.
 - Disable cache by default in badger.
```

The following new changes are being added from badger
`git log ab4352b00a17...91c31ebe8c22`

```
91c31eb Disable cache by default (#1257)
eaf64c0 Add separate cache for bloom filters (#1260)
1bcbefc Add BypassDirLock option (#1243)
c6c1e5e Add support for watching nil prefix in subscribe API (#1246)
b13b927 Compress/Encrypt Blocks in the background (#1227)
bdb2b13 fix changelog for v2.0.2 (#1244)
8dbc982 Add Dkron to README (#1241)
3d95b94 Remove coveralls from Travis Build(#1219)
5b4c0a6 Fix ValueThreshold for in-memory mode (#1235)
617ed7c Initialize vlog before starting compactions in db.Open (#1226)
e908818 Update CHANGELOG for Badger 2.0.2 release. (#1230)
bce069c Fix int overflow for 32bit (#1216)
e029e93 Remove ExampleDB_Subscribe Test (#1214)
8734e3a Add missing package to README for badger.NewEntry (#1223)
78d405a Replace t.Fatal with require.NoError in tests (#1213)
c51748e Fix flaky TestPageBufferReader2 test (#1210)
eee1602 Change else-if statements to idiomatic switch statements. (#1207)
3e25d77 Rework concurrency semantics of valueLog.maxFid (#1184) (#1187)
4676ca9 Add support for caching bloomfilters (#1204)
c3333a5 Disable compression and set ZSTD Compression Level to 1 (#1191)
0acb3f6 Fix L0/L1 stall test (#1201)
7e5a956 Support disabling the cache completely. (#1183) (#1185)
82381ac Update ristretto to version  8f368f2 (#1195)
3747be5 Improve write stalling on level 0 and 1
5870b7b Run all tests on CI (#1189)
01a00cb Add Jaegar to list of projects (#1192)
9d6512b Use fastRand instead of locked-rand in skiplist (#1173)
2698bfc Avoid sync in inmemory mode (#1190)
2a90c66 Remove the 'this entry should've caught' log from value.go (#1170)
0a06173 Fix checkOverlap in compaction (#1166)
0f2e629 Fix windows build (#1177)
03af216 Fix commit sha for WithInMemory in CHANGELOG. (#1172)
23a73cd Update CHANGELOG for v2.0.1 release. (#1181)
465f28a Cast sz to uint32 to fix compilation on 32 bit (#1175)
ea01d38 Rename option builder from WithInmemory to WithInMemory. (#1169)
df99253 Remove ErrGCInMemoryMode in CHANGELOG. (#1171)
8dfdd6d Adding changes for 2.0.1 so far (#1168)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant