You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Travis Vitek (JIRA)" <ji...@apache.org> on 2008/05/16 22:59:55 UTC

[jira] Commented: (STDCXX-938) [aCC 363/HP 11.11] SEGV in 22.locale.*.mt

    [ https://issues.apache.org/jira/browse/STDCXX-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597612#action_12597612 ] 

Travis Vitek commented on STDCXX-938:
-------------------------------------

This issue was exposed by the use of {{rw_alarm}} in the {{rw_thread_pool}} code for STDCXX-536. I don't really do PA assembly, but here is a dump of the relevant code.

{noformat}
(gdb) disassemble
Dump of assembler code for function rw_alarm__FPFi_v:
;;; File: t.cpp
;;;  8 {
0x2d30 <rw_alarm(void (*)(int))>:       nop
0x2d34 <rw_alarm(void (*)(int))+0x4>:   nop
0x2d38 <rw_alarm(void (*)(int))+0x8>:   stw %r26,-0x24(%sp)
;;;  9   if (rw_sig_ign == handler) {
0x2d3c <rw_alarm(void (*)(int))+0xc>:   addil L'-0x800,%dp,%r1
0x2d40 <rw_alarm(void (*)(int))+0x10>:  ldw 0x768(%r1),%r1
0x2d44 <rw_alarm(void (*)(int))+0x14>:  ldw -0x24(%sp),%r31
0x2d48 <rw_alarm(void (*)(int))+0x18>:  copy %r1,%r19
0x2d4c <rw_alarm(void (*)(int))+0x1c>:  extrw,u %r1,31,2,%r20
0x2d50 <rw_alarm(void (*)(int))+0x20>:  cmpib,<>,n 2,%r20,0x2d64 <rw_alarm(void (*)(int))+0x34>
0x2d54 <rw_alarm(void (*)(int))+0x24>:  ldi 0x1000,%r21
0x2d58 <rw_alarm(void (*)(int))+0x28>:  cmpb,<<,n %r1,%r21,0x2d64 <rw_alarm(void (*)(int))+0x34>
0x2d5c <rw_alarm(void (*)(int))+0x2c>:  depw %r0,31,2,%r19
0x2d60 <rw_alarm(void (*)(int))+0x30>:  ldw 0(%r19),%r19
0x2d64 <rw_alarm(void (*)(int))+0x34>:  copy %r31,%r22
0x2d68 <rw_alarm(void (*)(int))+0x38>:  extrw,u %r31,31,2,%r1
0x2d6c <rw_alarm(void (*)(int))+0x3c>:  cmpib,<>,n 2,%r1,0x2d80 <rw_alarm(void (*)(int))+0x50>
0x2d70 <rw_alarm(void (*)(int))+0x40>:  ldi 0x1000,%r20
0x2d74 <rw_alarm(void (*)(int))+0x44>:  cmpb,<<,n %r31,%r20,0x2d80 <rw_alarm(void (*)(int))+0x50>
0x2d78 <rw_alarm(void (*)(int))+0x48>:  depw %r0,31,2,%r22
0x2d7c <rw_alarm(void (*)(int))+0x4c>:  ldw 0(%r22),%r22
0x2d80 <rw_alarm(void (*)(int))+0x50>:  cmpb,<>,n %r19,%r22,0x2d8c <rw_alarm(void (*)(int))+0x5c>
;;;  10     return 4;
0x2d84 <rw_alarm(void (*)(int))+0x54>:  b 0x2da0 <rw_alarm(void (*)(int))+0x70>
0x2d88 <rw_alarm(void (*)(int))+0x58>:  ldi 4,%ret0
;;;  13   else if (handler) {
{noformat}

Changing the pointer to refer to an address near the low end of the addressable range seems to fix the problem. This seems like a compiler problem to me, but I'd have to find the appropriate documentation to be sure.

> [aCC 363/HP 11.11] SEGV in 22.locale.*.mt
> -----------------------------------------
>
>                 Key: STDCXX-938
>                 URL: https://issues.apache.org/jira/browse/STDCXX-938
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Test Driver
>         Environment: HP-UX B.11.11 U
> aCC: HP ANSI C++ B3910B A.03.63
>            Reporter: Travis Vitek
>            Assignee: Travis Vitek
>             Fix For: 4.2.2
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I've reduced the problem to the following testcase...
> {noformat}
> [vitek@jenga tests]$ cat t.cpp; aCC -g t.cpp; gdb a.out
> extern "C" {
>   typedef void rw_signal_handler_t (int);
> }
> rw_signal_handler_t* const rw_sig_ign = (rw_signal_handler_t*)-2;
> unsigned rw_alarm (rw_signal_handler_t* handler)
> {
>   if (rw_sig_ign == handler) {
>     return 4;
>   }
>   else if (handler) {
>     return 5;
>   }
>   return 0;
> }
> extern "C" {
>   void my_signal_handler (int) { }
> }
> int main ()
> {
>   rw_alarm (my_signal_handler);
>   return 0;
> }
> HP gdb 5.0 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00
> and target hppa1.1-hp-hpux11.00.
> Copyright 1986 - 2001 Free Software Foundation, Inc.
> Hewlett-Packard Wildebeest 5.0 (based on GDB) is covered by the
> GNU General Public License. Type "show copying" to see the conditions to
> change it and/or distribute copies. Type "show warranty" for warranty/support.
> ..
> (gdb) run
> Starting program: /build/vitek/4.2.2/12s/tests/a.out 
> Program received signal SIGSEGV, Segmentation fault
>   si_code: 0 - SEGV_UNKNOWN - Unknown Error.
> 0x2d60 in rw_alarm (handler=0x4000113a <my_signal_handler>) at t.cpp:9
> 9         if (rw_sig_ign == handler) {
> (gdb) where
> #0  0x2d60 in rw_alarm (handler=0x4000113a <my_signal_handler>) at t.cpp:9
> #1  0x2df0 in main () at t.cpp:26
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.