Got a local retrace which is better:
--- stack trace --- #0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826 fd = 3 err = 52 parm = 0 multcount = 0 id = 0x0 #1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399 no_more_flags = 0 disallow_flags = 0 c = <value optimized out> name = "\1\0\0\0}0\264,0\344@", '\0' <repeats 13 times>, ";\22@\0\0\0\0" --- thread stack trace --- . Thread 1 (Thread 3074): #0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826 fd = 3 err = 52 parm = 0 multcount = 0 id = 0x0 #1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399 no_more_flags = 0 disallow_flags = 0 c = <value optimized out> name = "\1\0\0\0}0\264,0\344@", '\0' <repeats 13 times>, ";\22@\0\0\0\0" --- source code stack trace --- #0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826 1821: } 1822: } 1823: if (get_apmmode) { 1824: id = get_identify_data(fd, id); 1825: printf(" APM_level = "); 1826: if((id[83] & 0xc008) == 0x4008) { 1827: if (id[86] & 0x0008) 1828: printf("%u\n", id[91] & 0xff); 1829: else 1830: printf("off\n"); 1831: } else #1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399 2394: while (argc--) { 2395: argp = *argv++; 2396: if (no_more_flags || argp[0] != '-') { 2397: if (!num_flags_processed) 2398: do_defaults = 1; 2399: process_dev(argp); 2400: continue; 2401: } 2402: if (0 == strcmp(argp, "--")) { 2403: no_more_flags = 1; 2404: continue;
So clearly id == NULL here, and id[83] crashes.
Got a local retrace which is better:
--- stack trace ---
no_more_ flags = 0
disallow_ flags = 0 0}0\264, 0\344@" , '\0' <repeats 13 times>, ";\22@\0\0\0\0"
no_more_ flags = 0
disallow_ flags = 0 0}0\264, 0\344@" , '\0' <repeats 13 times>, ";\22@\0\0\0\0" data(fd, id); processed)
#0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826
fd = 3
err = 52
parm = 0
multcount = 0
id = 0x0
#1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399
c = <value optimized out>
name = "\1\0\0\
--- thread stack trace ---
.
Thread 1 (Thread 3074):
#0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826
fd = 3
err = 52
parm = 0
multcount = 0
id = 0x0
#1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399
c = <value optimized out>
name = "\1\0\0\
--- source code stack trace ---
#0 0x00000000004044d8 in process_dev (devname=0x0) at hdparm.c:1826
1821: }
1822: }
1823: if (get_apmmode) {
1824: id = get_identify_
1825: printf(" APM_level = ");
1826: if((id[83] & 0xc008) == 0x4008) {
1827: if (id[86] & 0x0008)
1828: printf("%u\n", id[91] & 0xff);
1829: else
1830: printf("off\n");
1831: } else
#1 0x0000000000406d29 in main (_argc=<value optimized out>, _argv=<value optimized out>) at hdparm.c:2399
2394: while (argc--) {
2395: argp = *argv++;
2396: if (no_more_flags || argp[0] != '-') {
2397: if (!num_flags_
2398: do_defaults = 1;
2399: process_dev(argp);
2400: continue;
2401: }
2402: if (0 == strcmp(argp, "--")) {
2403: no_more_flags = 1;
2404: continue;
So clearly id == NULL here, and id[83] crashes.