YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

caller_id now works in YottaDB for ARM Linux (just like it does on YottaDB for x86_64 Linux) #112

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

It was observed that caller_id.c did not record the caller function information in debug arrays (e.g. cs_addrs->nl->crit_ops_array[].call_from) in YottaDB for ARM Linux whereas it did in YottaDB for x86_64 Linux. Turns out this was because backtrace() returned 0 on ARM Linux. And that in turn was due to gcc default options not including -funwind-tables. This is now fixed by adding this option explicitly for all platforms (including x86_64 Linux) in case a future version of gcc there removes this flag by default. After the change to add this compiler flag, backtrace() returns a non-zero value and caller_id now works.

Since this is noticeable only in debug builds of YottaDB, this does not have a separate issue#.

shabiel commented 6 years ago

What does -funwind-tables do? I never heard of it before.

On Thu, Dec 21, 2017 at 1:01 PM, Narayanan Iyer notifications@github.com wrote:

It was observed that caller_id.c did not record the caller function information in debug arrays (e.g. cs_addrs->nl->crit_ops_array[].call_from) in YottaDB for ARM Linux whereas it did in YottaDB for x86_64 Linux. Turns out this was because backtrace() returned 0 on ARM Linux. And that in turn was due to gcc default options not including -funwind-tables. This is now fixed by adding this option explicitly for all platforms (including x86_64 Linux) in case a future version of gcc there removes this flag by default. After the change to add this compiler flag, backtrace() returns a non-zero value and caller_id now works.

Since this is noticeable only in debug builds of YottaDB, this does not have a separate issue#.

You can view, comment on, or merge this pull request online at:

https://github.com/YottaDB/YottaDB/pull/112 Commit Summary

  • caller_id now works in YottaDB for ARM Linux (just like it does on YottaDB for x86_64 Linux)

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/YottaDB/YottaDB/pull/112, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEtwlv-tr15EyypBfLbMPXQXcE7d8x9ks5tCpz1gaJpZM4RKKVa .

nars1 commented 6 years ago

I had not heard of it either until today. It seems to add enough information in the object file so at least backtrace() can work. It was enabled by default in gcc for Linux on x86_64 but not in gcc for Linux on ARM.

nars1 commented 6 years ago

For the record. Steve realized that this is an issue in non-debug builds of YottaDB too if the env var gtmdbglvl is used. Setting gtmdbglvl = 4 causes mumps/mupip/dse etc. to print output like the following.

Malloc at 0x1bc6040 of 5 bytes from 0x7f33c84640e8 (tn=1)
Malloc at 0x1bce8e0 of 2784 bytes from 0x7f33c8401f4e (tn=2)

This output would have "from 0x0" (instead of the "from 0x7f....." displayed above) on the Linux ARM build of YottaDB r1.10 (which does not have the current fixes in it).