Opened 17 years ago

Closed 6 years ago

Last modified 5 years ago

#2100 closed bug (fixed)

the libmicro test program mallocT2_100k blocks

Reported by: kaoutsis Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: System/POSIX Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

  • add the libmicro to your haiku image.

* {{{ ~>cd /boot/home/benchmarks/libmicro/bin ~/benchmarks/libmicro/bin>export OPTS="-1 -E -C 200 -L -S -W" ~/benchmarks/libmicro/bin>malloc $OPTS -N "mallocT2_100k" -s 100k -g 10 -T 2 -I 10000 Running: mallocT2_100k }}}

  • the test program stops there; no cpu activity

Change History (9)

comment:1 by kaoutsis, 17 years ago

while the test program is waiting, entering the KDL, serial gives:

kdebug> teams
team           id  parent      name
0x90db0000     94  0x90b67780  media_server
0x90b67780      1  0x00000000  kernel_team
0x90db0900     95  0x90b67780  midi_server
0x90f12780    313  0x90f12480  sh
0x90db8000     96  0x90b67780  print_server
0x90f1f780    317  0x90f12780  pe
0x90cb4d80     75  0x90b67780  syslog_daemon
0x90efe180   4263  0x90f12780  malloc
0x90d8bd80     79  0x90cb4900  input_server
0x90caa180     49  0x90b67780  registrar
0x91004480    579  0x90b67780  mail_daemon
0x90f2f300    362  0x90b67780  firefox-bin
0x90e02480    116  0x90db0000  media_addon_server
0x90caa780     54  0x90b67780  debug_server
0x90cb4480     56  0x90b67780  net_server
0x90d7e900     89  0x90b67780  Tracker
0x90cb4900     58  0x90b67780  app_server
0x90d90780     90  0x90b67780  Deskbar
0x90f12480    309  0x90d7e900  Terminal
kdebug> team malloc
TEAM: 0x90efe180
id:          4263 (0x10a7)
name:        'malloc'
args:        './malloc -1 -E -C 200 -L -S -W -N mallocT2_100k -s 100k -g 10 -'
next:        0x00000000
parent:      0x90f12780 (id = 313)
children:    0x00000000
num_threads: 2
state:       0
flags:       0x1
io_context:  0x90f4cb00
address_space: 0x90d7fd80
main_thread: 0x90e4b800
thread_list: 0x90e4a800
group_id:    4263
session_id:  313
kdebug> thread 4263
THREAD: 0x90e4b800
id:                 4263 (0x10a7)
name:               "malloc"
all_next:           0x91038000
team_next:          0x00000000
q_next:             0x90e4a800
priority:           10 (next 10)
state:              waiting
next_state:         waiting
cpu:                0x00000000
sig_pending:        0x0 (blocked: 0x0)
in_kernel:          1
  sem.blocking:     116912
  sem.count:        1
  sem.acquire_status: 0x0
  sem.flags:        0x5
condition variables:
fault_handler:      0x00000000
args:               0x90cefe80 0x00000000
entry:              0x80037b54
team:               0x90efe180, "malloc"
  exit.sem:         116928
  exit.status:      0x0 (No error)
  exit.reason:      0x0
  exit.signal:      0x0
  exit.waiters:
kernel_stack_area:  13017
kernel_stack_base:  0x807dd000
user_stack_area:    13018
user_stack_base:    0x7efe7000
user_local_storage: 0x7ffe7000
kernel_errno:       0x0 (No error)
kernel_time:        4238
user_time:          16634
flags:              0x0
architecture dependant section:
        esp: 0x807e0de8
        ss: 0x807e0010
        fpu_state at 0x90e4bb60
kdebug> es

comment:2 by kaoutsis, 17 years ago

while the test still rurnning, entered again to KDL, to see some infos for the other thread (which i had forgot:

kdebug> thread 4264
THREAD: 0x90e4a800
id:                 4264 (0x10a8)
name:               "pthread func"
all_next:           0x90fd3000
team_next:          0x90e4b800
q_next:             0x00000000
priority:           10 (next 10)
state:              waiting
next_state:         waiting
cpu:                0x00000000
sig_pending:        0x0 (blocked: 0x0)
in_kernel:          1
  sem.blocking:     116912
  sem.count:        1
  sem.acquire_status: 0x0
  sem.flags:        0x5
condition variables:
fault_handler:      0x00000000
args:               0x0023c758 0x180134c0
entry:              0x0022bcb0
team:               0x90efe180, "malloc"
  exit.sem:         116910
  exit.status:      0x0 (No error)
  exit.reason:      0x0
  exit.signal:      0x0
  exit.waiters:
kernel_stack_area:  13033
kernel_stack_base:  0x92ede000
user_stack_area:    13034
user_stack_base:    0x70000000
user_local_storage: 0x70040000
kernel_errno:       0x0 (No error)
kernel_time:        30
user_time:          873
flags:              0x0
architecture dependant section:
        esp: 0x92ee1de8
        ss: 0x92ee0010
        fpu_state at 0x90e4ab60
kdebug> 

comment:3 by kaoutsis, 17 years ago

revision is hrev25058

comment:4 by kaoutsis, 17 years ago

hrev25459: same behavior as previous

comment:5 by pulkomandy, 10 years ago

This is still deadlocking in hrev47342.

The problem seems to be with XSI semaphores, as both threads in the test are blocked in semop(). Syslog with tracing enabled for XSI semaphores:

KERN: xsi_semget: key = 0, numberOfSemaphores = 3, flags = 384
KERN: semget: new set = 1402392442 created, sequence = 2
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x730fd070, numOps = 1
KERN: xsi_semop: semaphoreNumber = 0, value = 0
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x730fcfec, numOps = 1
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x71f38770, numOps = 1
KERN: xsi_semop: semaphoreNumber = 0, value = 1
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x730fcfec, numOps = 1
KERN: xsi_semop: semaphoreNumber = 0, value = 0
KERN: XsiSemaphore::Add: potentially going to sleep
KERN: xsi_semop: thread 1267 going to sleep
KERN: xsi_semop: semaphoreNumber = 1, value = 0
KERN: XsiSemaphore::Add: potentially going to sleep
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x730fcfec, numOps = 2
KERN: xsi_semop: semaphoreNumber = 0, value = 0
KERN: xsi_semop: semaphoreNumber = 1, value = 0
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x730fcfec, numOps = 2
KERN: xsi_semop: thread 1267 back to life
KERN: xsi_semop: semaphoreNumber = 0, value = 1
KERN: xsi_semop: semaphoreNumber = 2, value = 0
KERN: XsiSemaphore::Add: potentially going to sleep
KERN: xsi_semop: thread 1266 going to sleep
KERN: xsi_semop: semaphoreNumber = 0, value = 1
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x71f38770, numOps = 1
KERN: xsi_semop: semaphoreNumber = 1, value = 1
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x71f38770, numOps = 1
KERN: xsi_semop: semaphoreNumber = 2, value = 0
KERN: xsi_semop: semaphore acquired succesfully
KERN: xsi_semop: semaphoreID = 1402392442, ops = 0x71f38770, numOps = 1
KERN: xsi_semop: semaphoreNumber = 0, value = 0
KERN: XsiSemaphore::Add: potentially going to sleep
KERN: xsi_semop: thread 1267 going to sleep

comment:6 by diver, 10 years ago

Component: - GeneralSystem/POSIX

comment:7 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:8 by waddlesplash, 6 years ago

Resolution: fixed
Status: assignedclosed

And it also doesn't anymore.

comment:9 by nielx, 5 years ago

Milestone: R1R1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.