Jump to page: 1 2
Thread overview
D and GDB
Jun 04, 2017
Russel Winder
Jun 04, 2017
ketmar
Jun 04, 2017
Russel Winder
Jun 04, 2017
Russel Winder
Jun 04, 2017
Basile B.
Jun 04, 2017
Paolo Invernizzi
Jun 05, 2017
H. S. Teoh
Jun 05, 2017
Basile B.
Jun 05, 2017
H. S. Teoh
Jun 05, 2017
Mike Wey
Jun 04, 2017
Jacob Carlborg
Jun 04, 2017
Stefan Koch
June 04, 2017
I thought I had left SIGSEGV debugging behind, but it seems not. However whilst the C++/CLion debug tooling is excellent, D seems to be without. I guess there must be some gdb magic I am missing, but:


Program received signal SIGSEGV, Segmentation fault.
0x00007fffffffc788 in ?? ()
gdb>b
Breakpoint 1 at 0x7fffffffc788
gdb>

Not the most illuminating backtrace I have seen.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

June 04, 2017
Russel Winder wrote:

> I thought I had left SIGSEGV debugging behind, but it seems not.
> However whilst the C++/CLion debug tooling is excellent, D seems to be
> without. I guess there must be some gdb magic I am missing, but:
>
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007fffffffc788 in ?? ()
> gdb>b
> Breakpoint 1 at 0x7fffffffc788
> gdb>
>
> Not the most illuminating backtrace I have seen.

maybe 'cause backtrace is called with `bt` command? ;-)
June 04, 2017
On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn wrote:
> 
[…]
> maybe 'cause backtrace is called with `bt` command? ;-)

:-)

Well it is 14 years since I started a gdb instance.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

June 04, 2017
On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn wrote:
> 
> 
> maybe 'cause backtrace is called with `bt` command? ;-)

Sadly even using the correct command, I am not getting any data that helps infer what the #### is going on. :-(


#0  0x00007fffffffc770 in ?? ()
#1  0x00007ffff7bb3d80 in dvb_scan_transponder () from /usr/lib/x86_64-linux-gnu/libdvbv5.so.0
#2  0x000055555557026d in _D8libdvbv515ScanHandler_Ptr6__ctorMFNcPS6dvb_fe15dvb_v5_fe_parmsPS8dvb_file9dvb_entryiPUPvPS6dvb_fe15dvb_v5_fe_parmsZikkZS8libdvbv515ScanHandler_Ptr (this=..., frontendParameters=0x5555557b4830,
    entry=0x5555557aa0b0, dmx_fd=4, check_frontend=0x55555556f730 <checkFrontend>, other_nit=0, timeout_multiplier=1) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140
#3  0x000055555556fcea in _D8channels15TransmitterData4scanMFxS8libdvbv510FrontendIdxkxkxkxkxbZC8channels12ChannelsData (this=..., fei=..., other_nit=0, timeout_multiplier=1, get_detected=1, get_nit=1,
    dont_add_new_frequencies=false) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/channels.d:159
#4  0x0000555555583251 in _Dmain (args=...) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/main.d:35


-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

June 04, 2017
On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
> Sadly even using the correct command, I am not getting any data that helps infer what the #### is going on. :-(
>
>
> #0  0x00007fffffffc770 in ?? ()
> #1  0x00007ffff7bb3d80 in dvb_scan_transponder () from /usr/lib/x86_64-linux-gnu/libdvbv5.so.0
> #2  0x000055555557026d in _D8libdvbv515ScanHandler_Ptr6__ctorMFNcPS6dvb_fe15dvb_v5_fe_parmsPS8dvb_file9dvb_entryiPUPvPS6dvb_fe15dvb_v5_fe_parmsZikkZS8libdvbv515ScanHandler_Ptr (this=..., frontendParameters=0x5555557b4830,
>     entry=0x5555557aa0b0, dmx_fd=4, check_frontend=0x55555556f730 <checkFrontend>, other_nit=0, timeout_multiplier=1) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140
> #3  0x000055555556fcea in _D8channels15TransmitterData4scanMFxS8libdvbv510FrontendIdxkxkxkxkxbZC8channels12ChannelsData (this=..., fei=..., other_nit=0, timeout_multiplier=1, get_detected=1, get_nit=1,
>     dont_add_new_frequencies=false) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/channels.d:159
> #4  0x0000555555583251 in _Dmain (args=...) at /home/users/russel/Repositories/Git/Masters/DVBTune/source/main.d:35

you have to pipe the output to ddemangle. Personally i don't know how to do this by hand since my IDE does the task automatically (http://bbasile.github.io/Coedit/widgets_gdb_commander).

Also i suppose you compiled with -g -gs ?
June 04, 2017
On Sunday, 4 June 2017 at 19:24:17 UTC, Basile B. wrote:
> On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
>> [...]
>
> you have to pipe the output to ddemangle. Personally i don't know how to do this by hand since my IDE does the task automatically (http://bbasile.github.io/Coedit/widgets_gdb_commander).
>
> Also i suppose you compiled with -g -gs ?

at `libdvbv5.d:140` you are calling the native `dvb_scan_transponder` in `libdvbv5.so` that's segfaulting...

Try to just log the arguments values you are using there...

/Paolo
June 04, 2017
On 2017-06-04 20:13, Russel Winder via Digitalmars-d-learn wrote:
> On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn
> wrote:
>>
>>
>> maybe 'cause backtrace is called with `bt` command? ;-)
>
> Sadly even using the correct command, I am not getting any data that
> helps infer what the #### is going on. :-(
>
>
> #0  0x00007fffffffc770 in ?? ()

If you refer to ??, I'm guessing that's inside libdvbv5.so which might not have been compiled with debug information enabled.

-- 
/Jacob Carlborg
June 04, 2017
On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote:
> On Sun, 2017-06-04 at 20:31 +0300, ketmar via Digitalmars-d-learn wrote:
>> [...]
>
> Sadly even using the correct command, I am not getting any data that helps infer what the #### is going on. :-(
>
> [...]

My guess is a null pointer :)
check your pointers :)
June 04, 2017
On Sun, Jun 04, 2017 at 07:24:17PM +0000, Basile B. via Digitalmars-d-learn wrote: [...]
> you have to pipe the output to ddemangle.

Here's the output:

> > #0  0x00007fffffffc770 in ?? ()
> > #1  0x00007ffff7bb3d80 in dvb_scan_transponder () from
> > /usr/lib/x86_64-linux-gnu/libdvbv5.so.0
> > #2  0x000055555557026d in ref libdvbv5.ScanHandler_Ptr libdvbv5.ScanHandler_Ptr.__ctor(dvb_fe.dvb_v5_fe_parms*, dvb_file.dvb_entry*, int, extern (C) int function(void*, dvb_fe.dvb_v5_fe_parms*)*, uint, uint)
> > (this=..., frontendParameters=0x5555557b4830,
> >     entry=0x5555557aa0b0, dmx_fd=4, check_frontend=0x55555556f730
> > <checkFrontend>, other_nit=0, timeout_multiplier=1) at
> > /home/users/russel/Repositories/Git/Masters/DVBTune/source/libdvbv5.d:140
> > #3  0x000055555556fcea in channels.ChannelsData channels.TransmitterData.scan(const(libdvbv5.FrontendId), const(uint), const(uint), const(uint), const(uint), const(bool))
> > (this=..., fei=..., other_nit=0, timeout_multiplier=1, get_detected=1,
> > get_nit=1,
> >     dont_add_new_frequencies=false) at
> > /home/users/russel/Repositories/Git/Masters/DVBTune/source/channels.d:159
> > #4  0x0000555555583251 in _Dmain (args=...) at
> > /home/users/russel/Repositories/Git/Masters/DVBTune/source/main.d:35

The ?? on the first line is probably a function that has no debugging info, perhaps from a library that wasn't compiled with debugging symbols added.


> Personally i don't know how to do this by hand since my IDE does the task automatically (http://bbasile.github.io/Coedit/widgets_gdb_commander).

It can't be any more trivial than just running ddemangle, which is found in the dlang/tools repo on github. (Arguably this should be shipped by default with dmd... or is it already?)


T

-- 
My program has no bugs! Only unintentional features...
June 05, 2017
On Monday, 5 June 2017 at 01:07:51 UTC, H. S. Teoh wrote:
>
> It can't be any more trivial than just running ddemangle, which is found in the dlang/tools repo on github.

Trivial i don't know but i had the feeling that the OP complained about the stack trace not being readable although all the answers went in another direction.

> (Arguably this should be shipped by default with dmd... or is it already?)

Of course it is. Currently i don't use it much but at the beginning of 2017 it's been very useful to me, to process valgrind's output, dozen and dozen of times. How can anyone ignore that it's shipped with dmd ?
« First   ‹ Prev
1 2