(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.
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
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
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
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
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
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
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
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
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'
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?
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.
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
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
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
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
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?
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 ()
{
14.06.2017 14:25, ag0aep6g пишет:
It's always a bug when dmd segfaults.
filed https://issues.dlang.org/show_bug.cgi?id=17502
On 06/14/2017 01:06 PM, drug wrote:
https://dpaste.dzfl.pl/b66fffa3bc8d
It's always a bug when dmd segfaults.
https://dpaste.dzfl.pl/b66fffa3bc8d
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
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
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?
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
I updated the issue. Strangely if done in the main everything is
fine :
Error: undefined identifier i
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
I remembered my psswd don't take my last sentence into account (i
will filed this).
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
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
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
%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
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
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.
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() {
Danny Arends Wrote:
> OK
> Thanks very much, made myself an account there and
> re-posted the issue.
Not OK. You forgot testcase.
OK
Thanks very much, made myself an account there and
re-posted the issue.
Though it still feels like I'm doing something wrong
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
(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
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
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
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
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
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
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
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/
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
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.
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.
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
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
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.
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.
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(){
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
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()
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 (
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
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*.
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
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
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
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.
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
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
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
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
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
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
http://d.puremagic.com/issues/show_bug.cgi?id=3208
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
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:
>
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;
&
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
90 matches
Mail list logo