Last fall the stock market resembled an edgy patient with chest pains who finally collapsed under great stress.

Now the patient is recovering, but the attack exposed major weaknesses. No one believes those problems will be cured soon; the question is whether they will be resolved before another crisis.

Some of the vulnerable points highlighted in studies of the Oct. 19 collapse -- including those cited in a huge report by the Securities and Exchange Commission last week -- involve program trading; the adequacy of Wall Street's supply of capital; market volatility; how the securities business is regulated, and the question of whether individuals are treated fairly in a market dominated by institutions.

From the thousands of pages of analysis by regulators and the markets themselves it's possible to reconstruct how these weaknesses combined to produce the stock market's worst day.

Although few people recognized them, there were signs in the months before Black Monday that the record bull market was coming to a close. The selloff that peaked in October had been under way for almost two months, since the Dow Jones industrial average capped its five-year, nearly 2000-point rise by breaking through the 2700 barrier in August 1987.

Still, as summer turned to fall and such respected figures as John Kenneth Galbraith predicted that rampant speculation would lead to market disaster, a hot professional money manager, George Soros, appeared on the cover of Fortune magazine, arguing that "new ways of valuing shares" could propel the Dow to 3500 or even 4000.

"If you want to know how much more overvalued American stocks can become," Soros said, "just look at Japan."

Indeed. While the purveyors of doom and gloom argued that a fall in U.S. stocks was inevitable because stock prices had reached historically lofty levels relative to corporate earnings, the optimists pointed out that U.S. stocks selling for 25 times earnings per share were cheap compared with Japanese shares selling for 60 to 70 times earnings.

In the October collapse, investors who accepted these rationalizations would lose billions of dollars overnight.

The earthquake on Black Monday followed several severe tremors. On Oct. 2, the Dow closed at 2640.99. During the weeks of Oct. 5 and 12, the Dow fell 158.78 points and 235.48 points, respectively, including a 108-point plunge on Friday the 16th.

Investors were shaken by that first triple-digit drop. Across the nation, individuals and professional money managers spent a nervous weekend wondering how bad things would be on Monday. Many customers called mutual funds to pull out their cash or transfer to safer investments.

In Washington, regulators sensed the nervousness and made arrangements to monitor early trading closely. The stage was set for the worst day in stock market history.

Friday's record drop of 108 points was exceeded in the first hour Oct. 19; the record volume of 608 million shares traded on Monday nearly doubled the record set on the 16th, jamming computers and card-printers on the New York Stock Exchange floor and overwhelming telephone lines and trading systems in the over-the-counter market.

The Dow Jones industrial average ended the day down 508 points. And the collapse was global; prior to the opening of trading in New York and Chicago, the Tokyo and London markets fell sharply. In a bid to get out as early as possible, one U.S. mutual fund sold $90 million of stock in London before the U.S. market opened.

What began that morning in the United States as a massive selloff led by a small group of institutional investors (mostly mutual funds and institutions utilizing program trading strategies) ultimately resulted in a broader panic. To this day, neither the functioning of key market mechanisms nor the overall level of investor confidence has recovered.

One consequence of the collapse has been the widespread condemnation of program trading, which many investors and stockbrokers consider the main source of their misery.

Program trading, a computer-directed strategy used by large institutions such as pension funds, usually involves trading in stocks and stock-index futures contracts such as the Standard & Poor's 500 index, which lets investors bet on the future prices of an average of 500 stocks.

In recent years money managers discovered they could use the S&P 500 index to provide themselves with portfolio insurance, a form of computer-directed program trading. Whenever stock prices declined by a fixed amount, the money managers would sell stock index futures contracts; if stock prices later plunged, the money manager could make a profit on the futures contracts that offset losses on stocks.

With the security of this safety net, institutions were willing to buy stock aggressively in the rising market last year, helping to push the Dow from 1900 in January to 2722 in August.

But when hordes of money managers all tried selling index futures contracts at the same time on Black Monday, prices plunged, trading turned chaotic and many orders couldn't be executed. As losses mounted, the holes in the safety net were painfully apparent.

At times, selling pressure was so great that stocks couldn't trade at all because of a lack of buy orders. Similar problems in the stock-index futures markets made execution of portfolio insurance strategies that called for massive sales at current market prices implausible.

Specialists on the floor of the New York and the American stock exchanges -- charged with maintaining orderly trading by leaning against the wave, buying stock when the public is selling and selling when the public is buying -- lacked sufficient capital to buy the stock that owners wanted to sell. Looking out for their own survival and ignoring their responsibilities, some specialists added to the problem by selling more shares than they bought during critical periods.

There has been general agreement in the post-collapse studies that specialists (and market makers in the over-the-counter market) need to have access to more capital to continue to function when there is a panic; at the same time, everyone recognizes that no amount of capital can withstand the kind of tidal wave that overwhelmed the markets on Black Monday.

Conditions were even worse in the over-the-counter market, where firms that had committed themselves to bidding on certain stocks quit answering their telephones. Across the nation, individual investors often failed in attempts to reach their stockbrokers, and found that even if they did, available information about stock prices and the possibility of executing orders was skimpy.

The generally shabby treatment accorded individual investors could be improved, studies said, by expanding market systems to handle higher volume. With many individuals brushed aside on Black Monday, large institutional investors with direct telephone lines to their brokers, and the brokerage houses themselves, dominated the selling. At the New York Stock Exchange, there was almost $500 million in stock sell orders loaded onto the automated "DOT" system -- which is supposed to speed order execution -- even before the market opened at 9:30 a.m. Of this total, about half was index arbitrage selling, a form of program trading.

Index arbitrage involves the simultaneous purchase of stock index futures contracts and the sale of stocks on which the contracts are based, or vice versa. If a contract can be bought for less than the stocks -- as was often the case Oct. 19 -- the computer orders the purchase of the contract and the sale of the stocks.

Multiplied thousands of times in a falling market, this strategy can turn a decline into a rout. The resulting wild price swings in hundreds of stocks that have little to do with the prospects for individual companies were exposed as one of the most serious weaknesses in the market in October. Last week the NYSE took steps to restrict index arbitrage whenever the Dow Jones industrial average swings more than 50 points in a single day.

Selling pressure from portfolio insurance and index arbitrage quashed any attempt by the market to rally on Black Monday. One institutional money manager, believed to be an investment advisory service of Wells Fargo Bank that specialized in portfolio insurance, sold shares in 13 waves of $100 million each until 2 p.m. Much of this more than $1 billion in stock sales activity was believed to be on behalf of a single client, the General Motors Corp. pension fund.

Delays in the New York Stock Exchange's automated order system led some professionals who had been buying futures and selling stocks in index arbitrage to halt their activities in the afternoon. The result was the removal of important stock index futures buying; also removed was the index arbitrage trading (selling stocks and buying futures) that had helped to keep stock and stock index futures prices synchronized.

As a result, the stock and stock index futures markets became disconnected, with both going into a free fall. The rapidly falling stock index futures prices suggested that stocks would fall hundreds and hundreds of points. Portfolio insurance followers continued selling stock index futures, when possible, which depressed prices further. This created a "billboard effect;" the appearance of sharply lower stock-index futures prices on electronic screens had a negative effect on investor psychology that led to even more dumping of stocks.

Lack of coordination in the stock and stock index futures markets demonstrated the need for unified regulation. The debate now is how to carry that out. The Commodity Futures Trading Commission, which supervises the stock-index futures markets, is unwilling to cede authority to the Securities and Exchange Commission, which believes it should have the last word in regulating both markets. One proposal to put the Federal Reserve in charge of both markets appears dead.

One of the most extraordinary aspects of the plunge -- which took the Dow down 508 points to 1738.74 -- was the significant influence of a handful of institutional investors. Although it was true that some of these institutions -- mutual funds -- were carrying out the wishes of thousands of individual customers, the direct selling on Black Monday could not be attributed to a classic public panic.

In the institutionally dominated, professional stock market of the 1980s, the biggest one-day drop was triggered by a relatively small number of money managers. The top four sellers of stock accounted for 14 percent of total sales; in the stock-index futures market, the top 10 sellers accounted for an astounding 50 percent of public volume.

The selling was concentrated in a few institutional hands using program trading, as major institutions using more traditional strategies remained on the sidelines. A survey of 20 of the pension funds with the most money under management indicated that nearly all were inactive traders during the week of Black Monday.

Black Monday was the worst, most terrifying one-day plunge ever. But the collapsed market would actually come closer to extinction and total meltdown the following day, when trading systems nearly ceased to function under the stress.

Since that time, the staggering stock market has continued to attempt a recovery from the October collapse. But glaring weaknesses remain, amid uncertainty over whether they will be addressed and fear that another debacle may lie ahead.