onionscan icon indicating copy to clipboard operation
onionscan copied to clipboard

Segmentation fault

Open botherder opened this issue 7 years ago • 2 comments

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

goroutine 22 [running]:
panic(0x7fa320, 0xc420012100)
    /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
github.com/HouzuoGuo/tiedot/db.evalQuery(0x7f7900, 0xc420153a40, 0x0, 0xc4202df5f8, 0x1, 0x0, 0x0)
    $GOPATH/src/github.com/HouzuoGuo/tiedot/db/query.go:301 +0x85
github.com/HouzuoGuo/tiedot/db.EvalQuery(0x7f7900, 0xc420153a40, 0x0, 0xc4202df5f8, 0xc4202df660, 0x0)
    $GOPATH/src/github.com/HouzuoGuo/tiedot/db/query.go:339 +0x4e
github.com/s-rah/onionscan/crawldb.(*CrawlDB).queryDB(0xc42002c090, 0x8677ab, 0x5, 0x7ffef5b44591, 0x16, 0x198, 0xa16, 0x412245, 0xc4209d6740, 0x3)
    $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:279 +0x2c2
github.com/s-rah/onionscan/crawldb.(*CrawlDB).GetRelationshipsWithOnion(0xc42002c090, 0x7ffef5b44591, 0x16, 0x22f, 0x5, 0x230, 0x0, 0x0)
    $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:207 +0x58
github.com/s-rah/onionscan/crawldb.(*CrawlDB).InsertRelationship(0xc42002c090, 0x7ffef5b44591, 0x16, 0x868b87, 0x6, 0x86def6, 0xd, 0xc4209bd147, 0x16, 0xc4209bd460, ...)
    $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:169 +0x7f
github.com/s-rah/onionscan/deanonymization.MailtoScan(0xc420088000, 0xc420adcd20, 0xc42007c380)
    $GOPATH/src/github.com/s-rah/onionscan/deanonymization/mailto_scan.go:18 +0x351
github.com/s-rah/onionscan/deanonymization.(*ExtractIdentifierStep).Do(0xc42002c108, 0xc420088000, 0x0, 0x0)
    $GOPATH/src/github.com/s-rah/onionscan/deanonymization/process_report.go:29 +0xef
github.com/s-rah/onionscan/onionscan.(*Pipeline).Execute(0xc4200c0e00, 0x7ffef5b44591, 0x16)
    $GOPATH/src/github.com/s-rah/onionscan/onionscan/pipeline.go:48 +0x151
created by main.doScanMode
    $GOPATH/src/github.com/s-rah/onionscan/main.go:144 +0x2c8

Here's gdb output:

Thread 3 "onionscan" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff701c700 (LWP 26069)]
0x000000000064c915 in github.com/HouzuoGuo/tiedot/db.evalQuery (q=..., src=0x0, result=0xc4201ff5e8, placeSchemaLock=true, err=...) at $GOPATH/src/github.com/HouzuoGuo/tiedot/db/query.go:301
301         src.db.schemaLock.RLock()
(gdb) bt
#0  0x000000000064c915 in github.com/HouzuoGuo/tiedot/db.evalQuery (q=..., src=0x0, result=0xc4201ff5e8, placeSchemaLock=true, err=...) at $GOPATH/src/github.com/HouzuoGuo/tiedot/db/query.go:301
#1  0x000000000064d34e in github.com/HouzuoGuo/tiedot/db.EvalQuery (q=..., src=0x0, result=0xc4201ff5e8, err=...) at $GOPATH/src/github.com/HouzuoGuo/tiedot/db/query.go:339
#2  0x00000000004fa972 in github.com/s-rah/onionscan/crawldb.(*CrawlDB).queryDB (cdb=0xc420092088, field=..., value=..., ~r2=..., ~r3=...) at $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:279
#3  0x00000000004f9c18 in github.com/s-rah/onionscan/crawldb.(*CrawlDB).GetRelationshipsWithOnion (cdb=0xc420092088, onion=..., ~r1=..., ~r2=...) at $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:207
#4  0x00000000004f8c7f in github.com/s-rah/onionscan/crawldb.(*CrawlDB).InsertRelationship (cdb=0xc420092088, onion=..., from=..., identiferType=..., identifier=..., ~r4=842354055072, ~r5=...)
    at $GOPATH/src/github.com/s-rah/onionscan/crawldb/crawldb.go:169
#5  0x0000000000479341 in github.com/s-rah/onionscan/deanonymization.MailtoScan (osreport=0xc4201c4000, anonreport=0xc4201f00f0, osc=0xc4200ac380) at $GOPATH/src/github.com/s-rah/onionscan/deanonymization/mailto_scan.go:18
#6  0x000000000047a46f in github.com/s-rah/onionscan/deanonymization.(*ExtractIdentifierStep).Do (eis=0xc4201c2000, osreport=0xc4201c4000, ~r1=...) at $GOPATH/src/github.com/s-rah/onionscan/deanonymization/process_report.go:29
#7  0x000000000047bac1 in github.com/s-rah/onionscan/onionscan.(*Pipeline).Execute (p=0xc4201be000, hiddenService=...) at $GOPATH/src/github.com/s-rah/onionscan/onionscan/pipeline.go:48
#8  0x000000000045ac91 in runtime.goexit () at /usr/lib/go-1.7/src/runtime/asm_amd64.s:2086
#9  0x000000c4201be000 in ?? ()
#10 0x00007fffffffe57c in ?? ()
#11 0x0000000000000016 in ?? ()
#12 0x0000000000000000 in ?? ()

I guess it might more of a tiedot issue.

botherder avatar Mar 05 '17 00:03 botherder

Exciting. Thanks for reporting.

The only time I've ever seen recent versions of OnionScan segfault or panic in anyway, is due to the underlying system running low on disk space - could that have happened in this instance? - in that scenario tiedot doesn't handle it too well - although onionscan doesn't do anything to try and recover from those kinds of issues right now either.

Anything else you can tell me about this scan? Was it a single site scan? Or was this after processing a big list of sites?

s-rah avatar Mar 05 '17 00:03 s-rah

This was from a single onion scan. I also had plenty of space left on disk.

It's worth noting, that while it happened systematically when I first ran that scan, I can't seem to be able to reproduce it anymore. In the process I pulled latest master for tiedot and the target .onion webpage slightly changed.

botherder avatar Mar 05 '17 21:03 botherder