Opened 14 years ago

Closed 14 years ago

#5152 closed bug (fixed)

playfile second launch waits for libbe initialisation

Reported by: korli Owned by: bonefish
Priority: high Milestone: R1
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

on hrev34699 I launch playfile successfully one time. A second launch blocks on libbe initialisation.

kdebug> bt 294
stack trace for thread 294 "playfile"
    kernel stack: 0xdf2df000 to 0xdf2e3000
      user stack: 0x7efef000 to 0x7ffef000
frame               caller     <image>:function + offset
 0 df2e2d64 (+  48) 80064e17   <kernel_x86>:scheduler_simple_init__Fv (nearest) + 0x051b
 1 df2e2d94 (+  96) 800651c7   <kernel_x86>:scheduler_simple_init__Fv (nearest) + 0x08cb
 2 df2e2df4 (+  48) 8005ff01   <kernel_x86>:thread_block_with_timeout_locked + 0x00e1
 3 df2e2e24 (+  80) 8003a5be   <kernel_x86> ConditionVariableEntry<0xdf2e2ea8>::Wait(uint32: 0x11 (17), int64: 9223372036854775807) + 0x0152
 4 df2e2e74 (+  80) 8004ddec   <kernel_x86>:_get_port_message_info_etc + 0x0188
 5 df2e2ec4 (+  80) 8004dc55   <kernel_x86>:port_buffer_size_etc + 0x0025
 6 df2e2f14 (+  48) 8004eebf   <kernel_x86>:_user_port_buffer_size_etc + 0x009b
 7 df2e2f44 (+ 100) 800e6902   <kernel_x86>:trap99 (nearest) + 0x00d2
user iframe at 0xdf2e2fa8 (end = 0xdf2e3000)
 eax 0xc6           ebx 0x5f4a94        ecx 0x7ffee8d8   edx 0xffff0114
 esi 0xffffffff     edi 0x7fffffff      ebp 0x7ffee904   esp 0xdf2e2fdc
 eip 0xffff0114  eflags 0x212      user esp 0x7ffee8d8
 vector: 0x63, error code: 0x0
 8 df2e2fa8 (+   0) ffff0114   <commpage>:commpage_syscall + 0x0004
 9 7ffee904 (+  48) 002c439d   <libbe.so> BPrivate::LinkReceiver<0x18035190>::AdjustReplyBuffer(int64: 9223372036854775807) + 0x0049
10 7ffee934 (+  64) 002c445f   <libbe.so> BPrivate::LinkReceiver<0x18035190>::ReadFromPort(int64: 9223372036854775807) + 0x003b
11 7ffee974 (+  48) 002c4243   <libbe.so> BPrivate::LinkReceiver<0x18035190>::GetNextMessage(0x7ffeea14, int64: 9223372036854775807) + 0x0047
12 7ffee9a4 (+  48) 002dc951   <libbe.so> BPrivate::ServerLink<0x7ffeea18>::FlushWithReply(0x7ffeea14) + 0x004d
13 7ffee9d4 (+  80) 003386ac   <libbe.so> BPrivate::BPrivateScreen<0x00000000>::_IsValid(int32: 3773280) + 0x0050
14 7ffeea24 (+  64) 0033825f   <libbe.so> BPrivate::BPrivateScreen<0x00000000>::_Get(int32: 1, true) + 0x00e7
15 7ffeea64 (+  48) 00338171   <libbe.so> BPrivate::BPrivateScreen<0x00000000>::Get(int32: 5659032) + 0x0025
16 7ffeea94 (+  48) 0033ec33   <libbe.so>:__7BScreenG9screen_id + 0x0023
17 7ffeeac4 (+  48) 003101fa   <libbe.so> system_colors() + 0x002a
18 7ffeeaf4 (+  40) 002f3f2b   <libbe.so> BPrivate::PaletteConverter<0x0046e07c>::_InitializeDefaultAppServer(0x4827a0) + 0x001b
19 7ffeeb1c (+  32) 00568b1d   <libroot.so>:pthread_once + 0x003d
20 7ffeeb3c (+  48) 002f3efa   <libbe.so> BPrivate::PaletteConverter<0x00000001>::InitializeDefault(true) + 0x004e
21 7ffeeb6c (+  64) 00312dcb   <libbe.so>:_init_interface_kit_ + 0x0023
22 7ffeebac (+  32) 002bdc3d   <libbe.so> BApplication<0x18053808>::_InitGUIContext(0x0) + 0x0031
23 7ffeebcc (+ 784) 002bb396   <libbe.so> BApplication<0x18053808>::_InitData(0x201ac0 "application/x-vnd.Haiku-playfile", true, NULL) + 0x06fe
24 7ffeeedc (+  48) 002ba810   <libbe.so>:__12BApplicationPCc + 0x0050
25 7ffeef0c (+  96) 00201685   <_APP_>:main + 0x01f1
26 7ffeef6c (+  48) 002012af   <_APP_>:_start + 0x005b
27 7ffeef9c (+  64) 00105bb6   </boot/system/runtime_loader@0x00100000>:unknown + 0x5bb6
28 7ffeefdc (+   0) 7ffeefec   3677:playfile_main_stack@0x7efef000 + 0xffffec
kdebug>
kdebug> thread 294
THREAD: 0xcd3cb000
id:                 294 (0x126)
name:               "playfile"
all_next:           0xcd3ac800
team_next:          0x00000000
q_next:             0x8013d050
priority:           10 (next 10, I/O: -1)
state:              waiting
next_state:         waiting
cpu:                0x00000000
sig_pending:        0x0 (blocked: 0x0)
in_kernel:          1
waiting for:        condition variable 0x8015e6e0
fault_handler:      0x00000000
args:               0xcd33ef00 0x00000000
entry:              0x8005906c
team:               0xccd67a00, "playfile"
  exit.sem:         1992
  exit.status:      0x0 (No error)
  exit.reason:      0x0
  exit.signal:      0x0
  exit.waiters:
kernel_stack_area:  3675
kernel_stack_base:  0xdf2df000
user_stack_area:    3677
user_stack_base:    0x7efef000
user_local_storage: 0x7ffef000
user_thread:        0x6fff0000
kernel_errno:       0x0 (No error)
kernel_time:        22697
user_time:          7697
flags:              0x0
architecture dependant section:
        esp: 0xdf2e2d08
        ss: 0x80130010
        fpu_state at 0xcd3cb3d0
kdebug> cvar 0x8015e6e0
condition variable 0x8015e6e0
  object:  0x8015e6b4 (port read)
  threads: 294
kdebug> port 0x8015e6b4
port -2146048332 (0x8015e6b4) doesn't exist!

It might be related to #5119, if more information is needed let me know.

Change History (3)

comment:1 by bonefish, 14 years ago

Component: - GeneralSystem/Kernel
Owner: changed from nobody to bonefish

If you want to use the port address with the "port" command, you have to use the "address" specifier. You can also directly use the condition variable address with "condition".

I can reproduce the problem here. Interestingly launching another playfile while the first is still running (as well as a third and a fourth) works fine. Only after the first has been terminated, it doesn't work anymore.

Anyway, there are no messages at the port. The app server side thread for the application ("a:...") waits on its port's read condition although a message is pending. So there's obviously still something wrong in the port code. I'll have a look.

comment:2 by korli, 14 years ago

Just realized it expect a port number by default. Here is the port info:

kdebug> port condition 0x8015e6e0
PORT: 0x8015e6b4
 id:              610485
 name:            "a<app_server"
 owner:           289
 capacity:        100
 read_count:      0
 write_count:     100
 total count:     2

comment:3 by mmadia, 14 years ago

Resolution: fixed
Status: newclosed

fixed in hrev34713

Note: See TracTickets for help on using tickets.