Subject: Re: kern/35657 (gdb+threads problems on -current)
To: None <gnats-bugs@NetBSD.org>
From: Matthew Mondor <mm_lists@pulsar-zone.net>
List: netbsd-bugs
Date: 03/24/2007 11:02:36
--Multipart_Sat__24_Mar_2007_11_02_36_-0500_w/8mdQvIKbdLQqRG
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Wed, 21 Mar 2007 18:52:16 +0000 (UTC)
ad@netbsd.org wrote:

> Synopsis: gdb+threads problems on -current
> 
> State-Changed-From-To: analyzed->closed
> State-Changed-By: ad@netbsd.org
> State-Changed-When: Wed, 21 Mar 2007 18:52:15 +0000
> State-Changed-Why:
> This is fixed.

I just thought I should include a script(1) session which shows:

- threads debugging support not working (program compiled and
  linked with -g flag, not stripped, linked against libpthread
  and libphtread_dbg)
- a running process with two running threads ran through gdb
  becomes unkillable after a gdb hang when interrupted with
  ctrl-c and attempting to quit gdb (this program just runs
  two concurrent threads using peterson locking to share a
  common resource, heavily using printf(3), and runs/breaks
  fine when not under gdb)

on NetBSD 4.99.16 (cvs updated+compiled on Mars 23)
Both of these work fine on netbsd-3 branch

Perhaps I'm totally missing something new about how threaded programs
should be debugged with gdb on post-4 NetBSD?

Thanks,
-- 
Matt
--Multipart_Sat__24_Mar_2007_11_02_36_-0500_w/8mdQvIKbdLQqRG
Content-Type: text/plain; name=script.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=script.txt

Script started on Sat Mar 24 11:08:55 2007
 --- (ttyp9) root@sat.xisop # pwd
/home/mmondor/work/mmsoftware/mmftpd/src
 --- (ttyp9) root@sat.xisop # ls -l
total 1
drwxr-x---  2 mmondor  users     512 Mar 16 13:46 CVS
-rw-r-----  1 mmondor  users     627 Jul 17  2003 Makefile
-rwxr-x---  1 mmondor  users     566 Jan  1  2003 makepart.sh
-rwxr-xr-x  1 mmondor  users  295692 Mar 24 11:07 mmftpd
-rw-r-----  1 mmondor  users   15892 May  5  2004 mmftpd.8
-rw-r-----  1 mmondor  users  135358 Mar 16 13:46 mmftpd.c
-rw-r-----  1 mmondor  users   17682 Sep 19  2004 mmftpd.conf.5
-rw-r-----  1 mmondor  users   14362 Mar 16 13:46 mmftpd.h
-rw-r--r--  1 mmondor  users  135728 Mar 24 11:07 mmftpd.o
-rw-r-----  1 mmondor  users    8217 May  5  2004 mmftpdpasswd.5
 --- (ttyp9) root@sat.xisop # file mmf   
 --- (ttyp9) root@sat.xisop # file mmftpd                                      
 --- (ttyp9) root@sat.xisop # file mmftpd 
mmftpd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for NetBSD 4.99.16, dynamically linked (uses shared libs), not stripped
 --- (ttyp9) root@sat.xisop # uname -a
NetBSD sat.xisop 4.99.16 NetBSD 4.99.16 (GENERIC_LAPTOP_MM) #5: Fri Mar 23 21:53:39 EDT 2007  root@sat.xisop:/usr/src/sys/arch/i386/compile/GENERIC_LAPTOP_MM i386
 --- (ttyp9) root@sat.xisop # ./mmf     
 --- (ttyp9) root@sat.xisop # ./mmftpd                                         
 --- (ttyp9) root@sat.xisop # ./mmftpd 

+++ mmftpd (0.1.0/mmondor)

 --- (ttyp9) root@sat.xisop # ps axkpgid | grep mmftpd
1859 ?      S    0:00.00 mmftpd: Asynchroneous server process 
2085 ?      Ssl  0:00.00 mmftpd: Main threaded process 
2513 ?      S    0:00.00 mmftpd: Asynchroneous server process 
3700 ?      S    0:00.00 mmftpd: Asynchroneous server process 
 --- (ttyp9) root@sat.xisop # ps axsp2085
 UID  PID PPID CPU LID NLWP PRI NI  VSZ  RSS WCHAN  STAT TTY    TIME COMMAND
1001 2085    1 214  12   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214  11   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214  10   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   9   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   8   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   7   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   6   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   5   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   4   12 -14  0 2348 1220 parked DW   ?   0:00.00 mmftpd: Ma
1001 2085    1 214   3   12 -14  0 2348 1220 parked DW-  ?   0:00.00 mmftpd: Ma
1001 2085    1 214   2   12 -14  0 2348 1220 parked DW-  ?   0:00.00 mmftpd: Ma
1001 2085    1 214   1   12   2  0 2348 1220 poll   DW   ?   0:00.00 mmftpd: Ma
 --- (ttyp9) root@sat.xisop # gdb -p 2085
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf".
Attaching to process 2085
0xbbb1e1cb in ?? ()
(gdb) bt
#0  0xbbb1e1cb in ?? ()
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: , process 2085
 --- (ttyp9) root@sat.xisop # ps axkpgid | grep mmftpd
1859 ?      I    0:00.00 mmftpd: Asynchroneous server process 
2085 ?      Ssl  0:00.00 mmftpd: Main threaded process 
2513 ?      I    0:00.00 mmftpd: Asynchroneous server process 
3700 ?      I    0:00.00 mmftpd: Asynchroneous server process 
1856 ttyp9  R+   0:00.01 grep mmftpd (ksh)
 --- (ttyp9) root@sat.xisop # gdb 2085 1230
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...2085: No such file or directory.

Attaching to process 1230
ptrace: No such process.
/home/mmondor/work/mmsoftware/mmftpd/src/1230: No such file or directory.
(gdb) quit
 --- (ttyp9) root@sat.xisop # gdb 2085 mmf   
 --- (ttyp9) root@sat.xisop # gdb 2085 mmftpd                                  
 --- (ttyp9) root@sat.xisop # gdb 2085 mmftpd 
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...2085: No such file or directory.

"/home/mmondor/work/mmsoftware/mmftpd/src/mmftpd" is not a core dump: File format not recognized
(gdb) quit
 --- (ttyp9) root@sat.xisop # gdb mmftpd 2085
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...
Attaching to program: /home/mmondor/work/mmsoftware/mmftpd/src/mmftpd, process 2085
Reading symbols from /usr/lib/libc.so.12...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/lib/libcrypt.so.0...done.
Loaded symbols for /usr/lib/libcrypt.so.0
Reading symbols from /usr/lib/libpthread.so.0...done.
Loaded symbols for /usr/lib/libpthread.so.0
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
0xbbb1e1cb in poll () from /usr/lib/libc.so.12
(gdb) bt
#0  0xbbb1e1cb in poll () from /usr/lib/libc.so.12
#1  0xbbaedc15 in poll () from /usr/lib/libpthread.so.0
#2  0x080599b7 in tcp_server (
    message=0x805e0b0 "421 Server too busy, try again\r\n", 
    server_names=0x80630a0 "ftp.localhost", listen_ips=0x80634a0 "127.0.0.1", 
    uid=1001, gids=0x807c190, ngids=2, maxips=64, maxperip=5, ratemax=500, 
    rateper=30, timeout=300, port=21, resolve=0, 
    handleclient1=0x8052b90 <handleclient>) at ../mmlib/mmserver.c:369
#3  0x0804b920 in main (argc=7, argv=0xbfbfea48) at src/mmftpd.c:2592
(gdb) info threads
(gdb) thread 1
Thread ID 1 not known.
(gdb) tre  hread 2
Thread ID 2 not known.
(gdb) thread 0
Thread ID 0 not known.
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/mmondor/work/mmsoftware/mmftpd/src/mmftpd, process 2085
 --- (ttyp9) root@sat.xisop # telnet localhost 21
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 ftp.localhost FTP server (mmftpd (0.1.0/mmondor)) ready
quit
221 ftp.localhost Closing connection
Connection closed by foreign host.
 --- (ttyp9) root@sat.xisop # cd
 --- (ttyp9) root@sat.xisop # ls -l peters            cd /ho   
 --- (ttyp9) root@sat.xisop # cd /home/                                        
 --- (ttyp9) root@sat.xisop # cd /home/ mmon          
 --- (ttyp9) root@sat.xisop # cd /home/mmondor/                                
 --- (ttyp9) root@sat.xisop # cd /home/mmondor/ 
 --- (ttyp9) root@sat.xisop # ls -l peters      
 --- (ttyp9) root@sat.xisop # ls -l peterson_locking                           
 --- (ttyp9) root@sat.xisop # ls -l peterson_locking .c
-rw-r-----  1 mmondor  users  3028 Feb 17 03:56 peterson_locking.c
 --- (ttyp9) root@sat.xisop # cc -g -o peterson_locking peterson_locking.c
/var/tmp//ccozfm3y.o: In function `main':
/home/mmondor/peterson_locking.c:167: undefined reference to `pthread_attr_init'
/home/mmondor/peterson_locking.c:168: undefined reference to `pthread_attr_setdetachstate'
/home/mmondor/peterson_locking.c:171: undefined reference to `pthread_create'
/home/mmondor/peterson_locking.c:172: undefined reference to `pthread_create'
/home/mmondor/peterson_locking.c:174: undefined reference to `pthread_join'
/home/mmondor/peterson_locking.c:175: undefined reference to `pthread_join'
 --- (ttyp9) root@sat.xisop # 
 --- (ttyp9) root@sat.xisop # cc -g -o peterson_locking peterson_locking.c -peterson_locking.clpeterson_locking.cppeterson_locking.ctpeterson_locking.chpeterson_locking.rpeterson_lockingepeterson_lockinapeterson_lockidpeterson_lock peterson_loc-peterson_lolpeterson_lppeterson_tpetersonhpetersorpetersepeterapetedpet_pedpb
g -lpthread -lpthread_dbpeterson_locking.c                                    <gpeterson_locking.c peterson_locking.c
 --- (ttyp9) root@sat.xisop # gdb peter       peterson        
 --- (ttyp9) root@sat.xisop # gdb peterson_locking                             
 --- (ttyp9) root@sat.xisop # gdb peterson_locking 
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...
(gdb) run
Starting program: /home/mmondor/peterson_locking 
g[0] = 0
g[1] = 1
g[2] = 2
g[3] = 3
g[4] = 4
g[5] = 5
g[6] = 6
g[7] = 7
g[8] = 8
g[9] = 9
g[10] = 10
g[11] = 11
g[12] = 12
g[13] = 13
g[14] = 14
g[15] = 15
g[16] = 16
g[17] = 17
g[18] = 18
g[19] = 19
g[20] = 20
g[21] = 21
g[22] = 22
g[23] = 23
g[24] = 24
g[25] = 25
g[26] = 26
g[27] = 27
g[28] = 28
g[29] = 29
g[30] = 30
g[31] = 31
g[32] = 32
g[33] = 33
g[34] = 34
g[35] = 35
g[36] = 36
g[37] = 37
g[38] = 38
g[39] = 39
g[40] = 40
g[41] = 41
g[42] = 42
g[43] = 43
g[44] = 44
g[45] = 45
g[46] = 46
g[47] = 47
g[48] = 48
g[49] = 49
g[50] = 50
g[51] = 51
g[52] = 52
g[53] = 53
g[54] = 54
g[55] = 55
g[56] = 56
g[57] = 57
g[58] = 58
g[59] = 59
g[60] = 60
g[61] = 61
g[62] = 62
g[63] = 63
g[64] = 64
g[65] = 65
g[66] = 66
g[67] = 67
g[68] = 68
g[69] = 69
g[70] = 70
g[71] = 71
g[72] = 72
g[73] = 73
g[74] = 74
g[75] = 75
g[76] = 76
g[77] = 77
g[78] = 78
g[79] = 79
g[80] = 80
g[81] = 81
g[82] = 82
g[83] = 83
g[84] = 84
g[85] = 85
g[86] = 86
g[87] = 87
g[88] = 88
g[89] = 89
g[90] = 90
g[91] = 91
g[92] = 92
g[93] = 93
g[94] = 94
g[95] = 95
g[96] = 96
g[97] = 97
g[98] = 98
g[99] = 99
g[100] = 100
g[101] = 101
g[102] = 102
g[103] = 103
g[104] = 104
g[105] = 105
g[106] = 106
g[107] = 107
g[108] = 108
g[109] = 109
g[110] = 110
g[111] = 111
g[112] = 112
g[113] = 113
g[114] = 114
g[115] = 115
g[116] = 116
g[117] = 117
g[118] = 118
g[119] = 119
g[120] = 120
g[121] = 121
g[122] = 122
g[123] = 123
g[124] = 124
g[125] = 125
g[126] = 126
g[127] = 127
g[128] = 128
g[129] = 129
g[130] = 130
g[131] = 131
g[132] = 132
g[133] = 133
g[134] = 134
g[135] = 135
g[136] = 136
g[137] = 137
g[138] = 138
g[139] = 139
g[140] = 140
g[141] = 141
g[142] = 142
g[143] = 143
g[144] = 144
g[145] = 145
g[146] = 146
g[147] = 147
g[148] = 148
g[149] = 149
g[150] = 150
g[151] = 151
g[152] = 152
g[153] = 153
g[154] = 154
g[155] = 155
g[156] = 156
g[157] = 157
g[158] = 158
g[159] = 159
g[160] = 160
g[161] = 161
g[162] = 162
g[163] = 163
g[164] = 164
g[165] = 165
g[166] = 166
g[167] = 167
g[168] = 168
g[169] = 169
g[170] = 170
g[171] = 171
g[172] = 172
g[173] = 173
g[174] = 174
g[175] = 175
g[176] = 176
g[177] = 177
g[178] = 178
g[179] = 179
g[180] = 180
g[181] = 181
g[182] = 182
g[183] = 183
g[184] = 184
g[185] = 185
g[186] = 186
g[187] = 187
g[188] = 188
g[189] = 189
g[190] = 190
g[191] = 191
g[192] = 192
g[193] = 193
g[194] = 194
g[195] = 195
g[196] = 196
g[197] = 197
g[198] = 198
g[199] = 199
g[200] = 200
g[201] = 201
g[202] = 202
g[203] = 203
g[204] = 204
g[205] = 205
g[206] = 206
g[207] = 207
g[208] = 208
g[209] = 209
g[210] = 210
g[211] = 211
g[212] = 212
g[213] = 213
g[214] = 214
g[215] = 215
g[216] = 216
g[217] = 217
g[218] = 218
g[219] = 219
g[220] = 220
g[221] = 221
g[222] = 222
g[223] = 223
g[224] = 224
g[225] = 225
g[226] = 226
g[227] = 227
g[228] = 228
g[229] = 229
g[230] = 230
g[231] = 231
g[232] = 232
g[233] = 233
g[234] = 234
g[235] = 235
g[236] = 236
g[237] = 237
g[238] = 238
g[239] = 239
g[240] = 240
g[241] = 241
g[242] = 242
g[243] = 243
g[244] = 244
g[245] = 245
g[246] = 246
g[247] = 247
g[248] = 248
g[249] = 249
g[250] = 250
g[251] = 251
g[252] = 252
g[253] = 253
g[254] = 254
g[255] = 255
g[256] = 256
g[257] = 257
g[258] = 258
g[259] = 259
g[260] = 260
g[261] = 261
g[262] = 262
g[263] = 263
g[264] = 264
g[265] = 265
g[266] = 266
g[267] = 267
g[268] = 268
g[269] = 269
g[270] = 270
g[271] = 271
g[272] = 272
g[273] = 273
g[274] = 274
g[275] = 275
g[276] = 276
g[277] = 277
g[278] = 278
g[279] = 279
g[280] = 280
g[281] = 281
g[282] = 282
g[283] = 283
g[284] = 284
g[285] = 285
g[286] = 286
g[287] = 287
g[288] = 288
g[289] = 289
g[290] = 290
g[291] = 291
g[292] = 292
g[293] = 293
g[294] = 294
g[295] = 295
g[296] = 296
g[297] = 297
g[298] = 298
g[299] = 299
g[300] = 300
g[301] = 301
g[302] = 302
g[303] = 303
g[304] = 304
g[305] = 305
g[306] = 306
g[307] = 307
g[308] = 308
g[309] = 309
g[310] = 310
g[311] = 311
g[312] = 312
g[313] = 313
g[314] = 314
g[315] = 315
g[316] = 316
g[317] = 317
g[318] = 318
g[319] = 319
g[320] = 320
g[321] = 321
g[322] = 322
g[323] = 323
g[324] = 324
g[325] = 325
g[326] = 326
g[327] = 327
g[328] = 328
g[329] = 329
g[330] = 330
g[331] = 331
g[332] = 332
g[333] = 333
g[334] = 334
g[335] = 335
g[336] = 336
g[337] = 337
g[338] = 338
g[339] = 339
g[340] = 340
g[341] = 341
g[342] = 342
g[343] = 343
g[344] = 344
g[345] = 345
g[346] = 346
g[347] = 347
g[348] = 348
g[349] = 349
g[350] = 350
g[351] = 351
g[352] = 352
g[353] = 353
g[354] = 354
g[355] = 355
g[356] = 356
g[357] = 357
g[358] = 358
g[359] = 359
g[360] = 360
g[361] = 361
g[362] = 362
g[363] = 363
g[364] = 364
g[365] = 365
g[366] = 366
g[367] = 367
g[368] = 368
g[369] = 369
g[370] = 370
g[371] = 371
g[372] = 372
g[373] = 373
g[374] = 374
g[375] = 375
g[376] = 376
g[377] = 377
g[378] = 378
g[379] = 379
g[380] = 380
g[381] = 381
g[382] = 382
g[383] = 383
g[384] = 384
g[385] = 385
g[386] = 386
g[387] = 387
g[388] = 388
g[389] = 389
g[390] = 390
g[391] = 391
g[392] = 392
g[393] = 393
g[394] = 394
g[395] = 395
g[396] = 396
g[397] = 397
g[398] = 398
g[399] = 399
g[400] = 400
g[401] = 401
g[402] = 402
g[403] = 403
g[404] = 404
g[405] = 405
g[406] = 406
g[407] = 407
g[408] = 408
g[409] = 409
g[410] = 410
g[411] = 411
g[412] = 412
g[413] = 413
g[414] = 414
g[415] = 415
g[416] = 416
g[417] = 417
g[418] = 418
g[419] = 419
g[420] = 420
g[421] = 421
g[422] = 422
g[423] = 423
g[424] = 424
g[425] = 425
g[426] = 426
g[427] = 427
g[428] = 428
g[429] = 429
g[430] = 430
g[431] = 431
g[432] = 432
g[433] = 433
g[434] = 434
g[435] = 435
g[436] = 436
g[437] = 437
g[438] = 438
g[439] = 439
g[440] = 440
g[441] = 441
g[442] = 442
g[443] = 443
g[444] = 444
g[445] = 445
g[446] = 446
g[447] = 447
g[448] = 448
g[449] = 449
g[450] = 450
g[451] = 451
g[452] = 452
g[453] = 453
g[454] = 454
g[455] = 455
g[456] = 456
g[457] = 457
g[458] = 458
g[459] = 459
g[460] = 460
g[461] = 461
g[462] = 462
g[463] = 463
g[464] = 464
g[465] = 465
g[466] = 466
g[467] = 467
g[468] = 468
g[469] = 469
g[470] = 470
g[471] = 471
g[472] = 472
g[473] = 473
g[474] = 474
g[475] = 475
g[476] = 476
g[477] = 477
g[478] = 478
g[479] = 479
g[480] = 480
g[481] = 481
g[482] = 482
g[483] = 483
g[484] = 484
g[485] = 485
g[486] = 486
g[487] = 487
g[488] = 488
g[489] = 489
g[490] = 490
g[491] = 491
g[492] = 492
g[493] = 493
g[494] = 494
g[495] = 495
g[496] = 496
g[497] = 497
g[498] = 498
g[499] = 499
g[500] = 500
g[501] = 501
g[502] = 502
g[503] = 503
g[504] = 504
g[505] = 505
g[506] = 506
g[507] = 507
g[508] = 508
g[509] = 509
g[510] = 510
g[511] = 511
g[512] = 512
g[513] = 513
g[514] = 514
g[515] = 515
g[516] = 516
g[517] = 517
g[518] = 518
g[519] = 519
g[520] = 520
g[521] = 521
g[522] = 522
g[523] = 523
g[524] = 524
g[525] = 525
g[526] = 526
g[527] = 527
g[528] = 528
g[529] = 529
g[530] = 530
g[531] = 531
g[532] = 532
g[533] = 533
g[534] = 534
g[535] = 535
g[536] = 536
g[537] = 537
g[538] = 538
g[539] = 539
g[540] = 540
g[541] = 541
g[542] = 542
g[543] = 543
g[544] = 544
g[545] = 545
g[546] = 546
g[547] = 547
g[548] = 548
g[549] = 549
g[550] = 550
g[551] = 551
g[552] = 552
g[553] = 553
g[554] = 554
g[555] = 555
g[556] = 556
g[557] = 557
g[558] = 558
g[559] = 559
g[560] = 560
g[561] = 561
g[562] = 562
g[563] = 563
g[564] = 564
g[565] = 565
g[566] = 566
g[567] = 567
g[568] = 568
g[569] = 569
g[570] = 570
g[571] = 571
g[572] = 572
g[573] = 573
g[574] = 574
g[575] = 575
g[576] = 576
g[577] = 577
g[578] = 578
g[579] = 579
g[580] = 580
g[581] = 581
g[582] = 582
g[583] = 583
g[584] = 584
g[585] = 585
g[586] = 586
g[587] = 587
g[588] = 588
g[589] = 589
g[590] = 590
g[591] = 591
g[592] = 592
g[593] = 593
g[594] = 594
g[595] = 595
g[596] = 596
g[597] = 597
g[598] = 598
g[599] = 599
g[600] = 600
g[601] = 601
g[602] = 602
g[603] = 603
g[604] = 604
g[605] = 605
g[606] = 606
g[607] = 607
g[608] = 608
g[609] = 609
g[610] = 610
g[611] = 611
g[612] = 612
g[613] = 613
g[614] = 614
g[615] = 615
g[616] = 616
g[617] = 617
g[618] = 618
g[619] = 619
g[620] = 620
g[621] = 621
g[622] = 622
g[623] = 623
g[624] = 624
g[625] = 625
g[626] = 626
g[627] = 627
g[628] = 628
g[629] = 629
g[630] = 630
g[631] = 631
g[632] = 632
g[633] = 633
g[634] = 634
g[635] = 635
g[636] = 636
g[637] = 637
g[638] = 638
g[639] = 639
g[640] = 640
g[641] = 641
g[642] = 642
g[643] = 643
g[644] = 644
g[645] = 645
g[646] = 646
g[647] = 647
g[648] = 648
g[649] = 649
g[650] = 650
g[651] = 651
g[652] = 652
g[653] = 653
g[654] = 654
g[655] = 655
g[656] = 656
g[657] = 657
g[658] = 658
g[659] = 659
g[660] = 660
g[661] = 661
g[662] = 662
g[663] = 663
g[664] = 664
g[665] = 665
g[666] = 666
g[667] = 667
g[668] = 668
g[669] = 669
g[670] = 670
g[671] = 671
g[672] = 672
g[673] = 673
g[674] = 674
g[675] = 675
g[676] = 676
g[677] = 677
g[678] = 678
g[679] = 679
g[680] = 680
g[681] = 681
g[682] = 682
g[683] = 683
g[684] = 684
g[685] = 685
g[686] = 686
g[687] = 687
g[688] = 688
g[689] = 689
g[690] = 690
g[691] = 691
g[692] = 692
g[693] = 693
g[694] = 694
g[695] = 695
g[696] = 696
g[697] = 697
g[698] = 698
g[699] = 699
g[700] = 700
g[701] = 701
g[702] = 702
g[703] = 703
g[704] = 704
g[705] = 705
g[706] = 706
g[707] = 707
g[708] = 708
g[709] = 709
g[710] = 710
g[711] = 711
g[712] = 712
g[713] = 713
g[714] = 714
g[715] = 715
g[716] = 716
g[717] = 717
g[718] = 718
g[719] = 719
g[720] = 720
g[721] = 721
g[722] = 722
g[723] = 723
g[724] = 724
g[725] = 725
g[726] = 726
g[727] = 727
g[728] = 728
g[729] = 729
g[730] = 730
g[731] = 731
g[732] = 732
g[733] = 733
g[734] = 734
g[735] = 735
g[736] = 736
g[737] = 737
g[738] = 738
g[739] = 739
g[740] = 740
g[741] = 741
g[742] = 742
g[743] = 743
g[744] = 744
g[745] = 745
g[746] = 746
g[747] = 747
g[748] = 748
g[749] = 749
g[750] = 750
g[751] = 751
g[752] = 752
g[753] = 753
g[754] = 754
g[755] = 755
g[756] = 756
g[757] = 757
g[758] = 758
g[759] = 759
g[760] = 760
g[761] = 761
g[762] = 762
g[763] = 763
g[764] = 764
g[765] = 765
g[766] = 766
g[767] = 767
g[768] = 768
g[769] = 769
g[770] = 770
g[771] = 771
g[772] = 772
g[773] = 773
g[774] = 774
g[775] = 775
g[776] = 776
g[777] = 777
g[778] = 778
g[779] = 779
g[780] = 780
g[781] = 781
g[782] = 782
g[783] = 783
g[784] = 784
g[785] = 785
g[786] = 786
g[787] = 787
g[788] = 788
g[789] = 789
g[790] = 790
g[791] = 791
g[792] = 792
g[793] = 793
g[794] = 794
g[795] = 795
g[796] = 796
g[797] = 797
g[798] = 798
g[799] = 799
g[800] = 800
g[801] = 801
g[802] = 802
g[803] = 803
g[804] = 804
g[805] = 805
g[806] = 806
g[807] = 807
g[808] = 808
g[809] = 809
g[810] = 810
g[811] = 811
g[812] = 812
g[813] = 813
g[814] = 814
g[815] = 815
g[816] = 816
g[817] = 817
g[818] = 818
g[819] = 819
g[820] = 820
g[821] = 821
g[822] = 822
g[823] = 823
g[824] = 824
g[825] = 825
g[826] = 826
g[827] = 827
g[828] = 828
g[829] = 829
g[830] = 830
g[831] = 831
g[832] = 832
g[833] = 833
g[834] = 834
g[835] = 835
g[836] = 836
g[837] = 837
g[838] = 838
g[839] = 839
g[840] = 840
g[841] = 841
g[842] = 842
g[843] = 843
g[844] = 844
g[845] = 845
g[846] = 846
g[847] = 847
g[848] = 848
g[849] = 849
g[850] = 850
g[851] = 851
g[852] = 852
g[853] = 853
g[854] = 854
g[855] = 855
g[856] = 856
g[857] = 857
g[858] = 858
g[859] = 859
g[860] = 860
g[861] = 861
g[862] = 862
g[863] = 863
g[864] = 864
g[865] = 865
g[866] = 866
g[867] = 867
g[868] = 868
g[869] = 869
g[870] = 870
g[871] = 871
g[872] = 872
g[873] = 873
g[874] = 874
g[875] = 875
g[876] = 876
g[877] = 877
g[878] = 878
g[879] = 879
g[880] = 880
g[881] = 881
g[882] = 882
g[883] = 883
g[884] = 884
g[885] = 885
g[886] = 886
g[887] = 887
g[888] = 888
g[889] = 889
g[890] = 890
g[891] = 891
g[892] = 892
g[893] = 893
g[894] = 894
g[895] = 895
g[896] = 896
g[897] = 897
g[898] = 898
g[899] = 899
g[900] = 900
g[901] = 901
g[902] = 902
g[903] = 903
g[904] = 904
g[905] = 905
g[906] = 906
g[907] = 907
g[908] = 908
g[909] = 909
g[910] = 910
g[911] = 911
g[912] = 912
g[913] = 913
g[914] = 914
g[915] = 915
g[916] = 916
g[917] = 917
g[918] = 918
g[919] = 919
g[920] = 920
g[921] = 921
g[922] = 922
g[923] = 923
g[924] = 924
g[925] = 925
g[926] = 926
g[927] = 927
g[928] = 928
g[929] = 929
g[930] = 930
g[931] = 931
g[932] = 932
g[933] = 933
g[934] = 934
g[935] = 935
g[936] = 936
g[937] = 937
g[938] = 938
g[939] = 939
g[940] = 940
g[941] = 941
g[942] = 942
g[943] = 943
g[944] = 944
g[945] = 945
g[946] = 946
g[947] = 947
g[948] = 948
g[949] = 949
g[950] = 950
g[951] = 951
g[952] = 952
g[953] = 953
g[954] = 954
g[955] = 955
g[956] = 956
g[957] = 957
g[958] = 958
g[959] = 959
g[960] = 960
g[961] = 961
g[962] = 962
g[963] = 963
g[964] = 964
g[965] = 965
g[966] = 966
g[967] = 967
g[968] = 968
g[969] = 969
g[970] = 970
g[971] = 971
g[972] = 972
g[973] = 973
g[974] = 974
g[975] = 975
g[976] = 976
g[977] = 977
g[978] = 978
g[979] = 979
g[980] = 980
g[981] = 981
g[982] = 982
g[983] = 983
g[984] = 984
g[985] = 985
g[986] = 986
g[987] = 987
g[988] = 988
g[989] = 989
g[990] = 990
g[991] = 991
g[992] = 992
g[993] = 993
g[994] = 994
g[995] = 995
g[996] = 996
g[997] = 997
g[998] = 998
g[999] = 999
^C
Program received signal SIGINT, Interrupt.
0xbbb0ec57 in _lwp_wait () from /usr/lib/libc.so.12
(gdb) bt
#0  0xbbb0ec57 in _lwp_wait () from /usr/lib/libc.so.12
#1  0xbbbe7797 in pthread_join () from /usr/lib/libpthread.so.0
#2  0x08048b00 in main () at peterson_locking.c:174
(gdb) info threads
(gdb) thread 2
Thread ID 2 not known.
(gdb) thread0
Undefined command: "thread0".  Try "help".
(gdb) thread 0
Thread ID 0 not known.
(gdb) thread 1
Thread ID 1 not known.
(gdb) quit
The program is running.  Exit anyway? (y or n) y





^C^C
^Z[1] + Stopped              gdb peterson_locking 
 --- (ttyp9) root@sat.xisop # ps axsp8263
UID PID PPID CPU LID NLWP PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
 --- (ttyp9) root@sat.xisop # ps axsp3263
UID  PID PPID CPU LID NLWP PRI NI  VSZ RSS WCHAN   STAT TTY      TIME COMMAND
  0 3263 2104   0   3    2 -14  0 2132 668 lwpwait DW   ttyp9 0:00.00 /home/mmo
  0 3263 2104   0   1    2 -14  0 2132 668 lwpwait DW   ttyp9 0:00.00 /home/mmo
 --- (ttyp9) root@sat.xisop # ps axp3263
 PID TTY   STAT    TIME COMMAND
3263 ttyp9 DXEl 0:00.00 /home/mmondor/peterson_locking 
 --- (ttyp9) root@sat.xisop # kill 3263
 --- (ttyp9) root@sat.xisop # 
 --- (ttyp9) root@sat.xisop # kill 3263 
 --- (ttyp9) root@sat.xisop # ps axp3263 
 PID TTY   STAT    TIME COMMAND
3263 ttyp9 DXEl 0:00.00 /home/mmondor/peterson_locking 
 --- (ttyp9) root@sat.xisop # kill -9 3263
 --- (ttyp9) root@sat.xisop # 
 --- (ttyp9) root@sat.xisop # kill -9 3263 
 --- (ttyp9) root@sat.xisop # ps axp3263   
 PID TTY   STAT    TIME COMMAND
3263 ttyp9 DXEl 0:00.00 /home/mmondor/peterson_locking 
 --- (ttyp9) root@sat.xisop # pgrep gdb
2104
 --- (ttyp9) root@sat.xisop # kill 2104
stat 2 flag 0
 --- (ttyp9) root@sat.xisop # kill -9 2104
sorry, pid 3263 was killed: orphaned traced process
[1] + Killed               gdb peterson_locking 
 --- (ttyp9) root@sat.xisop # fg
/bin/ksh: fg: %%: no such job
 --- (ttyp9) root@sat.xisop # 
 --- (ttyp9) root@sat.xisop # fg 
 --- (ttyp9) root@sat.xisop # kill -9 2104 
 --- (ttyp9) root@sat.xisop # kill 2104    
 --- (ttyp9) root@sat.xisop # pgrep gdb 
 --- (ttyp9) root@sat.xisop # ps axp3263 
 PID TTY   STAT    TIME COMMAND
3263 ttyp9 DEl  0:00.00 /home/mmondor/peterson_locking 
 --- (ttyp9) root@sat.xisop # 
 --- (ttyp9) root@sat.xisop # ps axp3263 
 --- (ttyp9) root@sat.xisop # fg         
 --- (ttyp9) root@sat.xisop # kill -9 2104 
 --- (ttyp9) root@sat.xisop # kill 2104    
 --- (ttyp9) root@sat.xisop # pgrep gdb 
 --- (ttyp9) root@sat.xisop # ps axp3263 
 --- (ttyp9) root@sat.xisop # kill -9 3263 
 --- (ttyp9) root@sat.xisop # ps axp3263   
 --- (ttyp9) root@sat.xisop # kill 3263  
 --- (ttyp9) root@sat.xisop # ps axp3263 
 --- (ttyp9) root@sat.xisop # ps axsp3263 
UID  PID PPID CPU LID NLWP PRI NI  VSZ RSS WCHAN   STAT TTY      TIME COMMAND
  0 3263    1   0   3    2 -14  0 2132 668 lwpwait DW   ttyp9 0:00.00 /home/mmo
  0 3263    1   0   1    2 -14  0 2132 668 lwpwait DW   ttyp9 0:00.00 /home/mmo
 --- (ttyp9) root@sat.xisop # 
Script done on Sat Mar 24 11:17:12 2007

--Multipart_Sat__24_Mar_2007_11_02_36_-0500_w/8mdQvIKbdLQqRG--