Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

panic: interface conversion: interface {} is nil, not string #15

Open
fireappleblack opened this issue May 30, 2018 · 17 comments
Open

panic: interface conversion: interface {} is nil, not string #15

fireappleblack opened this issue May 30, 2018 · 17 comments

Comments

@fireappleblack
Copy link

fireappleblack commented May 30, 2018

Hi,

I hope you can help; I've installed Dontbug on a totally clean Ubuntu 16.04 VM on VMware Fusion; UEFI bios, 4GB RAM / 20GB disk, only Code Profiling is enabled, not IOMMU and VT-x/EPT. Ubuntu was patched up to date via apt dist-upgrade before proceeding with the installation. I have a record of every keystroke made if that will help, but in brief:

I've tried this (and had an identical error from dontbug) with both RR 4.5.0 and 4.4.0, both of which seemed to be working well. The version of RR used in the VM below was 4.4.0.

The installation of all the constituent parts seems OK; I've installed the versions used in the installation instructions religiously and the "dontbug record" phase completes with no errors or warnings.
However, when I issue:

./go/bin/dontbug -v replay

I get the following output:

dontbug: Using config file:/home/username/.dontbug.yaml
dontbug: Checking rr requirements
dontbug: Using rr from path /usr/bin/rr
dontbug: Checking gdb requirements
dontbug: Using gdb from path /usr/bin/gdb
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: getAbsNoSymlinkPath() for /home/username/go/src/github.com/sidkshatriya/dontbug is: /home/username/go/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/home/username/go/src/github.com/sidkshatriya/dontbug"
dontbug: getAbsNoSymlinkPath() for /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug is: /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug
dontbug: Looking for dontbug_break.c in /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug
dontbug: Found /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug/dontbug_break.c
dontbug: Completed building association of filename => linenumbers and levels => linenumbers for breakpoints
dontbug: Using latest trace
dontbug: Issuing command: /usr/bin/rr replay -s 9999 
dontbug: Successfully started replay session
Launch gdb with 
  gdb '-l' '-1' '-ex' 'target extended-remote :9999' /usr/bin/php7.0
dontbug: Issuing command:  /usr/bin/gdb -l -1 -ex target extended-remote :9999 --interpreter mi /usr/bin/php7.0
dontbug -> gdb: break-insert -f -d --source dontbug.c --line 99
gdb -> dontbug: map[class:error payload:map[msg:-break-insert: Unknown option ``f -d --source dontbug.c --line 99'']]
dontbug -> gdb: break-insert -t -f --source dontbug.c --line 91
gdb -> dontbug: map[class:error payload:map[msg:-break-insert: Unknown option ``t -f --source dontbug.c --line 91'']]
dontbug -> gdb: gdb-set print elements 0
gdb -> dontbug: map[class:done]
dontbug -> gdb: exec-continue 
gdb -> dontbug: map[class:running]
dontbug -> gdb: data-evaluate-expression filename
dontbug zend extension: dontbug.so successfully loaded by PHP
PHP 7.0.30-0ubuntu0.16.04.1 Development Server started at Fri Jun  1 00:19:41 2018
Listening on http://0.0.0.0:8088
Document root is /var/www/html
Press Ctrl-C to quit.
[Fri Jun  1 00:20:07 2018] 192.168.58.1:62585 [200]: /info.php
gdb -> dontbug: map[class:error payload:map[msg:No symbol "filename" in current context.]]
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/sidkshatriya/dontbug/engine.startGdbAndInitDebugEngineState(0xc42009f0f0, 0xc, 0xc4200eab75, 0xf, 0xc420097ec0, 0xc42020a000, 0x100, 0x100, 0x100, 0xc4200a2180, ...)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:301 +0xa81
github.com/sidkshatriya/dontbug/engine.startReplayInRR(0x0, 0x0, 0xc42009ef40, 0xb, 0xc42009f0f0, 0xc, 0xc420097ec0, 0xc42020a000, 0x100, 0x100, ...)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:223 +0x6a1
github.com/sidkshatriya/dontbug/engine.DoReplay(0x0, 0x0, 0x0, 0x0, 0xc42009ef40, 0xb, 0xc42009f0f0, 0xc, 0x8ba59d, 0x9, ...)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:168 +0x26e
github.com/sidkshatriya/dontbug/cmd.glob..func2(0xb384e0, 0xc420093390, 0x0, 0x1)
	/home/username/go/src/github.com/sidkshatriya/dontbug/cmd/replay_cmd.go:115 +0x298
github.com/spf13/cobra.(*Command).execute(0xb384e0, 0xc420093370, 0x1, 0x1, 0xb384e0, 0xc420093370)
	/home/username/go/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0xb38020, 0xc4200a6040, 0xc4200a6040, 0xc4200dbf18)
	/home/username/go/src/github.com/spf13/cobra/command.go:852 +0x30a
github.com/spf13/cobra.(*Command).Execute(0xb38020, 0x8ddde0, 0xc4200a4280)
	/home/username/go/src/github.com/spf13/cobra/command.go:800 +0x2b
github.com/sidkshatriya/dontbug/cmd.Execute()
	/home/username/go/src/github.com/sidkshatriya/dontbug/cmd/root.go:44 +0x2d
main.main()
	/home/username/go/src/github.com/sidkshatriya/dontbug/main.go:26 +0x48

N.B "username" has been substituted for my home directory in the text above.

@sidkshatriya
Copy link
Owner

sidkshatriya commented Jun 1, 2018

Can you show me your dontbug record log? Can you record a really trivial program e.g.
test.php (below) and try doing a record/replay?

<?php
for ($i = 0; $i < 10; $i++) {
  print $i;
}

@sidkshatriya
Copy link
Owner

Nevermind the additional information requested. I have enough info to debug this.

@fireappleblack
Copy link
Author

Thanks, that's great.
Fwiw the contents of my info.php file had already been downgraded from phpinfo(); to echo "Foofoo"; by the time I recorded the trace above.

@fireappleblack
Copy link
Author

fireappleblack commented Jun 1, 2018

Record log, in case it's useful anyway:
dontbug_record.txt

@fireappleblack
Copy link
Author

fireappleblack commented Jun 1, 2018

More information; during xdebug patching and installation, the "make" command returned some warnings:

In file included from /home/username/dontbug_requisites/xdebug_patch/xdebug/xdebug_handlers.h:23:0,
                 from /home/username/dontbug_requisites/xdebug_patch/xdebug/php_xdebug.h:33,
                 from /home/username/dontbug_requisites/xdebug_patch/xdebug/xdebug_handler_dbgp.c:35:
/home/username/dontbug_requisites/xdebug_patch/xdebug/xdebug_handler_dbgp.c: In function ‘send_message’:
/home/username/dontbug_requisites/xdebug_patch/xdebug/xdebug_com.h:43:23: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
 #define SSENDL(a,b,c) write(a,b,c)
                       ^
/home/username/dontbug_requisites/xdebug_patch/xdebug/xdebug_handler_dbgp.c:266:2: note: in expansion of macro ‘SSENDL’
  SSENDL(context->socket, tmp->d, tmp->l);
  ^

...and "make test" responded with "...You may have found a problem in PHP." The test result file is attached:
php_test_results_20180530_1408.txt

sidkshatriya added a commit that referenced this issue Jun 3, 2018
@sidkshatriya
Copy link
Owner

@fireappleblack I've made a small change that may have fixed the problem. Can you trying doing:

cd $GOPATH/src/github.com/sidkshatriya
git pull origin master
go install github.com/sidkshatriya/dontbug

This will recompile and reinstall the dontbug binary. You can try using this again and let me know if you have any luck. BTW what PHP IDE are you using?

sidkshatriya added a commit that referenced this issue Jun 3, 2018
@sidkshatriya
Copy link
Owner

sidkshatriya commented Jun 3, 2018

Sorry. I've discovered an issue with the fix I pushed up so I reverted it. I've got a handle on the issue though.

@fireappleblack
Copy link
Author

Thanks. My IDE is VSCode, working fine with standard Xdebug.
I've emailed you too.

@sidkshatriya
Copy link
Owner

OK I think dontbug replay should now work again. There may have a slight change in the behavior of a dependency of dontbug which caused this error.

Check the above comment to update the dontbug binary

Please look at dontbug replay --help to understand how to do replay.

But, briefly, make sure VSCode is waiting for an xdebug connection before you try running dontbug replay.

If you have problems, you can run dontbug replay with the verbose flag dontbug replay --verbose and post the results here.

@fireappleblack
Copy link
Author

fireappleblack commented Jun 4, 2018

Thanks. There's definitely some headway; this time dontbug reports it's connected to the IDE and begins enumerating debug capabilities, then panics on an unimplemented function.

FWIW the IDE is connected to the contents of /var/www/html/ via SSHFS.

~/go/bin$ ./dontbug replay --verbose --replay-host 192.168.58.1
dontbug: Using config file:/home/username/.dontbug.yaml
dontbug: Checking rr requirements
dontbug: Using rr from path /usr/bin/rr
dontbug: Checking gdb requirements
dontbug: Using gdb from path /usr/bin/gdb
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: getAbsNoSymlinkPath() for /home/username/go/src/github.com/sidkshatriya/dontbug is: /home/username/go/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/home/username/go/src/github.com/sidkshatriya/dontbug"
dontbug: getAbsNoSymlinkPath() for /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug is: /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug
dontbug: Looking for dontbug_break.c in /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug
dontbug: Found /home/username/go/src/github.com/sidkshatriya/dontbug/ext/dontbug/dontbug_break.c
dontbug: Completed building association of filename => linenumbers and levels => linenumbers for breakpoints
dontbug: Using latest trace
dontbug: Issuing command: /usr/bin/rr replay -s 9999 
dontbug: Successfully started replay session
Launch gdb with 
  gdb '-l' '-1' '-ex' 'target extended-remote :9999' /usr/bin/php7.0
dontbug: Issuing command:  /usr/bin/gdb -l -1 -ex target extended-remote :9999 --interpreter mi /usr/bin/php7.0
dontbug -> gdb: break-insert -f -d --source dontbug.c --line 99
gdb -> dontbug: map[class:done payload:map[bkpt:map[enabled:n addr:<PENDING> pending:-source dontbug.c -line 99 times:0 original-location:-source dontbug.c -line 99 number:1 type:breakpoint disp:keep]]]
dontbug -> gdb: break-insert -t -f --source dontbug.c --line 91
gdb -> dontbug: map[class:done payload:map[bkpt:map[type:breakpoint disp:del enabled:y addr:<PENDING> pending:-source dontbug.c -line 91 times:0 original-location:-source dontbug.c -line 91 number:2]]]
dontbug -> gdb: gdb-set print elements 0
gdb -> dontbug: map[class:done]
dontbug -> gdb: exec-continue 
gdb -> dontbug: map[class:running]
dontbug -> gdb: data-evaluate-expression filename
dontbug zend extension: dontbug.so successfully loaded by PHP
PHP 7.0.30-0ubuntu0.16.04.1 Development Server started at Mon Jun  4 16:14:27 2018
Listening on http://0.0.0.0:8088
Document root is /var/www/html
Press Ctrl-C to quit.
gdb -> dontbug: map[class:done payload:map[value:0x7f1971a57228 "/var/www/html/info.php"]]
(dontbug) dontbug: Trying to connect to debugger IDE
dontbug: Connected to PHP IDE debugger
h <enter> for help. If the prompt does not display press <enter>
(dontbug)  
ide -> dontbug: breakpoint_list -i 1
&{0xc420088360 0xc4200c6500 0xc4200a2028 0xc4200a2188 0xc4200eeb00 /var/www/html/info.php 1 starting ok map[language_supports_threads:0xc42009f436 language_version:0xc4202301c0 supports_reverse_debugging:0xc42009f43a supports_async:0xc42009f438 max_depth:0xc42009f480 show_hidden:0xc42009f4a0 max_children:0xc42009f460 max_data:0xc42009f470 notify_ok:0xc42009f490 extended_properties:0xc42009f43e protocol_version:0xc42009f450 breakpoint_types:0xc420230200 multiple_sessions:0xc42009f43c language_name:0xc4202301a0 encoding:0xc4202301e0] map[1:0xc420198000] map[] 256 [42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 318 321 324 327 330 333 336 339 342 345 348 351 354 357 360 363 366 369 372 375 378 381 384 387 390 393 396 399 402 405 408 411 414 417 420 423 426 429 432 435 438 441 444 447 450 453 456 459 462 465 468 471 474 477 480 483 486 489 492 495 498 501 504 507 510 513 516 519 522 525 528 531 534 537 540 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 588 591 594 597 600 603 606 609 612 615 618 621 624 627 630 633 636 639 642 645 648 651 654 657 660 663 666 669 672 675 678 681 684 687 690 693 696 699 702 705 708 711 714 717 720 723 726 729 732 735 738 741 744 747 750 753 756 759 762 765 768 771 774 777 780 783 786 789 792 795 798 801 804 807]}
dontbug: Panic: Unimplemented command: breakpoint_list -i 1
goroutine 135 [running]:
runtime/debug.Stack(0x4121a8, 0x10, 0x84e820)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/sidkshatriya/dontbug/engine.panicIf(0x915460, 0xc42022a760)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/base.go:419 +0x51
github.com/sidkshatriya/dontbug/engine.dispatchIdeRequest(0xc4200cc000, 0xc420228660, 0x14, 0x0, 0x1, 0x14)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:564 +0x227
github.com/sidkshatriya/dontbug/engine.debuggerIdeLoop.func2(0xc4200cc000, 0xc4200c2180, 0xc42009f4a8, 0xc42009f4a2, 0xc4204b0630, 0x91b2e0, 0xc4200a2028, 0xc4201e8000)
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:490 +0x16d
created by github.com/sidkshatriya/dontbug/engine.debuggerIdeLoop
	/home/username/go/src/github.com/sidkshatriya/dontbug/engine/replay.go:460 +0x4b2


Recovering from panic....
dontbug: Initiating shutdown of IDE connection. The dontbug prompt will be still operable
dontbug: Closing connection to IDE
(dontbug) q

@sidkshatriya
Copy link
Owner

Try running with dontbug replay --verbose and post on this ticket please...

@fireappleblack
Copy link
Author

I've edited the comment above with the "--verbose" output. Thanks.

@fireappleblack
Copy link
Author

Hi Sid, have you had time to look at this yet?

@sidkshatriya
Copy link
Owner

I've been very busy with other work. This is on my plate...

@sidkshatriya
Copy link
Owner

Let me see if I can get this done by coming Monday...

@fireappleblack
Copy link
Author

fireappleblack commented Jun 11, 2018

No probs. Simply making sure you'd seen the update and knew I was still interested. Thanks.
Tempted to learn Go so I can be useful.

@fireappleblack
Copy link
Author

Hi Sid, have you had any luck with this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants