Forum: SDL RSS
DSFML parçalanma arızası hatası
erdem (Moderatör) #1
Üye Tem 2009 tarihinden beri · 1003 mesaj · Konum: Eskişehir
Grup üyelikleri: Genel Moderatörler, Üyeler
Profili göster · Bu konuya bağlantı
Konu adı: DSFML parçalanma arızası hatası
module main;
 
import dsfml.graphics;
 
void main(string[] args)
{
    auto window = new RenderWindow(VideoMode(800,600),"Hello DSFML!");
 
    auto head = new CircleShape(100);
    head.fillColor = Color.Green;
    head.position = Vector2f(300,100);
 
    auto leftEye = new CircleShape(10);
    leftEye.fillColor = Color.Blue;
    leftEye.position = Vector2f(350,150);
 
    auto rightEye = new CircleShape(10);
    rightEye.fillColor = Color.Blue;
    rightEye.position = Vector2f(430,150);
 
    auto smile = new CircleShape(30);
    smile.fillColor = Color.Red;
    smile.position = Vector2f(368,200);
 
    auto smileCover = new RectangleShape(Vector2f(60,30));
    smileCover.fillColor = Color.Green;
    smileCover.position = Vector2f(368,200);
 
    while (window.isOpen())
    {
        Event event;
 
        while(window.pollEvent(event))
        {
            if(event.type == event.EventType.Closed)
            {
                window.close();
            }
        }
 
        window.clear();
 
        window.draw(head);
        window.draw(leftEye);
        window.draw(rightEye);
        window.draw(smile);
        window.draw(smileCover);
 
        window.display();
    }
}

DSFML kütüphanesi kullanan şu  basit örneği derliyorum.

Derleme seçenekleri şöyle:

$ dmd deneme.d -IDSFML/src -L-LDSFMLC/lib -L-LDSFML/lib -L-ldsfml-graphics -L-ldsfml-window -L-ldsfml-system -L-ldsfmlc-graphics -L-ldsfmlc-window -L-ldsfmlc-system -ofdeneme

Programı çalıştırır çalıştırmaz bir parçalama arızası ("segmentation fault") hatası veriyor.

$ ./deneme
Parçalama arızası (çekirdek döküldü)


$ strace -f dmd -run deneme.d çıktısı biraz uzun da olsa şu şekilde:
execve("/usr/bin/dmd", ["dmd", "-run", "deneme.d"], [/* 37 vars */]) = 0
brk(0)                                  = 0x952a000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb775b000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=107318, ...}) = 0
mmap2(NULL, 107318, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7740000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0]\4\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=905712, ...}) = 0
mmap2(NULL, 935336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x82a000
mprotect(0x902000, 4096, PROT_NONE)     = 0
mmap2(0x903000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd8) = 0x903000
mmap2(0x908000, 26024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x908000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p[\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=124663, ...}) = 0
mmap2(NULL, 107008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xe07000
mmap2(0xe1e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xe1e000
mmap2(0xe20000, 4608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xe20000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\30\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30684, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
mmap2(NULL, 33360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xd5e000
mmap2(0xd65000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xd65000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000D\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=173576, ...}) = 0
mmap2(NULL, 176256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xead000
mmap2(0xed7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x29) = 0xed7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\37\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=116232, ...}) = 0
mmap2(NULL, 119344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xd1d000
mmap2(0xd39000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b) = 0xd39000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\226\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1730024, ...}) = 0
mmap2(NULL, 1739484, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x2b3000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0x2b3000
mmap2(0x2b6000, 10972, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b6000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773e000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773d000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb773d700, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x2b3000, 8192, PROT_READ)     = 0
mprotect(0xd39000, 4096, PROT_READ)     = 0
mprotect(0xed7000, 4096, PROT_READ)     = 0
mprotect(0xe1e000, 4096, PROT_READ)     = 0
mprotect(0xd65000, 4096, PROT_READ)     = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773c000
mprotect(0x903000, 16384, PROT_READ)    = 0
mprotect(0x9d6000, 4096, PROT_READ)     = 0
munmap(0xb7740000, 107318)              = 0
set_tid_address(0xb773d768)             = 2254
set_robust_list(0xb773d770, 0xc)        = 0
futex(0xbfc1c394, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, b773d700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0xe0c570, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xe0c5f0, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="erdem", ...}) = 0
brk(0)                                  = 0x952a000
brk(0x954b000)                          = 0x954b000
clock_getres(CLOCK_MONOTONIC, {0, 1})   = 0
clock_getres(0x7 /* CLOCK_??? */, {0, 1}) = 0
clock_getres(0x6 /* CLOCK_??? */, {0, 4000250}) = 0
clock_getres(CLOCK_MONOTONIC, {0, 1})   = 0
clock_getres(0x2 /* CLOCK_??? */, {0, 1}) = 0
clock_getres(0x4 /* CLOCK_??? */, {0, 1}) = 0
clock_getres(0x3 /* CLOCK_??? */, {0, 1}) = 0
time(NULL)                              = 1454534328
time(NULL)                              = 1454534328
rt_sigaction(SIGUSR1, {0x82ffe60, ~[RTMIN RT_1], SA_RESTART}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {0x82fff00, ~[RTMIN RT_1], 0}, NULL, 8) = 0
mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb763c000
open("/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb775a000
read(3, "00110000-002b3000 r-xp 00000000 "..., 1024) = 1024
read(3, "000 08:01 2360225    /lib/i386-l"..., 1024) = 1024
read(3, "48000-08370000 r-xp 00000000 08:"..., 1024) = 357
close(3)                                = 0
munmap(0xb775a000, 4096)                = 0
sched_getaffinity(2254, 32, {f})        = 4
clock_getres(CLOCK_MONOTONIC, {0, 1})   = 0
clock_gettime(CLOCK_MONOTONIC, {368, 708050930}) = 0
sched_getparam(2254, { 0 })             = 0
sched_getscheduler(2254)                = 0 (SCHED_OTHER)
sched_get_priority_min(SCHED_OTHER)     = 0
sched_get_priority_max(SCHED_OTHER)     = 0
rt_sigaction(SIGSEGV, {0x82f0498, ~[RTMIN RT_1], SA_RESETHAND|SA_SIGINFO}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGBUS, {0x82f0498, ~[RTMIN RT_1], SA_RESETHAND|SA_SIGINFO}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSEGV, {SIG_DFL, [], 0}, NULL, 8) = 0
rt_sigaction(SIGBUS, {SIG_DFL, [], 0}, NULL, 8) = 0
mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb753c000
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc1bb7c) = -1 ENOTTY (Inappropriate ioctl for device)
stat64("dmd.conf", 0xbfc1bb94)          = -1 ENOENT (No such file or directory)
stat64("/home/erdem/dmd.conf", 0xbfc1bb94) = -1 ENOENT (No such file or directory)
stat64("dmd.conf", 0xbfc1bb94)          = -1 ENOENT (No such file or directory)
stat64("/home/erdem/bin/dmd", 0xbfc1bb70) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/dmd", 0xbfc1bb70) = -1 ENOENT (No such file or directory)
stat64("/usr/bin/dmd", {st_mode=S_IFREG|0755, st_size=4255868, ...}) = 0
stat64("/usr/bin/dmd.conf", 0xbfc1bb94) = -1 ENOENT (No such file or directory)
lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/usr/bin", {st_mode=S_IFDIR|0755, st_size=69632, ...}) = 0
lstat64("/usr/bin/dmd", {st_mode=S_IFREG|0755, st_size=4255868, ...}) = 0
stat64("/usr/bin/dmd.conf", 0xbfc1bb94) = -1 ENOENT (No such file or directory)
open("/etc/dmd.conf", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=658, ...}) = 0
read(3, ";\n; dmd.conf file for dmd\n;\n; dm"..., 658) = 658
close(3)                                = 0
mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb74bb000
mmap2(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb747a000
open("deneme.d", O_RDONLY|O_LARGEFILE)  = -1 ENOENT (No such file or directory)
write(2, "Error: ", 7Error: )                  = 7
write(2, "module ", 7module )                  = 7
write(2, "deneme ", 7deneme )                  = 7
write(2, "is in file 'deneme.d' which cann"..., 43is in file 'deneme.d' which cannot be read
) = 43
write(2, "import path[0] = /usr/include/dm"..., 41import path[0] = /usr/include/dmd/phobos
) = 41
write(2, "import path[1] = /usr/include/dm"..., 50import path[1] = /usr/include/dmd/druntime/import
) = 50
exit_group(1)                           = ?

Anladığım kadarıyla çalışma anında bir kütüphaneye ihtiyaç duyuyor. Ama LD_LIBRARY_PATH değişkenine o kütüphane dizinini ekledikten sonra da parçalama arızası vermeye başladı.
acehreli (Moderatör) #2
Kullanıcı başlığı: Ali Çehreli
Üye Haz 2009 tarihinden beri · 4536 mesaj
Grup üyelikleri: Genel Moderatörler, Üyeler
Profili göster · Bu konuya bağlantı
Bulunamayan kütüphanenin parçalanma arızası vereceğini sanmam. Ama eğer kütüphaneyle ilgiliyse, parçalanma arızası uygun olmayan kütüphane kullanıldığında oluşur. Yanlış kütüphane sürümü, 32 bit yerine 64 bit, vs.

Kusura bakma, DSFML'i de hiç denemedim... :-/

Ali
erdem (Moderatör) #3
Üye Tem 2009 tarihinden beri · 1003 mesaj · Konum: Eskişehir
Grup üyelikleri: Genel Moderatörler, Üyeler
Profili göster · Bu konuya bağlantı
Şimdi çalıştı :)

[Resim: http://www.erdem.tk/resim/resim/dsfml.png]

Derlerken de şu seçenekler kullanılıyor.

$ dmd -g -debug -ofdeneme deneme.d -IDSFML/src -L-LDSFMLC/lib -L-LDSFML/lib -L-ldsfml-graphics -L-ldsfml-window -L-ldsfml-system -L-ldsfmlc-graphics -L-ldsfmlc-window -L-ldsfmlc-system
Bu mesaj erdem tarafından değiştirildi; zaman: 2016-12-14, 23:29.
Doğrulama Kodu: VeriCode Lütfen resimde gördüğünüz doğrulama kodunu girin:
İfadeler: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Özel Karakterler:
Forum: SDL RSS
Bağlı değilsiniz. · Şifremi unuttum · ÜYELİK
This board is powered by the Unclassified NewsBoard software, 20100516-dev, © 2003-10 by Yves Goergen
Şu an: 2017-12-15, 05:53:39 (UTC -08:00)