xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] infrequent address exception in XCreatePixmap, FYI


From: Peter Rowat
Subject: Re: [XForms] infrequent address exception in XCreatePixmap, FYI
Date: Tue, 3 Mar 2020 15:36:08 -0800

This is what lldb reported (truncated from my original message) — a BAD ACCESS:

Process 4581 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968)
    frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29
libX11.6.dylib`XCreatePixmap:
->  0x10012b52b <+29>: movq   0x968(%rbx), %rax
    0x10012b532 <+36>: testq  %rax, %rax
    0x10012b535 <+39>: je     0x10012b53c               ; <+46>
    0x10012b537 <+41>: movq   %rbx, %rdi
Target 0: (mod) stopped.

— Thanks for your reply
— Peter

 2020, at 2:58 PM, Jens Thoms Toerring <address@hidden> wrote:

Hi Peter,

On Tue, Mar 03, 2020 at 11:09:07AM -0800, Peter Rowat via xforms-development wrote:
My program runs successfully 90% of the time, but about every 10th run there
is an address exception appearing in XCreatePixmap.

Sorry to be stupid, but what exactly is an "address exception"? I'm
aware of SEGFAULT (dereferencing a non-existing address) and SIGBUS
(an unaligned access), but the term "address exception" doesn't ring
a bells. A quick search for the term on Google comes up with some
Java-ish stuff.

Here is the lldb output:

Process 4581 launched: '/Users/prowat/BioPrep/N2Prep/Izh2p2/mod' (x86_64)
......
......
Process 4581 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968)
   frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29
libX11.6.dylib`XCreatePixmap:
->  0x10012b52b <+29>: movq   0x968(%rbx), %rax
   0x10012b532 <+36>: testq  %rax, %rax
   0x10012b535 <+39>: je     0x10012b53c               ; <+46>
   0x10012b537 <+41>: movq   %rbx, %rdi
Target 0: (mod) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968)
 * frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29
   frame #1: 0x000000010012a589 libX11.6.dylib`XCreateBitmapFromData + 53
   frame #2: 0x000000010029f593 libforms.2.dylib`fli_init_stipples + 67
   frame #3: 0x0000000100250046 libforms.2.dylib`fli_init_colormap + 198
   frame #4: 0x0000000100258546 libforms.2.dylib`fl_initialize + 5334
   frame #5: 0x0000000100001577 mod`main(argc=1, argv=0x00007ffeefbff888) at runit1.c:315:2
   frame #6: 0x00007fff674a07fd libdyld.dylib`start + 1
   frame #7: 0x00007fff674a07fd libdyld.dylib`start + 1
(end of lldb print)===========

Had a look at the last potential culprit in XForms, fli_init_stipples().
But there's nothing that looks like it could result in a segmentation
fault or unaligned access. And I'd guess that this would be something
that would happen consistently and not just every tenth time the pro-
gram is started as everything used there is global variables which
should be the same each time round.

Frame #5: is at statement: `fl_initialize( &argc, argv, "BioPrep", 0, 0 );’
It was not the first executable statement but was before any other XForms
statement.

I’ve moved the fl_initialize statement to be the first executable, in case
this stops the address exceptions. None so far after 2 runs. If I get no
more address exceptions after another 20-30 runs, I’ll write again.

To be honest I'm not a big fan of movings stuff around in the code
to get rid of annoying behaviour as it, in my experience, tends to
at best move a bug to a place where it's less likely to be triggered,
but not to fix the underlying issue. My preference would be to figure
out what is really going on there;-) But then I don't really know yet
what this "address exeption" thingy actually signifies...

                         Best regards, Jens
-- 
 \   Jens Thoms Toerring  ________      address@hidden
  \_______________________________      http://toerring.de


reply via email to

[Prev in Thread] Current Thread [Next in Thread]