[binutils-gdb] Avoid crash when calling warning too early

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] Avoid crash when calling warning too early

sergiodj+buildbot-2
*** TEST RESULTS FOR COMMIT 20f0d60db4fb5083779c4c9182bbc692f7d2bac5 ***

Author: Tom Tromey <[hidden email]>
Branch: master
Commit: 20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Avoid crash when calling warning too early

I noticed that if you pass the name of an existing file (not a
directory) as the argument to --data-directory, gdb will crash:

    $ ./gdb -nx  --data-directory  ./gdb
    ../../binutils-gdb/gdb/target.c:590:56: runtime error: member call on null pointer of type 'struct target_ops'

This was later reported as PR gdb/23838.

This happens because warning ends up calling
target_supports_terminal_ours, which calls current_top_target, which
returns nullptr this early.

This fixes the problem by handling this case specially in
target_supports_terminal_ours.  I also changed
target_supports_terminal_ours to return bool.

gdb/ChangeLog
2018-11-08  Tom Tromey  <[hidden email]>

        PR gdb/23555:
        PR gdb/23838:
        * target.h (target_supports_terminal_ours): Return bool.
        * target.c (target_supports_terminal_ours): Handle case where
        current_top_target returns nullptr.  Return bool.

gdb/testsuite/ChangeLog
2018-11-08  Tom Tromey  <[hidden email]>

        PR gdb/23555:
        PR gdb/23838:
        * gdb.base/warning.exp: New file.
Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-i686, branch master

sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-3

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-i686/builds/11445>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-i686/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
new FAIL: gdb.base/catch-syscall.exp: multiple targets: insert catch syscall on syscall 1 -- write on i386:x86-64
new FAIL: gdb.base/info-os.exp: continue
new FAIL: gdb.base/info-os.exp: continue to breakpoint: Set breakpoint here
new FAIL: gdb.base/info-os.exp: get file descriptors
new FAIL: gdb.base/info-os.exp: get internet-domain sockets
new FAIL: gdb.base/info-os.exp: get message queue ID
new FAIL: gdb.base/info-os.exp: get message queue key
new FAIL: gdb.base/info-os.exp: get message queues
new FAIL: gdb.base/info-os.exp: get process groups
new FAIL: gdb.base/info-os.exp: get process list
new FAIL: gdb.base/info-os.exp: get semaphore ID
new FAIL: gdb.base/info-os.exp: get semaphore key
new FAIL: gdb.base/info-os.exp: get semaphores
new FAIL: gdb.base/info-os.exp: get shared memory ID
new FAIL: gdb.base/info-os.exp: get shared memory key
new FAIL: gdb.base/info-os.exp: get shared-memory regions
new FAIL: gdb.base/info-os.exp: get socket port number
new FAIL: gdb.base/info-os.exp: get threads
new FAIL: gdb.python/py-finish-breakpoint2.exp: check FinishBreakpoint in catch
new FAIL: gdb.python/py-finish-breakpoint2.exp: check finish BP removal
new FAIL: gdb.python/py-finish-breakpoint2.exp: continue to second exception
new FAIL: gdb.python/py-finish-breakpoint2.exp: set FinishBP after the exception
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
new KFAIL: gdb.xml/tdesc-arch.exp: set tdesc filename tdesc-arch.xml
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-i686/xfails/master/xfail?id=355bdc2a>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-i686/xfails/master/xfail.table?id=355bdc2a>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-cc-with-index, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-4

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-cc-with-index/builds/11359>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-cc-with-index/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-cc-with-index/xfails/master/xfail?id=353d7162>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-cc-with-index/xfails/master/xfail.table?id=353d7162>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-1

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-extended-gdbserver-m32/builds/11123>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-extended-gdbserver-m32/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
new FAIL: gdb.base/corefile.exp: core-file warning-free
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-extended-gdbserver-m32/xfails/master/xfail?id=f3b76112>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-extended-gdbserver-m32/xfails/master/xfail.table?id=f3b76112>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-2

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-extended-gdbserver-m64/builds/11394>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-extended-gdbserver-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-extended-gdbserver-m64/xfails/master/xfail?id=70b4f93b>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-extended-gdbserver-m64/xfails/master/xfail.table?id=70b4f93b>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-4

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-m64/builds/11494>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-m64/xfails/master/xfail?id=429f8aa3>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-m64/xfails/master/xfail.table?id=429f8aa3>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-s390x-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        marist-fedora-s390x

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-s390x-m64/builds/10084>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-s390x-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-s390x-m64/xfails/master/xfail?id=c150c6be>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-s390x-m64/xfails/master/xfail.table?id=c150c6be>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-3

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-gdbserver-m64/builds/11361>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-gdbserver-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>




Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m32, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-2

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-m32/builds/11198>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-m32/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-m32/xfails/master/xfail?id=252f4af6>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-m32/xfails/master/xfail.table?id=252f4af6>



Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m32, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        fedora-x86-64-1

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-gdbserver-m32/builds/11131>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-gdbserver-m32/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
new FAIL: gdb.base/corefile.exp: core-file warning-free
new UNRESOLVED: gdb.mi/mi-break.exp: mi-mode=separate:
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-gdbserver-m32/xfails/master/xfail?id=5e082ff1>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Fedora-x86_64-native-gdbserver-m32/xfails/master/xfail.table?id=5e082ff1>



Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        ubuntu16-aarch64

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Ubuntu-Aarch64-native-extended-gdbserver-m64/builds/121>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>




Reply | Threaded
Open this post in threaded view
|

Failures on Debian-s390x-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        debian-jessie-s390x-1

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Debian-s390x-m64/builds/6879>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Debian-s390x-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Debian-s390x-m64/xfails/master/xfail?id=f595a40c>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Debian-s390x-m64/xfails/master/xfail.table?id=f595a40c>



Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        ubuntu16-aarch64

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Ubuntu-Aarch64-native-gdbserver-m64/builds/4490>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Ubuntu-Aarch64-native-gdbserver-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>




Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-m64, branch master

sergiodj+buildbot-2
In reply to this post by sergiodj+buildbot-2
Buildslave:
        ubuntu16-aarch64

Full Build URL:
        <http://gdb-build.sergiodj.net/builders/Ubuntu-Aarch64-m64/builds/4558>

Commit(s) tested:
        20f0d60db4fb5083779c4c9182bbc692f7d2bac5

Author(s) (in the same order as the commits):
        Tom Tromey <[hidden email]>

Subject:
        Avoid crash when calling warning too early

Testsuite log (gdb.sum and gdb.log) URL(s):
        <http://gdb-build.sergiodj.net/results/Ubuntu-Aarch64-m64/20/20f0d60db4fb5083779c4c9182bbc692f7d2bac5/>

*** Diff to previous build ***
============================
PASS -> UNRESOLVED: gdb.mi/list-thread-groups-available.exp: list available thread groups
PASS -> FAIL: gdb.mi/list-thread-groups-available.exp: list available thread groups with filter
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Ubuntu-Aarch64-m64/xfails/master/xfail?id=a78cdb4f>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://git.sergiodj.net/gdb-xfails.git/tree/xfails/Ubuntu-Aarch64-m64/xfails/master/xfail.table?id=a78cdb4f>