1
0
mirror of https://github.com/golang/go synced 2024-11-26 00:48:01 -07:00
go/src
Vish Subramanian 9e95d970cc Fix crash in xml.Unmarshal. Occasionally while running a scrape of some xml with many goroutines
I see a crash with the following stack trace:

	SIGSEGV: segmentation violation
	Faulting address: 0x44
	PC=0x44e510

	runtime·mapaccess2+0x18 /home/vish/go/src/pkg/runtime/hashmap.c:790
       	 runtime·mapaccess2(0x0, 0x0)
	xml·*Parser·text+0x922 /home/vish/go/src/pkg/xml/xml.go:765
       	 xml·*Parser·text(0xe44c9870, 0x7fa3, 0xffffffff, 0x7f00, 0x44b5c4, ...)
	xml·*Parser·RawToken+0x174 /home/vish/go/src/pkg/xml/xml.go:405
         xml·*Parser·RawToken(0xe44c9870, 0x7fa3, 0x0, 0x0)
	xml·*Parser·Token+0x625 /home/vish/go/src/pkg/xml/xml.go:205
       	 xml·*Parser·Token(0xe44c9870, 0x7fa3, 0x0, 0x0, 0x0, ...)
	xml·*Parser·Skip+0x27 /home/vish/go/src/pkg/xml/read.go:371
       	 xml·*Parser·Skip(0xe44c9870, 0x7fa3, 0x8, 0x0)
	xml·*Parser·unmarshal+0xae6 /home/vish/go/src/pkg/xml/read.go:328
       	 xml·*Parser·unmarshal(0xe44c9870, 0x7fa3, 0xe8127120, 0x7fa3, 0xdc94bc40, ...)
	xml·Unmarshal+0xda /home/vish/go/src/pkg/xml/read.go:121
       	 xml·Unmarshal(0xe65724b0, 0x7fa3, 0xdc94bc00, 0x7fa3, 0x4bcfc0, ...)
	scraper·DoSearch+0x3d1 /home/vish/my-go-src/google3/experimental/users/vish/go_http/scraper.go:95
       	 scraper·DoSearch(0xe7dc28c0, 0x7fa3, 0x33, 0x3, 0x6d2510, ...)
	main·scrapeQueries+0x202 /home/vish/my-go-src/google3/experimental/users/vish/go_http/scrape.go:251
       	 main·scrapeQueries(0xe7da2600, 0x7fa3, 0x64, 0x1db0, 0xe7e10000, ...)
	goexit /home/vish/go/src/pkg/runtime/proc.c:135
       	 goexit()
	0x7fa3e7da2600 unknown pc

	Clearly xml.Parser is accessing an uninitialized map. Add a check for a nil map before accessing it.

R=r, rsc
https://golang.org/cl/159050
2009-11-23 14:26:30 -08:00
..
cmd two more if(h<0) that gcc 4.3 -O2 miscompiles 2009-11-23 14:23:14 -08:00
lib9 two gopack nits. 2009-11-11 14:48:33 -08:00
libbio convert C runtime to 32-bit runes; 2009-08-31 16:38:50 -07:00
libcgo More FreeBSD-touchups. Thundercats are GOOOOO! 2009-11-18 16:51:59 -08:00
libmach two more if(h<0) that gcc 4.3 -O2 miscompiles 2009-11-23 14:23:14 -08:00
pkg Fix crash in xml.Unmarshal. Occasionally while running a scrape of some xml with many goroutines 2009-11-23 14:26:30 -08:00
all-arm.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
all-nacl.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
all.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
clean.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
make-arm.bash fix arm build. 2009-11-19 21:16:26 -08:00
Make.386 makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
Make.amd64 makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
Make.arm makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
make.bash build Make.deps during make.bash instead 2009-11-19 16:27:13 -08:00
Make.cmd add and use Make.cmd 2009-08-27 11:17:14 -07:00
Make.conf might as well make 6g run faster.... go from gcc -O1 to -O2 2009-09-28 14:36:20 -07:00
Make.pkg cgo: allow .so in subdirectories 2009-11-20 00:31:03 -08:00
quietgcc.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
run.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
sudo.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00