NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-vax/48041: after updating vax to new CSU stuff, various binaries get SIGSEGV on exit
The following reply was made to PR port-vax/48041; it has been noted by GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: port-vax/48041: after updating vax to new CSU stuff, various
binaries get SIGSEGV on exit
Date: Wed, 10 Jul 2013 12:43:02 +0200
--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
If NULL ctor/dtor pointers are allowd, this might fix it.
If they are not allowed, I have no clue how they happen.
Martin
--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch
Index: crtbegin.c
===================================================================
RCS file: /cvsroot/src/lib/csu/common/crtbegin.c,v
retrieving revision 1.3
diff -c -u -r1.3 crtbegin.c
--- crtbegin.c 27 Jun 2013 21:24:39 -0000 1.3
+++ crtbegin.c 10 Jul 2013 10:39:47 -0000
@@ -84,8 +84,9 @@
Jv_RegisterClasses(__JCR_LIST__);
#if !defined(HAVE_INITFINI_ARRAY)
- for (const fptr_t *p = __CTOR_LIST_END__; p > __CTOR_LIST__ + 1; ) {
- (*(*--p))();
+ for (const fptr_t *p = __CTOR_LIST_END__ -1; p > __CTOR_LIST__; p--) {
+ if (p)
+ (*(*p))();
}
#endif
}
@@ -116,8 +117,9 @@
#endif
#if !defined(HAVE_INITFINI_ARRAY)
- for (const fptr_t *p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__; ) {
- (*(*p++))();
+ for (const fptr_t *p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__; p++) {
+ if (p)
+ (*(*p))();
}
#endif
--AhhlLboLdkugWU4S--
Home |
Main Index |
Thread Index |
Old Index