Giter Site home page Giter Site logo

dontbug's People

Contributors

sidkshatriya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dontbug's Issues

Failed opening required index.php

Hello, after I saw your demo I thought to give your software a try.
So I went on into configuring a KVM virtual machine where I mounted the folder containing a drupal installation into the virtual machine at /srv/www/drupal/current.
The mount command I use is: mount -t 9p -o trans=virtio,version=9p2000.L /drupal /srv/www/drupal/current
The site works using the nginx server.

When I run:
dontbug record /srv/www/drupal/current --server-listen=myhostname

I get the following errors:

PHP Warning: Unknown: failed to open stream: Interrupted system call in Unknown on line 0
PHP Fatal error: Unknown: Failed opening required '/srv/www/drupal/current/index.php' (include_path='.:/usr/share/path') in Unknown on line 0

And nother thing. How did you get your drupal installation to work?
When I try to run the php built-in server it always executes the index.php saying that the path is not found. I tryied also with different drupal router.php files I found on the web but with no luck.
The command I use to test is:
php -S myhostname:8088

Any help is highly appreciated.

Installation error

After installing I get

# dontbug record /var/www/web/index.php
dontbug: No <docroot-dir> argument provided. Assuming its the same as <php-source-root-dir>
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/root/work/src/github.com/sidkshatriya/dontbug"
dontbug: Using php from path /usr/bin/php
dontbug: fatal error: base.go:428: base.go:317: Invalid Semantic Version

Install process seemed ok, except for symlinking xdebug headers, instead of

$ cd $GOPATH/github.com/sidkshatriya/dontbug
$ cd ext/dontbug
# create a symlink "xdebug" to the xdebug sources compiled earlier
$ ln -s ~/xdebug xdebug

I needed to

$ cd $GOPATH/src/github.com/sidkshatriya/dontbug
$ cd ext/dontbug
# create a symlink "xdebug" to the xdebug sources compiled earlier
$ ln -s ~/xdebug xdebug

Add tests

Need to have testing for dontbug. Will be tricky as a debugger front end will need to be emulated.

dontbug requires Zend Engine API version 320160303

I get such error, but as i understand 320160303 is version from 7.1 that is not supported.

$ /usr/bin/phpize7.1
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
$ /usr/bin/phpize7.0
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

What i am do wrong?

xdebug patch

The xdebug patch does not look like a very specific dontbug patch. I don't seem to find the patch to be merged or proposed in the xdebug repository.

Will the patch be merged into upstream someday?

Docker version of Dontbug

It might be a good idea to provide some sort of docker version of Dontbug.

Its not going to be practical in most cases to run Dontbug within Docker (as it requires --privileged mode) (See rr-debugger/rr#1784 ). So as a substitute, Dontbug can be built within Docker and then the build can be copied over into the host perhaps.

Unhandled nmap

L.S.,

When fireing up everything looks great. When browsing to the url I get a fatal error

dontbug: Using config file:/home/xxx/.dontbug.yaml
dontbug: No <docroot-dir> argument provided. Assuming its the same as <php-source-root-dir>
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/home/xxx/.go/src/github.com/sidkshatriya/dontbug"
dontbug: Using php from path /usr/bin/php
dontbug: Using rr from path /usr/bin/rr
dontbug: Generating /home/xxx/.go/src/github.com/sidkshatriya/dontbug/ext/dontbug/dontbug_break.c for all PHP code in: /home/xxx/yyy/yyy-api/public
dontbug: 1 PHP files found
dontbug: Code generation complete. Compiling dontbug zend extension...
dontbug: Successfully ran 'make distclean' in dontbug zend extension directory
dontbug: Successfully ran phpize in dontbug zend extension directory
dontbug: Running configure in dontbug zend extension directory
dontbug: Successfully ran configure in dontbug zend extension directory
dontbug: Successfully compiled the dontbug zend extension
dontbug: -- Recording. Ctrl-C to terminate recording if running on the PHP built-in webserver
dontbug: -- Recording. Ctrl-C if running a script or simply wait for it to end

rr: Warning: Your CPU frequency governor is 'powersave'.  rr strongly
    recommends that you use the 'performance' governor.  Not using the
    'performance' governor can cause rr to be at least 2x slower
    on laptops.

    On Fedora-based systems, you can enable the 'performance' governor
    by running the following commands:

    $ sudo dnf install kernel-tools
    $ sudo cpupower frequency-set -g performance

rr: Saving execution to trace directory `/home/xxx/.local/share/rr/php-7'.
dontbug zend extension: dontbug.so successfully loaded by PHP
PHP 7.0.8-0ubuntu0.16.04.3 Development Server started at Thu Oct 13 12:32:13 2016
Listening on http://127.0.0.1:8088
Document root is /home/xxx/yyy/yyy-api/public
Press Ctrl-C to quit.
[FATAL /home/roc/rr/rr/src/util.cc:626:should_copy_mmap_region() errno: EACCES] Unhandled mmap /home/xxx/yyy/yyy-api/storage/framework/views/eb787bc5b0d00e38b5b2c5b312898d82c9820e4b.php(prot:0x1;SHARED); uid:33 mode:33188
dontbug: fatal error: base.go:428: record.go:207: signal: aborted

Do you have any clue? The directoy /home/xxx/yyy/yyy-api/storage/ has chmod 777

dontbug on lxd

I have a problem with installation on lxd (debian).
What is this error?

$ dontbug record --server-listen 192.168.3.23 test/

[FATAL /home/roc/rr/rr/src/RecordSession.cc:1319:handle_signal_event() errno: SUCCESS] 
 (task 24353 (rec:24353) at time 1134)
 -> Assertion `false' failed to hold. Can't defer deterministic or internal signal {signo:SIGSEGV,errno:SUCCESS,code:SEGV_ACCERR,addr:0x7f99b2853080} at ip 0x7f99b4d83934
Launch gdb with 
  gdb '-l' '-1' '-ex' 'target extended-remote :24353' /usr/bin/php7.0

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

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.

dontbug can't find file

# dontbug record /var/www drush/drush --php-cli-script --args "status"
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/root/work/src/github.com/sidkshatriya/dontbug"
dontbug: Using php from path /usr/bin/php
dontbug: Using rr from path /usr/bin/rr
dontbug: Generating /root/work/src/github.com/sidkshatriya/dontbug/ext/dontbug/dontbug_break.c for all PHP code in: /var/www
dontbug: 2654 PHP files found
dontbug: Code generation complete. Compiling dontbug zend extension...
dontbug: Successfully ran 'make distclean' in dontbug zend extension directory
dontbug: Successfully ran phpize in dontbug zend extension directory
dontbug: Running configure in dontbug zend extension directory
dontbug: Successfully ran configure in dontbug zend extension directory
dontbug: Successfully compiled the dontbug zend extension
dontbug: -- Recording. Ctrl-C to terminate recording if running on the PHP built-in webserver
dontbug: -- Recording. Ctrl-C if running a script or simply wait for it to end
rr: Saving execution to trace directory `/root/.local/share/rr/php-2'.
dontbug zend extension: dontbug.so successfully loaded by PHP

...

dontbug: Closed cleanly. Replay should work properly

however during replay/debugging getting file not found error, but file exists

# dontbug replay --replay-host $REPLAY_HOST
dontbug: Using rr from path /usr/bin/rr
dontbug: Using gdb from path /usr/bin/gdb
dontbug: No --install-location specified. Defaulting to $GOPATH/src/github.com/sidkshatriya/dontbug
dontbug: Using --install-location "/root/work/src/github.com/sidkshatriya/dontbug"
dontbug: Using latest trace
dontbug: Successfully started replay session
Launch gdb with
  gdb '-l' '-1' '-ex' 'target extended-remote :9999' /root/.local/share/rr/latest-trace/mmap_hardlink_4_php7.0
dontbug zend extension: dontbug.so successfully loaded by 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) dontbug: Not able to find file:///var/www/drush/includes/startup.inc to add a breakpoint. The IDE is trying to set a breakpoint for a file from a different project or you have not specified the root directory command line parameter correctly. Ignoring
(dontbug) q
Exiting.
dontbug: Closing connection to IDE
(dontbug) # ls /var/www/drush/includes/startup.inc
/var/www/drush/includes/startup.inc

Native MacOS Support

This issue is not so much a feature request, as I may be able to help out in this regard (I've been involved in porting HHVM to OSX for example).

What would be the general areas to look at to make this run on MacOS natively?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.