Re: Why am I getting segfaults when doing `foreach` with arrays of references?

2024-03-09 Thread Liam McGillivray via Digitalmars-d-learn
(as I the destructor was never called), why would some of the array elements be null? I'll answer my own question; because the thing assigned to the array was already null. Anyway, I managed to fix the segfaults. In the latest two commits, I have turned some pointers into references.

Re: Why am I getting segfaults when doing `foreach` with arrays of references?

2024-03-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/03/2024 8:49 PM, Liam McGillivray wrote: But that begs the question; why? Don't dynamic arrays always start with a length of 0? If the array was only extended when valid objects were appended using the append operator |~=|, and none of those objects were deleted (as I the destructor was n

Re: Why am I getting segfaults when doing `foreach` with arrays of references?

2024-03-08 Thread Liam McGillivray via Digitalmars-d-learn
On Saturday, 9 March 2024 at 06:37:02 UTC, Richard (Rikki) Andrew Cattermole wrote: Something that I have noticed that you are still doing that was pointed out previously is having a pointer to a class reference. Stuff like ``Tile* currentTile;`` when it should be ``Tile currentTile;`` A cla

Re: Why am I getting segfaults when doing `foreach` with arrays of references?

2024-03-08 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Something that I have noticed that you are still doing that was pointed out previously is having a pointer to a class reference. Stuff like ``Tile* currentTile;`` when it should be ``Tile currentTile;`` A class reference is inherently a pointer. So when you checked for nullability in the forea

Why am I getting segfaults when doing `foreach` with arrays of references?

2024-03-08 Thread Liam McGillivray via Digitalmars-d-learn
With [my game project](https://github.com/LiamM32/Open_Emblem), I have been getting segmentation faults that are unexplainable at my knowledge level. They seem to happen when doing a "foreach" loop through an array of references. Skip to the bolded text if you don't want to read too much, as I

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Mike Parker via Digitalmars-d-learn
On Friday, 1 July 2022 at 13:44:20 UTC, Chris Katko wrote: It appears module access to a class is broken until the constructor finishes. No, it has nothing to do with the module. It's the reference itself. Until the constructor returns, the reference through which you're constructing the i

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Chris Katko via Digitalmars-d-learn
On Friday, 1 July 2022 at 13:28:26 UTC, Chris Katko wrote: ...wait, does "world" not 'exist' until after the constructor finishes? Is that's what's going on? But then why does it 'exist' when I send it directly? Is it only "registered" with the module once this() finishes or something like that

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Chris Katko via Digitalmars-d-learn
On Friday, 1 July 2022 at 13:12:05 UTC, Adam D Ruppe wrote: On Friday, 1 July 2022 at 12:57:01 UTC, Chris Katko wrote: Cannot access memory at address 0x10 Looks like an ordinary null pointer. How did you create the variable? D bool initialize() //called from main { g.w

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Mike Parker via Digitalmars-d-learn
On Friday, 1 July 2022 at 13:20:15 UTC, Mike Parker wrote: r. And that also looks like the source of your original segfault. You've got a circular reference going on in the constructors. In other words, you're constructing a global world instance, which in turn constructs an elf instance, whi

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Mike Parker via Digitalmars-d-learn
On Friday, 1 July 2022 at 13:01:30 UTC, Chris Katko wrote: Forgot the last line. That's important because world MUST exist by time elf is called... because world... created and called elf. So it's not a memory issue, but some sort of linkage issue. world is null because the constructor didn'

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 1 July 2022 at 12:57:01 UTC, Chris Katko wrote: Cannot access memory at address 0x10 Looks like an ordinary null pointer. How did you create the variable?

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Chris Katko via Digitalmars-d-learn
Forgot the last line. That's important because world MUST exist by time elf is called... because world... created and called elf. So it's not a memory issue, but some sort of linkage issue.

Re: dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Chris Katko via Digitalmars-d-learn
To add, I cannot even access g.world from inside elf's constructor. ... which is the function that called it. D Thread 1 "main" received signal SIGSEGV, Segmentation fault. objects.elf.this(g.pair, objects.atlasHandler) (this=, atlas=, _pos=...) at ./src/objects.d:320 (gdb) bt #0 object

dlang bug - accessing module variable from method segfaults only when using module reference directly

2022-07-01 Thread Chris Katko via Digitalmars-d-learn
dmd (but I think LDC also is affected) this bug has bit me multiple times now, to the point I can recognize it. Accessing module variables, from inside a method, causes a segfault. Even if the variable should be available by then through the call order. Proving that its a bug, you can directl

Re: rawRead from Pipe segfaults

2021-03-18 Thread kdevel via Digitalmars-d-learn
On Wednesday, 17 March 2021 at 23:08:07 UTC, kdevel wrote: [...] How do I keep the pipe open? Having the readEnd and writeEnd closed in the parent is usually the right thing to to. spawnProcess closes the ends which is documented: | Note that if you pass a File object that is not one of the s

Re: rawRead from Pipe segfaults

2021-03-18 Thread kdevel via Digitalmars-d-learn
On Thursday, 18 March 2021 at 07:55:01 UTC, Imperatorn wrote: [...] Have you tried "scope(exit) wait(" instead? Yes. Does not make a difference. For the segfault I have filed Issue 21728

Re: rawRead from Pipe segfaults

2021-03-18 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 17 March 2021 at 23:08:07 UTC, kdevel wrote: In order to watch out for lost bytes in a pipe I encountered this segfault. It seems that the readEnd is already closed when rawRead = fread is called (uncomment the eof line). [...] Have you tried "scope(exit) wait(" instead?

rawRead from Pipe segfaults

2021-03-17 Thread kdevel via Digitalmars-d-learn
In order to watch out for lost bytes in a pipe I encountered this segfault. It seems that the readEnd is already closed when rawRead = fread is called (uncomment the eof line). How do I keep the pipe open? ```piperawreadsegfault.d (linux) import std.stdio; import std.process; void main () {

Re: is it bug? (out contract in method causes dmd (2.072.2, 2.74.1) segfaults)

2017-06-14 Thread drug via Digitalmars-d-learn
14.06.2017 14:25, ag0aep6g пишет: It's always a bug when dmd segfaults. filed https://issues.dlang.org/show_bug.cgi?id=17502

Re: is it bug? (out contract in method causes dmd (2.072.2, 2.74.1) segfaults)

2017-06-14 Thread ag0aep6g via Digitalmars-d-learn
On 06/14/2017 01:06 PM, drug wrote: https://dpaste.dzfl.pl/b66fffa3bc8d It's always a bug when dmd segfaults.

is it bug? (out contract in method causes dmd (2.072.2, 2.74.1) segfaults)

2017-06-14 Thread drug via Digitalmars-d-learn
https://dpaste.dzfl.pl/b66fffa3bc8d

Re: Can D "prevents segfaults, and guarantees thread safety"?

2016-02-22 Thread Chris Wright via Digitalmars-d-learn
On Tue, 23 Feb 2016 04:28:14 +, mahdi wrote: > A selling point of Rust language is that it "prevents segfaults, > and guarantees thread safety". Is there a library in D language which > provides same features? D is more for providing safe defaults than for entirely prevent

Re: Can D "prevents segfaults, and guarantees thread safety"?

2016-02-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 04:28:14 UTC, mahdi wrote: A selling point of Rust language is that it "prevents segfaults, and guarantees thread safety". Is there a library in D language which provides same features? The core d runtime (including the garbage collector) does su

Can D "prevents segfaults, and guarantees thread safety"?

2016-02-22 Thread mahdi via Digitalmars-d-learn
A selling point of Rust language is that it "prevents segfaults, and guarantees thread safety". Is there a library in D language which provides same features?

Re: dmd segfaults

2014-05-31 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 31, 2014 at 04:50:11PM +, matovitch via Digitalmars-d-learn wrote: > Hi ! > > Does anybody knows why dmd segfaults on this code ? Should I report > this as a bug ? [...] Compiler segfaults should always be reported. No matter how wrong the code may be, it is never r

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
I updated the issue. Strangely if done in the main everything is fine : Error: undefined identifier i

Re: dmd segfaults

2014-05-31 Thread via Digitalmars-d-learn
On Saturday, 31 May 2014 at 17:22:41 UTC, matovitch wrote: In fact it segfauls on any template parameter if it has the same name as the immutable member (at least it's coherent). Something as simple as : struct Foo(int i) { immutable int i = i; } void main() { Foo!5 foo; writeln(f

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
I remembered my psswd don't take my last sentence into account (i will filed this).

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
In fact it segfauls on any template parameter if it has the same name as the immutable member (at least it's coherent). Something as simple as : struct Foo(int i) { immutable int i = i; } void main() { Foo!5 foo; writeln(foo); } I am suprised that nobody tried this before. BTW I a

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
On Saturday, 31 May 2014 at 17:01:23 UTC, bearophile wrote: matovitch: Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? Please report this minimized case to Bugzilla: struct Foo(int[] arr) { const int[] arr = arr; } void main() { Foo!([0]) foo

Re: dmd segfaults

2014-05-31 Thread bearophile via Digitalmars-d-learn
matovitch: Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? Please report this minimized case to Bugzilla: struct Foo(int[] arr) { const int[] arr = arr; } void main() { Foo!([0]) foo; } The error it gives before the crash: test.d(2,17

dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
Hi ! Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? import std.stdio; enum LiftingGender { PREDICT, UPDATE, } struct Test(float[][] coeffs, int[] offsets, LiftingGender gender) { immutable float[][] coeffs = coeffs

dmd segfaults on nested template instantiation (eg A!(A!(int)) )

2013-09-18 Thread Timothee Cour
I just filed a bug report ( http://d.puremagic.com/issues/show_bug.cgi?id=11067) Is there a workaround that keeps same syntax for user code? Use case: i'm generating those from swig(+modifications to map C++ templates to D templates) so I can't factor the template bodies for different template ins

Re: GktD: exceptions in handlers cause segfaults.

2013-07-23 Thread Johannes Pfau
Am Mon, 22 Jul 2013 19:28:10 +0200 schrieb Marco Leise : > Am Fri, 19 Jul 2013 21:43:38 +0200 > schrieb Johannes Pfau : > > > Am Fri, 19 Jul 2013 12:38:45 +0200 > > schrieb Marco Leise : > > > > Would be nice to know if this is working with gdc or ldc. In theory > > it should work as we use gcc'

Re: GktD: exceptions in handlers cause segfaults.

2013-07-22 Thread Marco Leise
Am Fri, 19 Jul 2013 21:43:38 +0200 schrieb Johannes Pfau : > Am Fri, 19 Jul 2013 12:38:45 +0200 > schrieb Marco Leise : > > Would be nice to know if this is working with gdc or ldc. In theory it > should work as we use gcc's exception handling/stack unwinding so it's > probably a dmd bug. That's

Re: GktD: exceptions in handlers cause segfaults.

2013-07-19 Thread Johannes Pfau
Am Fri, 19 Jul 2013 12:38:45 +0200 schrieb Marco Leise : > It turns out that what Walter explained is the > key here, too. All my libraries are compiled without frame > pointers, so the simple stack unwinding that D uses fails > there. I recompiled glib and gtk+ with -fno-omit-frame-pointer > spec

Re: GktD: exceptions in handlers cause segfaults.

2013-07-19 Thread Marco Leise
Am Fri, 19 Jul 2013 11:47:41 +0200 schrieb Marco Leise : > Am Fri, 19 Jul 2013 11:10:04 +0200 > schrieb Marco Leise : > > dav1d gave me advice on rebuilding druntime with debug symbols. > That lead me to this "GitHub" stack trace: > > https://github.com/D-Programming-Language/druntime/blob/v2.06

Re: GktD: exceptions in handlers cause segfaults.

2013-07-19 Thread Marco Leise
Am Fri, 19 Jul 2013 11:10:04 +0200 schrieb Marco Leise : dav1d gave me advice on rebuilding druntime with debug symbols. That lead me to this "GitHub" stack trace: https://github.com/D-Programming-Language/druntime/blob/v2.063.2/src/rt/deh2.d#L104 https://github.com/D-Programming-Language/druntim

GktD: exceptions in handlers cause segfaults.

2013-07-19 Thread Marco Leise
I am trying to throw exceptions in gtk signal handlers, but I am greeted with segfaults. What's the cause and are there solutions? (DMD 2.063.2 on Linux x86-64) Here is some reduced code: import gtk.Main; import gtk.MainWindow; import gdk.Event; import gtk.Widget; class TestWindow : MainW

Re: Unit tests and segfaults

2012-12-11 Thread Jacob Carlborg
rsion stack limit reached" it just happens to be spelt "segfault" If you actually want to rely on segfaults there are code out there that can catch a segfault and convert it in to an exception. Actully, this got recently merged into druntime: https://github.com/D-Programming-Lang

Re: Unit tests and segfaults

2012-12-11 Thread Russel Winder
On Tue, 2012-12-11 at 18:58 +0100, Jonathan M Davis wrote: […] > I'd argue that if you want an error condition that you test for, you should > actually do something in your code that generates an error condition (e.g. > throw an exception) and that it really makes no sense to test

Re: Unit tests and segfaults

2012-12-11 Thread Jonathan M Davis
On Tuesday, December 11, 2012 17:16:58 Russel Winder wrote: > I am not relying on segfaults, that would just be silly ;-) The > issue is that unit tests should test error as well as success. I > want to know if I get a segfault when I have an infinite > recursion in an algorithm (due

Re: Unit tests and segfaults

2012-12-11 Thread Russel Winder
segmentation faults? It's generally speaking a very bad idea because behavior depends entirely on the platform and architecture... I am not relying on segfaults, that would just be silly ;-) The issue is that unit tests should test error as well as success. I want to know if I get a segfault w

Re: Unit tests and segfaults

2012-12-06 Thread Alex Rønne Petersen
which tests that a computer is off after you pull the plug. Regardless, since segfaults pretty much just kill the program, I don't think that you can do much. You could install a signal handler to catch the segfault, but segfaults aren't exceptions, and AFAIK, it's not possible to cont

Re: Unit tests and segfaults

2012-12-06 Thread Jonathan M Davis
er you pull the plug. Regardless, since segfaults pretty much just kill the program, I don't think that you can do much. You could install a signal handler to catch the segfault, but segfaults aren't exceptions, and AFAIK, it's not possible to continue the program (or at least that

Unit tests and segfaults

2012-12-06 Thread Russel Winder
What is the right idiom for testing that a function call does segfault when you want it to? -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465

Re: ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Rob T
On Tuesday, 13 November 2012 at 12:31:26 UTC, Kenji Hara wrote: This issue looks like bug8093. http://d.puremagic.com/issues/show_bug.cgi?id=8093 And the code works correctly in git head (dmd2.061alpha). Therefore, I think that the bug is fixed very recently. Kenji Hara Thanks for the resp

Re: ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Kenji Hara
%d", v_B.find(500) ); return 0; } When the return value of find() is ref, it segfaults or returns garbage. If the return value is a copy it works OK. The only oddity I can see is that 'val' goes out of scope, but it's a ref return value (pointer) to _v (right?), so it

ref return function using foreach ref result segfaults. Compiler bug?

2012-11-13 Thread Rob T
turn value of find() is ref, it segfaults or returns garbage. If the return value is a copy it works OK. The only oddity I can see is that 'val' goes out of scope, but it's a ref return value (pointer) to _v (right?), so it should work anyway. This looks like a bug in the compiler to me. What do you guys think? --rt

Re: Array appending segfaults

2011-10-29 Thread Jesse Phillips
On Sat, 29 Oct 2011 18:37:18 +0200, Artur Skawina wrote: > Tried D today for the very first time, and the first program started > segfaulting soon enough... The simplified version is this: Not of much help, but I'm no reproducing it with DMD 2.056 Debian amd64.

Array appending segfaults

2011-10-29 Thread Artur Skawina
Tried D today for the very first time, and the first program started segfaulting soon enough... The simplified version is this: - import core.thread; import std.stdio; class MyThread : Thread { this() { super(&run); } private: string s = "abcdefg"; void run() {

Re: SegFaults when using Fibers

2011-08-10 Thread Kagamin
Danny Arends Wrote: > OK > Thanks very much, made myself an account there and > re-posted the issue. Not OK. You forgot testcase.

Re: SegFaults when using Fibers

2011-08-10 Thread Danny Arends
OK Thanks very much, made myself an account there and re-posted the issue. Though it still feels like I'm doing something wrong

Re: SegFaults when using Fibers

2011-08-10 Thread simendsjo
On 10.08.2011 11:53, Danny Arends wrote: (Also posted this in bugs, but I think it needs to be here) The bugs newsgroup should be read-only. Post bugs here: http://d.puremagic.com/issues/ Events in bugzilla gets posted to the bugs newsgroup

SegFaults when using Fibers

2011-08-10 Thread Danny Arends
(Also posted this in bugs, but I think it needs to be here) When I try to print floats and doubles from a fiber it fails with a segfault, while it is possible to do the same in the main thread. The expected output of the attached code file: 15 15 Done However I get: 15 segfault I am using the D

QtD segfaults on showing messagebox

2011-05-16 Thread simendsjo
This happens on Win7 32 bit using dmd 2.053 and Qt 2010.05 import std.stdio; import qt.gui.QMessageBox; import qt.gui.QApplication; int main(string[] args) { auto app = new QApplication(args); // comment out the messagebox, and it doesn't crash QMessageBox.critical(null, tr("This is

Re: segfaults

2010-05-05 Thread Lars T. Kyllingstad
On Tue, 04 May 2010 15:22:52 -0500, Ellery Newcomer wrote: > On 05/04/2010 11:32 AM, Lars T. Kyllingstad wrote: >> >> Shouldn't 'term' and 'signaled' switch names? It looks to me like >> 'term' will be nonzero if the process receives any signal, while >> 'signaled' will be only be true if it is a

Re: segfaults

2010-05-04 Thread Ellery Newcomer
On 05/04/2010 11:32 AM, Lars T. Kyllingstad wrote: Shouldn't 'term' and 'signaled' switch names? It looks to me like 'term' will be nonzero if the process receives any signal, while 'signaled' will be only be true if it is a terminating signal, and not if it is a stop signal. signaled corres

Re: segfaults

2010-05-04 Thread Lars T. Kyllingstad
On Tue, 04 May 2010 08:55:36 -0500, Ellery Newcomer wrote: > On 05/04/2010 01:58 AM, Lars T. Kyllingstad wrote: >> std.process is currently undergoing a complete redesign, so the current >> situation should improve in the near future. :) >> >> -Lars > > That's good to hear. And since you're an exp

Re: segfaults

2010-05-04 Thread Ellery Newcomer
On 05/04/2010 09:51 AM, Graham Fawcett wrote: Thanks for posting this. Just curious -- why did you choose to model PID as a tuple instead of a struct? I'm not clear on what the tradeoffs are. Best, Graham according to core.sys.posix.sys.wait, this is only valid for linux, grrr. I don't think

Re: segfaults

2010-05-04 Thread Graham Fawcett
On Tue, 04 May 2010 08:55:36 -0500, Ellery Newcomer wrote: > On 05/04/2010 01:58 AM, Lars T. Kyllingstad wrote: > > >> In your case the segfault would cause SIGSEGV (signal 11) to be sent to >> the process, and the the above test would print "Process terminated by >> signal 11". >> >> See "man w

Re: segfaults

2010-05-04 Thread Ellery Newcomer
On 05/04/2010 01:58 AM, Lars T. Kyllingstad wrote: In your case the segfault would cause SIGSEGV (signal 11) to be sent to the process, and the the above test would print "Process terminated by signal 11". See "man wait" for more info. That's where I got my info (or rather /usr/include/bits/

Re: segfaults

2010-05-04 Thread Lars T. Kyllingstad
On Mon, 03 May 2010 20:32:03 -0500, Ellery Newcomer wrote: > On 05/03/2010 06:08 PM, Graham Fawcett wrote: >> >> [...] >> >> And "(139& 0xff00)>>> 8" evaluates to 0. I am not sure why it's >> not simply returning the raw status-code, though, and only on Posix >> systems -- it must be a Posi

Re: segfaults

2010-05-03 Thread Lars T. Kyllingstad
a success code >>> when the command in question segfaults. >>> >>> any ideas? >>> >>> [...] >> >> It's a null dereference. >> >> [...] > > I believe his problem is that the return code of the caller indicates > success.

Re: segfaults

2010-05-03 Thread Ellery Newcomer
On 05/03/2010 06:08 PM, Graham Fawcett wrote: What OS are you running on? In D2, this the definition of system(): int system(string command) { if (!command) return std.c.process.system (null); const commandz = toStringz (command); invariant status = std.c.process.

Re: segfaults

2010-05-03 Thread Graham Fawcett
On Mon, 03 May 2010 17:34:51 -0500, Ellery Newcomer wrote: > On 05/03/2010 04:49 PM, Steven Schveighoffer wrote: >> >> Could it be perhaps that it can't possibly get at that status? >> Remember, system runs /bin/sh -c, so all you can get as status is the >> return code of /bin/sh (which didn't seg

Re: segfaults

2010-05-03 Thread Ellery Newcomer
On 05/03/2010 04:49 PM, Steven Schveighoffer wrote: Could it be perhaps that it can't possibly get at that status? Remember, system runs /bin/sh -c, so all you can get as status is the return code of /bin/sh (which didn't segfault). -Steve All I know is the analogous code in python returns th

Re: segfaults

2010-05-03 Thread Bernard Helyer
l you can get as status is the return code of /bin/sh (which didn't segfault). -Steve sh -c returns failure if the specified executable segfaults.

Re: segfaults

2010-05-03 Thread Steven Schveighoffer
On Mon, 03 May 2010 17:25:30 -0400, Bernard Helyer wrote: On 04/05/10 08:57, Lars T. Kyllingstad wrote: On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults.

Re: segfaults

2010-05-03 Thread Bernard Helyer
On 04/05/10 08:57, Lars T. Kyllingstad wrote: On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ideas? // the caller import std.process; int main(){

Re: segfaults

2010-05-03 Thread Lars T. Kyllingstad
On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: > Hello. > > I'm trying to invoke a command inside d, and it returns a success code > when the command in question segfaults. > > any ideas? > > // the caller > import std.process; > > int

segfaults

2010-05-03 Thread Ellery Newcomer
Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ideas? // the caller import std.process; int main(){ auto r = system("./test"); return(r); } //test.d import std.stdio; void main()

Re: segfaults

2010-02-23 Thread Bernard Helyer
On 24/02/10 12:53, Ellery Newcomer wrote: Hey! You're right! import tango.io.Stdout; void main(){ Object obj = null; int[] a; a ~= 1; Stdout(obj.toString()).newline; } gives me Die: DW_TAG_type_unit (abbrev 7, offset 0x6f) parent at offset: 0xb has children: FALSE attributes: DW_AT_byte_size (

Re: segfaults

2010-02-23 Thread Ellery Newcomer
On 02/23/2010 03:22 PM, Bernard Helyer wrote: On 24/02/10 03:45, Ellery Newcomer wrote: I'm thinking it's an issue with DMD. I can get backtraces with simple programs. If you use a dynamic array in there somewhere, the chances of it not working go up, I'm afraid. This doesn't leave many progr

Re: segfaults

2010-02-23 Thread Bernard Helyer
On 24/02/10 03:45, Ellery Newcomer wrote: I'm thinking it's an issue with DMD. I can get backtraces with simple programs. If you use a dynamic array in there somewhere, the chances of it not working go up, I'm afraid. This doesn't leave many programs that *work*.

Re: segfaults

2010-02-23 Thread Robert Clipsham
On 23/02/10 17:33, Ellery Newcomer wrote: Oh. good idea. mua ha ha. ldc dies on compile: ldc: /home/kamm/eigenes/projekte/ldc/llvm-26/lib/VMCore/Instructions.cpp:921: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast(getOperand(1)->getType())->getElementType() && "Pt

Re: segfaults

2010-02-23 Thread Ellery Newcomer
On 02/23/2010 10:34 AM, Robert Clipsham wrote: I'm no expert, but that looks like a dmd bug, can you reproduce with ldc? The actual segfault is probably to do with your code, but if gdb gives that then there's a problem with the debug info that dmd is writing. The only easy way to debug this if

Re: segfaults

2010-02-23 Thread Robert Clipsham
On 23/02/10 02:14, Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) parent at offset: 0xb has chi

Re: segfaults

2010-02-23 Thread Ellery Newcomer
On 02/23/2010 06:28 AM, Steven Schveighoffer wrote: On Mon, 22 Feb 2010 21:14:08 -0500, Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well.

Re: segfaults

2010-02-23 Thread Steven Schveighoffer
On Mon, 22 Feb 2010 21:14:08 -0500, Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) pare

Re: segfaults

2010-02-23 Thread bearophile
Ellery Newcomer: > Is there any decent way to figure out where segfaults are coming from? > e.g. 200k lines of bad code converted from java To perform that translation you have to do first adapt the original Java code to D as much as possible keeping it woeking, then add unit tests t

Re: segfaults

2010-02-22 Thread Bernard Helyer
On 23/02/10 15:14, Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) parent at offset: 0xb has chi

Re: segfaults

2010-02-22 Thread Ellery Newcomer
On 02/22/2010 08:41 PM, Jesse Phillips wrote: Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset

Re: segfaults

2010-02-22 Thread Jesse Phillips
Ellery Newcomer wrote: > Is there any decent way to figure out where segfaults are coming from? > > e.g. 200k lines of bad code converted from java > > I tried gdb, and it didn't seem to work too well. > > Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) >parent at

segfaults

2010-02-22 Thread Ellery Newcomer
Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) parent at offset: 0xb has children: FALSE attributes: DW_AT_byte

Re: setAssertHandler (druntime) segfaults

2009-07-24 Thread Lutger
http://d.puremagic.com/issues/show_bug.cgi?id=3208

Re: setAssertHandler (druntime) segfaults

2009-07-24 Thread Jarrett Billingsley
On Fri, Jul 24, 2009 at 5:46 PM, Lutger wrote: > Jarrett Billingsley wrote: > >> On Fri, Jul 24, 2009 at 4:37 PM, Lutger >> wrote: >>> There is a function setAssertHandler in druntime, but when I try to use >>> it it segfaults. I'm not sure how it should b

Re: setAssertHandler (druntime) segfaults

2009-07-24 Thread Lutger
Jarrett Billingsley wrote: > On Fri, Jul 24, 2009 at 4:37 PM, Lutger > wrote: >> There is a function setAssertHandler in druntime, but when I try to use >> it it segfaults. I'm not sure how it should be used, this is a complete >> example of what I try to do: >

Re: setAssertHandler (druntime) segfaults

2009-07-24 Thread Jarrett Billingsley
On Fri, Jul 24, 2009 at 4:37 PM, Lutger wrote: > There is a function setAssertHandler in druntime, but when I try to use it > it segfaults. I'm not sure how it should be used, this is a complete example > of what I try to do: > > import std.stdio; > import core.exception; &

setAssertHandler (druntime) segfaults

2009-07-24 Thread Lutger
There is a function setAssertHandler in druntime, but when I try to use it it segfaults. I'm not sure how it should be used, this is a complete example of what I try to do: import std.stdio; import core.exception; void handleAssertion(string file, size_t line, string msg = null) { wri