Re: Segfault on simple program?
On Friday, 31 May 2013 at 17:14:46 UTC, Shriramana Sharma wrote: import std.stdio ; void foo ( int[] array ) { foreach ( i ; array ) { writeln ( i ) ; } } void main () { foo ( [ 1, 2, 3 ] ) ; } On both DMD 2.062 and 2.063 this compiles OK but causes a segfault. I'm running Kubuntu Raring 64-bit. Any hints? If you can attach your test-case program that segfaults compiled on that Kubuntu x86_64 I would be grateful. It will allow to see if it is OS problem, hardware problem or it is DMD that is producing bad code in some specific scenarios. Also it is easier to debug and reverse program when binary is given. Thanks in advance.
Re: Segfault on simple program?
On Saturday, 1 June 2013 at 14:41:13 UTC, Shriramana Sharma wrote: On Sat, Jun 1, 2013 at 7:57 PM, Anthony Goins neonto...@gmail.com wrote: Sometimes running ldconfig will solve wierd problems like this. Thanks and I tried that just now but no fruit. :-( Try a *full* removal of the deb installations (dmd and gdc). apt-get purge program_name Then reinstall latest DMD first. and test before moving on with GDC. If you are installing GDC from the distro, it's likely to be very old and of questionable use. --rt
Re: Segfault on simple program?
On Saturday, 1 June 2013 at 01:10:05 UTC, Shriramana Sharma wrote: On Sat, Jun 1, 2013 at 6:02 AM, Anthony Goins neonto...@gmail.com wrote: Works for me ubuntu 64. Do you have both versions installed? Of course not. The later install from the distributed DEB (from dlang.org) overwrites the earlier one by apt install. I would not trust the DEB package as my understanding is that the deb are not being properly produced at this time. Like I said, try a full removal using purge and reinstalling again. See this ... http://forum.dlang.org/thread/ffoovmyiwytfbvykc...@forum.dlang.org?page=7#post-koionl:241d0t:241:40digitalmars.com --rt
Re: Segfault on simple program?
On Saturday, 1 June 2013 at 10:11:35 UTC, Ali Çehreli wrote: On 06/01/2013 01:34 AM, Shriramana Sharma wrote: All programs compiled by *DMD* produce a segfault. Programs compiled by GDC work just fine. It is likely that GDC is from the D1 era. Not that package, it's an old D2 release, circa 2.046. and even then it has a different library name (libgphobos.a) and the module headers are installed in a separate directory from dmd.
Re: Segfault on simple program?
On 06/01/2013 01:34 AM, Shriramana Sharma wrote: All programs compiled by *DMD* produce a segfault. Programs compiled by GDC work just fine. It is likely that GDC is from the D1 era. What is this, some sort of incompatibility between compilers? If one is D1 and the other is current D, it is possible. Like GDC went and told my system hey look only D programs compiled by me should work?! Of courne not intentional like that but clearly there is some incompatibility there. I couldn't try LDC since they don't have Ubuntu packages I don't know for sure but neither GDC nor LDC packages that come under Linux distributions are modern enough. If so, I would remove GDC and try installing only dmd 2.063 again. Ali
Re: Segfault on simple program?
On Jun 1, 2013 3:46 PM, Ali Çehreli acehr...@yahoo.com wrote: If so, I would remove GDC and try installing only dmd 2.063 again. Tried that in all sorts of combinations. Still no use. Would there be some config files conflicting? But such conflicts would be reflected at compile time, not runtime, right? Since I don't want to reinstall my Ubuntu system just for this (that would be so Windows-like!), I'd appreciate pointers to resolve the situation. Thanks. Or should I take this to the d.gnu list or something?
Re: Segfault on simple program?
On Sat, Jun 1, 2013 at 7:57 PM, Anthony Goins neonto...@gmail.com wrote: Sometimes running ldconfig will solve wierd problems like this. Thanks and I tried that just now but no fruit. :-( -- Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
Segfault on simple program?
import std.stdio ; void foo ( int[] array ) { foreach ( i ; array ) { writeln ( i ) ; } } void main () { foo ( [ 1, 2, 3 ] ) ; } On both DMD 2.062 and 2.063 this compiles OK but causes a segfault. I'm running Kubuntu Raring 64-bit. Any hints? -- Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
Re: Segfault on simple program?
On Friday, 31 May 2013 at 17:14:46 UTC, Shriramana Sharma wrote: import std.stdio ; void foo ( int[] array ) { foreach ( i ; array ) { writeln ( i ) ; } } void main () { foo ( [ 1, 2, 3 ] ) ; } On both DMD 2.062 and 2.063 this compiles OK but causes a segfault. I'm running Kubuntu Raring 64-bit. Any hints? Can't reproduce this. Any chance of a stacktrace and/or disassembly?
Re: Segfault on simple program?
On Friday, 31 May 2013 at 18:22:44 UTC, Shriramana Sharma wrote: On Fri, May 31, 2013 at 11:46 PM, John Colvin john.loughran.col...@gmail.com wrote: Can't reproduce this. Any chance of a stacktrace and/or disassembly? Please give instructions as to how I can get either of those two for you. Would you like the binary produced? given a program named test in the current directory gdb ./test run #will segfault bt full and copy the output.
Re: Segfault on simple program?
On Sat, Jun 1, 2013 at 12:07 AM, John Colvin john.loughran.col...@gmail.com wrote: given a program named test in the current directory gdb ./test run #will segfault bt full and copy the output. Did it (after installing libc6-dbg just in case) but it doesn't seem to be very useful: (gdb) bt full #0 0x0043dd20 in _d_dso_registry () No symbol table info available. #1 0x0043862f in ?? () No symbol table info available. #2 0x0001 in ?? () No symbol table info available. #3 0x00463898 in TypeInfo_PS3std5array17__T8AppenderTAxaZ8Appender4Data.__init() () No symbol table info available. #4 0x00460bc8 in ?? () No symbol table info available. #5 0x00460db8 in ?? () No symbol table info available. #6 0x00460610 in ?? () No symbol table info available. #7 0x00460bc8 in ?? () No symbol table info available. #8 0x0040 in ?? () No symbol table info available. #9 0x0045790d in __libc_csu_init () No symbol table info available. #10 0x7760ee35 in __libc_start_main (main=0x43b0d0 main, argc=1, ubp_av=0x7fffdf58, init=0x4578b0 __libc_csu_init, fini=optimized out, rtld_fini=optimized out, stack_end=0x7fffdf48) at libc-start.c:219 result = optimized out unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 140737351945365, 140733193388033, 0, 1, 140737343639840, 0, 0}, mask_was_saved = 4392416}}, priv = {pad = {0x77def725 _dl_runtime_resolve+53, 0x1c, 0x4578b0 __libc_csu_init, 0x7fffdf58}, data = { prev = 0x77def725 _dl_runtime_resolve+53, cleanup = 0x1c, canceltype = 4552880}}} not_first_call = optimized out #11 0x00430609 in _start () No symbol table info available. -- Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
Re: Segfault on simple program?
On Friday, 31 May 2013 at 17:14:46 UTC, Shriramana Sharma wrote: import std.stdio ; void foo ( int[] array ) { foreach ( i ; array ) { writeln ( i ) ; } } void main () { foo ( [ 1, 2, 3 ] ) ; } On both DMD 2.062 and 2.063 this compiles OK but causes a segfault. I'm running Kubuntu Raring 64-bit. Any hints? Works for me ubuntu 64. Do you have both versions installed? Would it compile if you used the wrong druntime / phobos libraries?
Re: Segfault on simple program?
On Sat, Jun 1, 2013 at 6:02 AM, Anthony Goins neonto...@gmail.com wrote: Works for me ubuntu 64. Do you have both versions installed? Of course not. The later install from the distributed DEB (from dlang.org) overwrites the earlier one by apt install. Would it compile if you used the wrong druntime / phobos libraries? I don't have any D-related packages on my system other than the stock DMD AMD64 package. Even libphobos2-4.6-dev which is available for Raring is not installed. -- Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा