June 04, 2015 Re: Throwing InvalidMemoryOperationError | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Thursday, 4 June 2015 at 17:58:34 UTC, Adam D. Ruppe wrote: > On Thursday, 4 June 2015 at 17:51:31 UTC, Etienne Cimon wrote: >> I'm trying to rebuild gdb because this error is what I got: > > wow that's messed up. Did you try it with dmd -gc too? Or a non-debug version of the program entirely? Maybe your version of gdb has a bug in reading D debugging info. > > With a non-debug, you won't get line numbers in the stack trace, but the mangled function name should still really narrow down your search. (there's a ddemangle program that comes with dmd that can translate it or reading by eyeball isn't bad either, should see your class name in there) Yeah, obviously I had to use exec-file to avoid symbols because dub test compiles with symbols. It took some time to remember but this is basically how I proceeded to debug the whole botan library a few months ago. Using addr2line or a backtrace library. It's nice not having to do this for all my projects, but having to follow all these steps is obviously unfriendly for a state-of-the-art language like D. Here's what I get from the `asm { int 3; }` type of breakpoint: Program received signal SIGUSR1, User defined signal 1. 0x0000000000ccd8f7 in ?? () (gdb) bt #0 0x0000000000ccd8f7 in ?? () #1 0x0000000000000000 in ?? () (gdb) c Continuing. Program received signal SIGUSR2, User defined signal 2. 0x00007ffff7122cc7 in sigsuspend () from /lib64/libc.so.6 (gdb) Continuing. D: Error: Invalid memory operation [Thread 0x7ffff6c6c700 (LWP 67283) exited] ^C Program received signal SIGINT, Interrupt. 0x00007ffff79c9f1d in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt #0 0x00007ffff79c9f1d in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00007ffff79c4906 in pthread_mutex_lock () from /lib64/libpthread.so.0 #2 0x0000000000dbccb1 in ?? () #3 0x000000000119c1b0 in ?? () #4 0x00007fffffffc470 in ?? () #5 0x0000000000000000 in ?? () (gdb) q A debugging session is active. [root@localhost build]# addr2line -e __test__full__ 0x0ccd8f7 /home/devpriv/botan/source/botan/math/numbertheory/numthry.d:744 |
June 04, 2015 Re: Throwing InvalidMemoryOperationError | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | Well, I think the error is that the GC is not using the TLS matching the corresponding object's destructors. Could this be possible? |
June 04, 2015 Re: Throwing InvalidMemoryOperationError | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne Cimon | On 6/4/15 3:02 PM, Etienne Cimon wrote:
> Well, I think the error is that the GC is not using the TLS matching the
> corresponding object's destructors. Could this be possible?
Possible and likely :)
GC destruction can run in any thread, there is no guarantee they are run in the same thread.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation